• 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.

Using Temp_Variables

Status
Not open for further replies.
There is one issue when you use one temp variable for everything. If you trigger a different trigger with the code, and that modifies that temp variable, then things might mess up.

e.g:
  • Set TempInteger = 5
  • Unit - Order (triggering unit) to Stop
  • Game - Display to (All Players) String(TempInteger) for 60.00 seconds
  • Random Trigger
    • Events
      • Unit - A unit is issued an immediate order
    • Conditions
    • Actions
      • Set TempInteger = 10
What do you think the first trigger will show? 5? Sadly no (AFAIK). It will show 10, because the unit is issued the "Stop" order, and then it runs the "Random Trigger", which changes the value of the global.
 
Status
Not open for further replies.
Top