I've been having trouble giving every unit created a unique ID. After creating the unit, it gets saved in to a data table via a variable that gets converted to a string and then the variable is incremented. However, once I want to compare a unit to a unit in the data table, it doesn't seem to work. The unit is being compared by (Triggering Unit) == ("debug string" from the Global data table) where the last created unit is saved as "debug string" in the data table.
Search for something called Unit Indexer Library or Unit Index Library.
Last time I used it, it counted missiles as units to be indexed, so unless its been fixed you'll need to mod the library to exclude things like that.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've been having trouble giving every unit created a unique ID. After creating the unit, it gets saved in to a data table via a variable that gets converted to a string and then the variable is incremented. However, once I want to compare a unit to a unit in the data table, it doesn't seem to work. The unit is being compared by (Triggering Unit) == ("debug string" from the Global data table) where the last created unit is saved as "debug string" in the data table.
Try using custom values. You can run a loop to check each number and, if vacant, set it for the unit you want.
Search for something called Unit Indexer Library or Unit Index Library. Last time I used it, it counted missiles as units to be indexed, so unless its been fixed you'll need to mod the library to exclude things like that.