I have encountered a problem, either that or I am thinking too complex.
I have made a trigger that adds a lightning to a unit as soon as it is contructed, then I name it ,using arrays, to (x+1) where x is the previous number + a new unit. Now for the problem. Unit 1, 2 and 3 is alive, Unit 2 dies.
The next time a new Unit is constructed it will be named to Unit 2.
Another trigger, Unit X dies, is supposed to get the dying unit's "name" (Unit 1, Unit 2 Unit x...) and then remove the lightning accordingly. And as far as I know, there is no function for getting a unit's name.
Please post any solutions or other ideas that does not include copy + paste, these units array goes up to 75. I need a general formula, or a function that gives me the dying unit's variable name.
Thanks in beforehand for any help
// ShadowMan
I have made a trigger that adds a lightning to a unit as soon as it is contructed, then I name it ,using arrays, to (x+1) where x is the previous number + a new unit. Now for the problem. Unit 1, 2 and 3 is alive, Unit 2 dies.
The next time a new Unit is constructed it will be named to Unit 2.
Another trigger, Unit X dies, is supposed to get the dying unit's "name" (Unit 1, Unit 2 Unit x...) and then remove the lightning accordingly. And as far as I know, there is no function for getting a unit's name.
Please post any solutions or other ideas that does not include copy + paste, these units array goes up to 75. I need a general formula, or a function that gives me the dying unit's variable name.
Thanks in beforehand for any help
// ShadowMan