HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialogs and multiple players

12-12-2006, 11:16 AM#1
galmore
So I am guessing that a single Global Dialog variable would not be wise when
wanting to show said Dialog to multiple players at once with different
Buttons. So with that in mind, I’m wondering about the Buttons.

Heres the thought. Do i need an array of buttons or would this code work on
a map will 12 players where all players can be accessing this dialog at any
time?

Trigger:
Abilitys Dialog
Collapse Events
Dialog - A dialog button is clicked for Leveling_Base_Menu[1]
Dialog - A dialog button is clicked for Leveling_Base_Menu[2]
Dialog - A dialog button is clicked for Leveling_Base_Menu[3]
Dialog - A dialog button is clicked for Leveling_Base_Menu[4]
Dialog - A dialog button is clicked for Leveling_Base_Menu[5]
Dialog - A dialog button is clicked for Leveling_Base_Menu[6]
Dialog - A dialog button is clicked for Leveling_Base_Menu[7]
Dialog - A dialog button is clicked for Leveling_Base_Menu[8]
Dialog - A dialog button is clicked for Leveling_Base_Menu[9]
Dialog - A dialog button is clicked for Leveling_Base_Menu[10]
Dialog - A dialog button is clicked for Leveling_Base_Menu[11]
Dialog - A dialog button is clicked for Leveling_Base_Menu[12]
Collapse Conditions
(Clicked dialog button) Equal to Level_Abilitys
Collapse Actions
Dialog - Clear Leveling_Abilitys_Menu[Current_player]
Collapse Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
((Picked unit) is A Hero) Equal to True
Collapse Then - Actions
Dialog - Change the title of Leveling_Abilitys_Menu[(Player number of (Triggering player))] to Select an Ability
Collapse For each (Integer A) from 1 to 4, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Hero_ability[((Player number of (Triggering player)) + (Integer A))] Not equal to NULL_Ability
Collapse Then - Actions
Dialog - Create a dialog button for Leveling_Abilitys_Menu[(Player number of (Triggering player))] labelled (Name of Hero_ability[((Player number of (Triggering player)) + (Integer A))])
Set Level_Ability_slot[(Integer A)] = (Last created dialog Button)
Else - Actions
Dialog - Create a dialog button for Leveling_Abilitys_Menu[(Player number of (Triggering player))] labelled Go Back
Else - Actions
Dialog - Show Leveling_Abilitys_Menu[(Player number of (Triggering player))] for (Triggering player)

first off the Condition here with the Level_Abilitys button ... that button can
be created and set to (last created button) up to 12 times so im not sure if
the Level_Abilitys button created for player 12 would hold the same condition
as for player 3

also

Trigger:
Dialog - Create a dialog button for Leveling_Abilitys_Menu[(Player number of (Triggering player))] labelled (Name of Hero_ability[((Player number of (Triggering player)) + (Integer A))])
Set Level_Ability_slot[(Integer A)] = (Last created dialog Button)

this line since the Button Level_Ability_slot is global that only holds 4 buttons
and if i have a max of 12 players i would assume this trigger would overwrite
the needed data a player would need for his button and thus any trigger
looking for when this button was press might not fire right

i dont know the more i think about it the more i confuse myself.

So i would like to know if im correct or not because if i need to multiplay
each button i make by 12 that will make the creation of a dialog based
system very anoying
12-14-2006, 01:43 AM#2
cfmonkey45
what exactly are you trying to do?
12-14-2006, 02:18 AM#3
Joker
Please use
Code:
[trigger][/trigger]
for gui, not jass
12-14-2006, 02:24 AM#4
galmore
Quote:
Originally Posted by cfmonkey45
what exactly are you trying to do?

Nevermind Ill just keep designing Dialogs with the idea that each Dialog needs a new instance for each player