I was wandering, that if we could use unit handle to replace a indexing system. I know it sounds complicated but please do take a look on the triggers example below.
For the trigger 2 the tempInteger is set above these line and it represents the unit.
So can the first trigger works? Which is better if we ignores it's efficientcy.
-
Trigger 1
-
Events
- Unit - A unit Is attacked
- Conditions
-
Actions
- Set damage[(Key (Attacking unit))] = (damage[(Key (Attacking unit))] + (Damage taken))
- Set Game_TotalDamage = (integer + (Damage taken))
-
Events
-
Trigger 2
-
Events
- Unit - A unit Is attacked
- Conditions
-
Actions
- .........
- Set damage[tempInteger] = (damage[tempInteger] + (Damage taken))
- Set Game_TotalDamage = (integer + (Damage taken))
-
Events
So can the first trigger works? Which is better if we ignores it's efficientcy.