i finally got my Heropicking dialog working. I ll write it down, so you can maybe help me later on with my problem.
Event
Elapsed time is 1 sec
Action
Dialog - Create dialog of size...
Variable - Set XY =(Last created dialog)
Dialog - create label for dialog...
Dialog - create button for dialog ... "hero 1"
Variable - Set Hero1 (last created dialog item)
and so on. for 7 heros + random function. 8 Buttons...
For each Player in my map i got now a trigger for each hero:
Event - Any Dialog Item is used by Player 3 with event type clicked
Condition - Used dialog item = Hero 1
Action:
Unit - Create 1 Hero1
Unit Group - Add (last created unit) to Player 1 Unitgroup
Dialog - Hide Dialog1
works all fine. my randomtrigger for the randomhero pick also works fine.
but NOW i want that after 20 sec time expires, each player which have not picked a hero to force the random pick. i tryed alot with "if then else" in the main trigger where are the buttons are made. but got some error messages in game later on... i tryed to force random for each player which has 0 supply after 20 sec... but had error msgs...
i think the problem is, that the trigger cant find out which player is active, cause it has to trigger without any player pressing dialogbuttons... any ideas how to get this forced random pick?
Make a boolean variable for each player and set it equal to false. Then add a line of code in your button selection trigger that will set that player's variable to true.
Then in your main trigger that generates the dialog windows, have it wait for 20 real time seconds, then kill the dialog windows, check every player's variable and if its equal to false, give them a random hero.
Hi there,
i finally got my Heropicking dialog working. I ll write it down, so you can maybe help me later on with my problem.
Event
Elapsed time is 1 sec
Action
Dialog - Create dialog of size... Variable - Set XY =(Last created dialog) Dialog - create label for dialog... Dialog - create button for dialog ... "hero 1" Variable - Set Hero1 (last created dialog item)
and so on. for 7 heros + random function. 8 Buttons...
For each Player in my map i got now a trigger for each hero:
Event - Any Dialog Item is used by Player 3 with event type clicked Condition - Used dialog item = Hero 1 Action: Unit - Create 1 Hero1 Unit Group - Add (last created unit) to Player 1 Unitgroup Dialog - Hide Dialog1
works all fine. my randomtrigger for the randomhero pick also works fine.
but NOW i want that after 20 sec time expires, each player which have not picked a hero to force the random pick. i tryed alot with "if then else" in the main trigger where are the buttons are made. but got some error messages in game later on... i tryed to force random for each player which has 0 supply after 20 sec... but had error msgs...
i think the problem is, that the trigger cant find out which player is active, cause it has to trigger without any player pressing dialogbuttons... any ideas how to get this forced random pick?
@Tarbald: Go
Make a boolean variable for each player and set it equal to false. Then add a line of code in your button selection trigger that will set that player's variable to true.
Then in your main trigger that generates the dialog windows, have it wait for 20 real time seconds, then kill the dialog windows, check every player's variable and if its equal to false, give them a random hero.
thanks, worked fine