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

What are variables!?

Status
Not open for further replies.
Level 4
Joined
May 9, 2004
Messages
90
I am always creating trigger maps. I also have now a campaign which consists of 12 maps. They're all without variables! I don't know them so could someone can tell about it?
 
Level 13
Joined
May 5, 2004
Messages
1,330
you can assign nearly everything to variables, e.g. a special unit/hero you wanna transport from map to map. For example, you assign your hero to a variable called "MyHero" (the variable type has to be "unit"). Now, other triggers can refer to the unit by refering to it's variable, e.g. a trigger like <<Unit - Kill "MyHero">>

Extensive maps/campaigns can't be done without variables, e.g. transporting a hero from map to map is impossible without variables. ATM I'm writing a tutorial concerning to hero-transport, look it up when it's finished.
 
Level 7
Joined
Mar 26, 2004
Messages
350
u need variables to refer to certain things. for example in a spell map: u have a unit casting a spell. if u would create triggers like this:
Code:
event: generic unit starts casting an ability 
action: wait 20 sec.
         set triggering units life to 200
this will not work correct, because after twenty sec. there isn't a "triggering unit". if u use a variable
Code:
event: generic unit starts casting an ability 
action: set"an unit variable"=triggering unit
         wait 20 sec.
         set "unit variable"'s life to 200
it will work

variables are e.g also important for rpg's, campaign's, td's and 99% of all maps u can find in the cusom game list in b.net

last, but not least i quote myself:
variables make making maps easier
 
Status
Not open for further replies.
Top