Unit scripting ? |

Hi, I got a few questions about unit that I can't test because I'm at work and wanted to see if any one could answer them.
1. Can U found out if a specific unit was in combat the last turn?
2. Can U found the location of a specific unit the last turn even if it was in the cargo of a ship?
3. Can U replace a comp. or change any properties of a comp. in a unit by using a script event?
Thanks in advance for any answers you guys have...
He ponders the dangers inherent in the advantages, and advantages inherent in the dangers. - Ts'ao Ts'ao
Crimson

Re: Unit scripting ?
Sys_Get_Event_Storage_Long and Sys_Set_Event_Storage_Long are the two script commands from the script docs you will need to store data from one turn to the next. Its the only output method for scripting using retained data.
It sounds possible to get specific units from cargo and other locations, haven't tried that specific way with units but I have done it with components and event messages.




Re: Unit scripting ?
In order to get information about units from a previous turn, you need to set up your scripts to store and recal data from a Datafile.
I'm not sure how to do this, but I will probably have to figure it out myself eventually.
As for replacing a component on an already existing unit...boy...that one I don't have the foggiest on, sorry.
"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
Download my mod here: GidMod