![Smile :)](images/smilies/icon_e_smile.gif)
- OnCreate
- A table of unit IDs that assisted with its construction (eg, t1 land factory, 5 t1 engineers, ACU). Later on it would be cool if we could break down the percentage that each unit type contributed to its completion, but just getting the list of units that were assisting with construction as it completed should work for 95% of common usage scenarios.
- OnKilled
- A table of unit IDs that assisted with its destruction. As before, ideally each entry would also contain the percentage of health that it contributed to the kill. Alternatively, the unit that landed the killing blow should be enough for most cases.
I have approximately ten thousand ideas for other stats that I want to track, but these two are the most important to get some minimum working prototype in order and be able to start analyzing data in some nontrivial way. I know how to override these functions in Unit.lua, but I'm not sure whether the bits of information that I need are already there or not.
For exporting the data, eventually I would like to simply store each record in a table, and send that table to a network service at the end of the game. For now, I'm content to just use the Log command and parse the log file with another tool while I'm testing.
[edit]: Answered part of my own question myself; GetGameTime() looks like it will be sufficient for recording the time that the event occurred.
[edit2]: Evidently that's only a part of the UI layer, not the sim layer. My attempts at hacking in a timer by forking a thread, calling WaitSeconds and incrementing a value have so far been met with failure.