HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Counting the number of times unit enters region

06-04-2006, 08:36 PM#1
Jarock
I am making a Mini-Game type map, and I'm making a game where a unit enters a region, and on the 3rd time entering the region. I want him to explode. How would I go about doing this?
06-04-2006, 09:18 PM#2
johnfn
Trigger:
Collapse Events
A unit enters (Some Reigon)
Conditions
Collapse Actions
Set numTimes = numTimes + 1
Collapse If - Conditions
numTimes Equal To 3
Collapse Then - Actions
Explode (Entering Unit)
Else - Actions
06-05-2006, 07:11 AM#3
Jarock
What is that variable type? I never seen a Numtimes variable.
06-05-2006, 10:50 AM#4
Blade.dk
integer. Numtimes is the variable name.
06-05-2006, 10:53 AM#5
iNfraNe
to make it work for multiple units you should use an array and
Trigger:
set numTimes[Owner of(Entering Unit)] = numTimes[Owner of(Entering Unit)] + 1
06-05-2006, 01:52 PM#6
Anitarf
You could also dynamicaly create a trigger for each unit and then count how many times the trigger executed. No variables needed.

That is, you could do that if you used Jass.
06-05-2006, 03:44 PM#7
blu_da_noob
Or you could store the value on the unit itself with custom value or so-called 'handle variables'.