For my map, i have a hero-pick system. For this, i use a dialog. Problem is, i want 2 seperate dialogs for 2 diffeent teams, or make it one dialog, but when a player clicks a hero from the other team...they can re-pick
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dialog Initialize

Events


Time - Elapsed game time is 0.00 seconds

Conditions

Actions


-------- This is simple dialog system --------


-------- Uses 2 dialog variables and several buttons --------


-------- You have to set opposing players in different player group variable --------


Player Group - Add Player 1 (Red) to Group1


Player Group - Add Player 2 (Blue) to Group1


Player Group - Add Player 3 (Teal) to Group2


Player Group - Add Player 4 (Purple) to Group2


-------- We will now create first dialog --------


Dialog - Change the title of Dialog1 to Dialog for Group 1


Dialog - Create a dialog button for Dialog1 labelled Hero 1


-------- I am using array in variable for dialog buttons --------


-------- So I can set more buttons in single variable --------


-------- Creating arrays is easy, just place tick in array field when creating new variable --------


-------- Now, set how many objects can array have in the next field named size --------


-------- Now, back to our dialog --------


Set Button[1] = (Last created dialog Button)


Dialog - Create a dialog button for Dialog1 labelled Hero 2


Set Button[2] = (Last created dialog Button)


-------- Notice changing of array index --------


-------- When dialog is done do this --------


Player Group - Pick every player in Group1 and do (Actions)



Loop - Actions




Dialog - Show Dialog1 for (Picked player)


-------- Now, creating next dialog will be piece of cake --------


Dialog - Change the title of Dialog2 to Dialog for Group 2


Dialog - Create a dialog button for Dialog2 labelled Hero 3


Set Button[3] = (Last created dialog Button)


Dialog - Create a dialog button for Dialog2 labelled Hero 4


Set Button[4] = (Last created dialog Button)


Player Group - Pick every player in Group2 and do (Actions)



Loop - Actions




Dialog - Show Dialog2 for (Picked player)


-------- Go to the next trigger :) --------
Dialog Picking

Events


Dialog - A dialog button is clicked for Dialog1


Dialog - A dialog button is clicked for Dialog2

Conditions

Actions


-------- We will make all picking in a single trigger --------


-------- In IF conditions I am using Dialog button comparison --------


-------- Don't forget which button is used to spawn certain hero --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Clicked dialog button) Equal to Button[1]



Then - Actions




-------- Points also leak and create lag --------




-------- We can remove it using single variable, TempPoint --------




Set TempPoint = (Center of (PickArea1))




Unit - Create 1 Archmage for (Triggering player) at TempPoint facing Default building facing degrees




-------- Use custom script function and type there text below --------




Custom script: call RemoveLocation(udg_TempPoint)



Else - Actions


-------- It is time to take care of other buttons --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Clicked dialog button) Equal to Button[2]



Then - Actions




Set TempPoint = (Center of (PickArea1))




Unit - Create 1 Paladin for (Triggering player) at TempPoint facing Default building facing degrees




Custom script: call RemoveLocation(udg_TempPoint)



Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Clicked dialog button) Equal to Button[3]



Then - Actions




Set TempPoint = (Center of (PickArea2))




Unit - Create 1 Mountain King for (Triggering player) at TempPoint facing Default building facing degrees




Custom script: call RemoveLocation(udg_TempPoint)



Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Clicked dialog button) Equal to Button[4]



Then - Actions




Set TempPoint = (Center of (PickArea2))




Unit - Create 1 Blood Mage for (Triggering player) at TempPoint facing Default building facing degrees




Custom script: call RemoveLocation(udg_TempPoint)



Else - Actions
