Add Item to Inventory
Posted: Wed Sep 09, 2015 3:34 am
I'd like to add an item to the players inventory, once he researches a specific technology.
So, this should only happen once, upon researching the technology.
I'm assuming this would be done in the control.lua
Something like:
(the above code was not working)
I can't seem to figure it out.
Can someone possibly help me or point me to a mod that does this?
Where in control.lua should I place this and what is the correct syntax.
Thanks.
So, this should only happen once, upon researching the technology.
I'm assuming this would be done in the control.lua
Something like:
Code: Select all
if game.players.force.technologies["Tech_Name"].researched then
game.player.insert{name="iron-plate",count=1}
end
I can't seem to figure it out.
Can someone possibly help me or point me to a mod that does this?
Where in control.lua should I place this and what is the correct syntax.
Thanks.