How do I: Use MissionLua to modify Unit Stats live?
Posted: Sat Apr 07, 2007 9:52 pm
How do I use Lua script, upon an event, (i.e. flag pick up) to change the statistics of a particular unit? I tried looking at Zerted 's holocron mode but I couldn't interpret what I needed by myself.
It seems that the code was choosing targets of functions in one spot of the code and putting them into strings or something, then referring to them later, and I couldn't keep track of it.
My ultimate goal is to spawn pick up weapons, in theory it is extremely simple knowing that all the required engine capabilities have successfully been exploited in Archer's Ferret Master alone ([size = 7] Oddly enough, he didn't implement weapons pickups[/size])
Basically, you take a flag odf, change the msh to a gun msh, spawn the flag in a map, and once the flag is picked up, an the onflagpickup event is triggered, the unit that picked up the weapon is read-in, and then its stats are changed to give it a fitth weapon or replace an existing one.
Any code experts see anything wrong with this?
It seems that the code was choosing targets of functions in one spot of the code and putting them into strings or something, then referring to them later, and I couldn't keep track of it.
My ultimate goal is to spawn pick up weapons, in theory it is extremely simple knowing that all the required engine capabilities have successfully been exploited in Archer's Ferret Master alone ([size = 7] Oddly enough, he didn't implement weapons pickups[/size])
Basically, you take a flag odf, change the msh to a gun msh, spawn the flag in a map, and once the flag is picked up, an the onflagpickup event is triggered, the unit that picked up the weapon is read-in, and then its stats are changed to give it a fitth weapon or replace an existing one.
Any code experts see anything wrong with this?