View unanswered posts | View active topics It is currently Mon May 06, 2024 7:50 pm



Reply to topic  [ 5 posts ] 
 Removing items a units inventory with lua 
Author Message
User avatar

Joined: Sun Jan 18, 2009 12:24 pm
Posts: 96
Reply with quote
Post Removing items a units inventory with lua
Just a quick question, is it possible to add an item to an actor and then have it automatically removed using lua? If so I have a great idea for a mod haha


Sat Mar 06, 2010 11:41 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Removing items a units inventory with lua
Any particular reason you need him to hold the device and then drop it?

Might spawning the device right next to the actor work just as well?


Sat Mar 06, 2010 12:19 pm
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Removing items a units inventory with lua
Disarming ray?


Sat Mar 06, 2010 12:31 pm
Profile WWW
User avatar

Joined: Sun Jan 18, 2009 12:24 pm
Posts: 96
Reply with quote
Post Re: Removing items a units inventory with lua
I had an idea, inspired by the wargear system from the Warhammer tabletop game, and by Capnbubs Crobos faction. You would choose a piece of wargear (say, heavy armor), and drop it on the unit. Then, using a method similar to that of the Crobos, the armor would be changed to heavy armor. However, if you have a lot of wargear (armor, shields, teleport beacon, earmuffs etc) it would fill up your inventory with useless stuff. So if it could be deleted from the inventory as soon as it has equipped the wargear it would be a much easier to use system.


Sat Mar 06, 2010 12:33 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Removing items a units inventory with lua
This deletes any MO, but only works for devices when they're currently being held.
Code:
device.ToDelete = true


This adds a device to an actor's inventory:
Code:
actor:AddInventoryItem(CreateHDFirearm("SMG"))


Sat Mar 06, 2010 4:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.033s | 17 Queries | GZIP : Off ]