HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variables

10-18-2004, 10:58 AM#1
Vagabond
YES, I've read the tutorial, and I still don't get it.
How do they work? I was thinking to put terraining aside for some time and try out triggering.
Could anyone exlpain variables to me?
10-18-2004, 12:41 PM#2
HEZZA
Strange...usualy terrainers know little bit about triggers...anyway ill try put it as simple as i can.

Variables are things that allow you to store data, for use later on or during a game. The best example is the interger. Easiest and simple in my view.

Lets say, we want to count how many units that are trained and if too many or trained something happens.

first set up our interger....goto the variable editor in the editor (ctrl + B) , click new variable and select Interger (its best you do this in the standard editor, because other editors such as WEU have extra variables).

Now Fill in any title you like, usualy people just put in names to help them recognise what its for when you have loads of variables.
We dont need an arrary so just click ok.

Now you have your interger set up simply make a trigger that detects making units:
Event - unit is trained

condition - trained unit equals to footmen
Action: (goto set varaible)

now click set...you should have one variable what ever you called it. then click ok.
Now click on value...then value again....and select the variable tab and u should see ur variable in the drop down box. Click ok and ok again.
You should come out with Set Unit = (unit + 1)


Now thats fine.

Next make another trigger.

Set it like this:

Event - Period event (every 2 secs of the game)

Condtion - (head to the interger option and the default should read something like:(Number of units in (Units in (Playable map area))) Equal to 0 . Click on the number of units which is highlighted. In the next box select the variable tab with ur variable and click ok.

Now it should read unit equal to 0....change equal to : greater than or equal to...and change 0 to 10.

Then in ur actions do a simple

Game - text then in the text box put what u like ....and when somone or something trains 10 units it should pop up.
10-18-2004, 12:48 PM#3
Vagabond
Thx! This surely cleared some things up for me!

...Nice sig btw