View unanswered posts | View active topics It is currently Thu Mar 28, 2024 10:21 am



Reply to topic  [ 3 posts ] 
 Randomizing AddInventory 
Author Message
User avatar

Joined: Sun Jun 27, 2010 9:07 pm
Posts: 25
Reply with quote
Post 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!


Thu Mar 27, 2014 8:41 am
Profile
User avatar

Joined: Sun Oct 14, 2012 10:06 pm
Posts: 7
Location: Marooned in the frozen wastes. send help.
Reply with quote
Post 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.


Thu Mar 27, 2014 2:15 pm
Profile
User avatar

Joined: Sun Jun 27, 2010 9:07 pm
Posts: 25
Reply with quote
Post 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!


Thu Mar 27, 2014 9:57 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.064s | 15 Queries | GZIP : Off ]