• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] What is the difference between array variable and non-array variable

Status
Not open for further replies.
An array variable is an variable with an "internal number" inside itself. This makes its easier to access in some cases.
  • Events
    • Unit - A unit Is attacked
  • Conditions
  • Actions
    • Set Unit[1] = (Attacking unit)
    • Set Unit[2] = (Attacked unit)
    • Set Unit[3] = (Random unit in (Playable map area))
    • Unit - Kill Unit[(Random integer number between 1 and 3)]
instead of

  • Events
    • Unit - A unit Is attacked
  • Conditions
  • Actions
    • Set Integer = (Random integer number between 1 and 3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Integer Equal to 1
      • Then - Actions
        • Unit - Kill (Attacking unit)
      • Else - Actions
        • If (All Conditions are True then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Integer Equal to 2
          • Then - Actions
            • Unit - Kill (Attacked unit)
          • Else - Actions
            • Unit - Kill (Random unit in (Playable map area))
yes, i know the triggers leak, but its just to show :P
 
Status
Not open for further replies.
Back
Top