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

How do i use variables in different triggers?

Status
Not open for further replies.
Level 3
Joined
May 7, 2005
Messages
36
How do i go about using the same variables i set in one trigger, in another? I'm having some major issues with this, if i try to set a global variable i cant use the "last created blank" when im creating things. I'm used to WE where you set the variable one and it sticks, as long as the other triggers are performed after you set it.
 
Level 10
Joined
Nov 28, 2008
Messages
655
Lolwat?

Global variables??

They are useful???


*GASP*


As was said, just go to the left side where the functions and folders are, and instead of clicking make new function, or trigger, or folder, etc... click make new variable. Now everything can use it!
 
Level 3
Joined
May 7, 2005
Messages
36
Well what im trying to figure out is like using a dialog variable in other triggers, I cant make a global cause i need to use "last created dialog". Which can not be recognized outside of the trigger, how do i go about using it in another trigger like, "dialog clicked - action etc". If i set a variable in one trigger i cant use it in another.
 
Level 10
Joined
Nov 28, 2008
Messages
655
Well what im trying to figure out is like using a dialog variable in other triggers, I cant make a global cause i need to use "last created dialog". Which can not be recognized outside of the trigger, how do i go about using it in another trigger like, "dialog clicked - action etc". If i set a variable in one trigger i cant use it in another.

Make a global button.(or whatever)
Say it is called "Button 1"

In the trigger, make it, and the next line set "last created" to the global.

Ding.
 
Level 5
Joined
Jul 4, 2007
Messages
166
Well what im trying to figure out is like using a dialog variable in other triggers, I cant make a global cause i need to use "last created dialog". Which can not be recognized outside of the trigger, how do i go about using it in another trigger like, "dialog clicked - action etc". If i set a variable in one trigger i cant use it in another.

Step 1. Create global variable.
Step 2. Change variable to 'dialog' type.
Step 3. Make a Set Variable action.
Step 4. Set your variable to Last Created Dialog.
Step 5. ???
Step 6. Profit!

Visual tour:
http://img532.imageshack.us/gal.php?g=step1d.png

(Start at the right, and go left)
 
Status
Not open for further replies.
Top