• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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