Data Realms Fan Forums
http://forums.datarealms.com/

Randomizing AddInventory
http://forums.datarealms.com/viewtopic.php?f=1&t=45600
Page 1 of 1

Author:  Tato64 [ Thu Mar 27, 2014 8:41 am ]
Post subject:  Randomizing AddInventory

Hello fellow modders! I've been working on a faction for some time now, to add some "Variety" (in order to avoid having an army of "Clones") i made every soldiers spawn with a different head and headgear, also every soldier comes with a weapon (Depending on its "Class") but now i'd like the snipers (There are 2 sniper rifles) to spawn with one rifle OR the other, is this possible? Without using lua?

Thanks in advance!

Author:  FurryLizard [ Thu Mar 27, 2014 2:15 pm ]
Post subject:  Re: Randomizing AddInventory

As far as I know, it is not possible to give an actor a random weapon without using lua, but the lua code should be pretty simple:

Code:
function Create(self)
    self:AddInventoryItem(RandomHDFirearm("Sniper Weapons", "your.rtefolderhere"))
end


Providing you have "AddToGroup = Sniper Weapons" in the .ini for both rifles, this should work fine.

Author:  Tato64 [ Thu Mar 27, 2014 9:57 pm ]
Post subject:  Re: Randomizing AddInventory

FurryLizard wrote:
As far as I know, it is not possible to give an actor a random weapon without using lua, but the lua code should be pretty simple:

Code:
function Create(self)
    self:AddInventoryItem(RandomHDFirearm("Sniper Weapons", "your.rtefolderhere"))
end


Providing you have "AddToGroup = Sniper Weapons" in the .ini for both rifles, this should work fine.


So i just create a lua file with that and then i add "ScriptPath = whatever.lua" to the Actor's ini and that's it?
Thanks a lot!

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