Data Realms Fan Forums
http://45.55.195.193/

Quick lua question.
http://45.55.195.193/viewtopic.php?f=1&t=46224
Page 1 of 1

Author:  gridbull [ Wed Nov 15, 2017 5:59 am ]
Post subject:  Quick lua question.

Is it possible to add a pie menu option that adds a specific weapon to the actor's inventory when pressed, I've been trying to do this for a little while with no success.

Thanks in advance.

Author:  CaveCricket48 [ Thu Nov 16, 2017 1:35 am ]
Post subject:  Re: Quick lua question.

This is possible, yes.

Coalition.rte/Actors/Blast Runner/

has an example of a pie menu button on an actor. You can edit the BlastRunner.ini to make the actor usable in-game by changing Buyable = 0 to 1, if you want to play around with it.

The code that adds the pie menu button to the actor -

Code:
   AddPieSlice = Slice
      Description = Detonate
      Direction = 2
      Icon = Icon
         PresetName = Blast Runner Detonate
         FrameCount = 2
         BitmapFile = ContentFile
            FilePath = Coalition.rte/Devices/Sprites/PieIcons/IconDetonate.bmp
      ScriptPath = Coalition.rte/Actors/Blast Runner/BlastRunnerPie.lua
      FunctionName = BlastRunnerDetonateCall


If you want to add an item to an actor's inventory, have something like this in your lua script:

Code:
      local item = CreateHDFirearm("Heavy Digger");
      actor:AddInventoryItem(item);

Author:  gridbull [ Thu Nov 16, 2017 2:18 am ]
Post subject:  Re: Quick lua question.

Wow, thanks. That helped a ton! Also just introduced me to these adorable little suicide bots, I love them!

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/