HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

help with trigger

07-15-2008, 10:20 AM#1
311
Thought this would be easy but seems like no matter what I put it dont work
Heres what I want

When I buy a hero from a tavern to choose a hero for my map, as long as every player also has a hero already to start a timer to start the game, thats it.......

I dont want the map to start unless every1 has a hero, well I will add like a start anyway in 30secs or so, but I want my timer for the game to start if every1 chooses early
07-15-2008, 10:45 AM#2
Alexander244
Make a boolean array. When a player selects a hero, set their slot on the array to true. If a player isn't playing, or leaves during selection, you would probably also want to set their slot on the array to true.
When you set a value, check the rest of the array. If the whole array from 1 -> no. players is true, start your timer.
07-15-2008, 12:32 PM#3
311
still cant seem to get it

event: unit finishes training
action: set players (player # of triggering player)= to true


event: players food becomes = to 5
condition: ??? what do I do here?
07-15-2008, 12:43 PM#4
Alexander244
Something like this is what I was thinking:
Trigger:
Collapse Events
Unit - A unit Finishes training a unit
Collapse Conditions
((Trained unit) is A Hero) Equal to True
Collapse Actions
Set HeroSelected[(Player number of (Owner of (Triggering unit)))] = True
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
HeroSelected[(Integer A)] Equal to False
Collapse Then - Actions
Skip remaining actions
Else - Actions
Countdown Timer - Start (YOUR TIMER) as a One-shot timer that will expire in XX.XX seconds
Trigger:
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Collapse Then - Actions
Set HeroSelected[(Integer A)] = True
Else - Actions
Trigger:
Collapse Events
Player - Player 1 (Red) leaves the game
//...
Player - Player 12 (Brown) leaves the game
Conditions
Collapse Actions
Set HeroSelected[(Player number of (Triggering player))] = True
07-16-2008, 08:43 AM#5
311
Doesnt work either :(, and the only differnce my trigger has is in the first trigger I added create timer window for last created timer since I'm pretty sure I need that.


Btw Is there a way to make a timer count up instead of down?
07-16-2008, 08:59 AM#6
Alexander244
Opps, it's from a tavern, so:
Trigger:
Collapse Events
Unit - A unit Sells a unit
Collapse Conditions
((Sold unit) is A Hero) Equal to True
Quote:
Originally Posted by 311
Btw Is there a way to make a timer count up instead of down?
It can be mimicked, on a multiboard for instance. By having a 1 second repeating timer increment a variable.
07-16-2008, 09:24 AM#7
311
nope, im guessing because of players not playing? not sure
07-16-2008, 09:29 AM#8
Alexander244
It may be that the array is not initialized to false for first 12, or that there is a computer player in slot 1->12?
Otherwise try putting text messages everywhere that show the current values of the variables when each action is finished.

Edit: Oh, and with the sold unit, you must also change the (Owner of (Triggering Unit)) to (Owner of (Sold Unit))