• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Unit Indexing

Status
Not open for further replies.
Level 10
Joined
Mar 19, 2010
Messages
622
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.

  • 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))
  • Trigger 2
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • .........
      • Set damage[tempInteger] = (damage[tempInteger] + (Damage taken))
      • Set Game_TotalDamage = (integer + (Damage taken))
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.
 
Status
Not open for further replies.
Top