- Joined
- May 6, 2007
- Messages
- 87
Heyas, folks.
I've got a curious error in my trigger. I set up an array of dialog windows (size 7, since there are 7 players), as well as three buttons for each dialog (each button also uses an array of size 7).
You may find my actual problem at the bottom of this post.
When I test this map alone, totalplayers is set to one, so it should only run once.
When a button is pressed, a trigger checks to see which button is pressed, and announces the choice to the player, as well as updating his multiboard value.
rowNumber has an initial value of 2.
If a button (any button; options are normal/nightmare/hell) is not pressed quickly enough, another trigger defaults the difficulty level to one.
PROBLEM:
This is my actual problem. As player one while testing alone, the game creates a dialog box for me with the correct buttons. However, when I press a button (any of the three), nothing happens. Eventually the game decides that I did not press a button, and defaults my difficulty level to one (normal).
When I test this with a second computer over a LAN network, the same thing happens. Both players get the dialog box. However, neither player's clicked button is recognized. They both get their difficulty level defaulted.
Does anybody know how to get an array of dialog boxes to work? Or must I create seven different dialog boxes (using seven different variables)?
Thanks for your time.
I've got a curious error in my trigger. I set up an array of dialog windows (size 7, since there are 7 players), as well as three buttons for each dialog (each button also uses an array of size 7).
You may find my actual problem at the bottom of this post.
-
Do Multiple ActionsFor each (Integer A) from 1 to totalPlayers, do (Actions)
-
Loop - Actions
- -------- Creates a dialog for each active player, as well as three buttons for each dialog. --------
- Dialog - Create a dialog button for difficultyDialog[((Integer A) - 1)] labelled Normal
- Set buttonNormal[((Integer A) - 1)] = (Last created dialog Button)
- Dialog - Create a dialog button for difficultyDialog[((Integer A) - 1)] labelled Nightmare
- Set buttonNightmare[((Integer A) - 1)] = (Last created dialog Button)
- Dialog - Create a dialog button for difficultyDialog[((Integer A) - 1)] labelled Hell
- Set buttonHell[((Integer A) - 1)] = (Last created dialog Button)
- Dialog - Change the title of difficultyDialog[((Integer A) - 1)] to |cffffd700Your pers...
- Dialog - Show difficultyDialog[((Integer A) - 1)] for (Player((Integer A)))
- Wait 10.00 seconds
- Trigger - Run Difficulty Safety <gen> (ignoring conditions)
-
Loop - Actions
When a button is pressed, a trigger checks to see which button is pressed, and announces the choice to the player, as well as updating his multiboard value.
-
Difficulty Dialog Red
-
Events
- Dialog - A dialog button is clicked for difficultyDialog[0]
- Conditions
-
Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to (==) buttonNormal[0]
-
Then - Actions
- -------- If the button 'normal' is pressed by player one (red), then his difficulty level is set to one. This is announced and updated on his multiboard row. --------
- Set playerDifficulty[0] = 1
- Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: (|cffaeea8aYou set have your difficulty to |r + (|cffdab8c7 + (Normal + |r|cffaeea8a.|r)))
- Multiboard - Set the text for (Last created multiboard) item in column 3, row boardRow[0] to |cffdeb887Normal|r
-
Else - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to (==) buttonNightmare[0]
-
Then - Actions
- -------- If the button that was pressed was not 'normal,' the trigger runs a check to see which button was actually pressed. --------
- Set playerDifficulty[0] = 2
- Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: (|cffaeea8aYou have set your difficulty to |r + (|cffdab8c7 + (Nightmare + |r|cffaeea8a.|r)))
- Multiboard - Set the text for (Last created multiboard) item in column 3, row boardRow[0] to |cffdf6c35Nightmare...
-
Else - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to (==) buttonHell[0]
-
Then - Actions
- Set playerDifficulty[0] = 3
- Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: (|cffaeea8aYou have set your difficulty to |r + (|cffdab8c7 + (Hell + |r|cffaeea8a.|r)))
- Multiboard - Set the text for (Last created multiboard) item in column 3, row boardRow[0] to |cff8b0000Hell|r
-
Else - Actions
- -------- This should never happen. --------
- Set playerDifficulty[0] = 1
- Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: (|cffaeea8aYou have set your difficulty to |r + (|cffdab8c7 + (Normal + |r|cffaeea8a.|r)))
- Multiboard - Set the text for (Last created multiboard) item in column 3, row boardRow[0] to |cffdeb887Normal|r
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
- [/HIDDEN]
-
Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to (==) Is playing) and (((Matching player) controller) Equal to (==) User))) and do (Actions)
-
Loop - Actions
- -------- This sets up the initial values for all columns for each player. --------
- Set boardRow[((Player number of (Picked player)) - 1)] = rowNumber
- Multiboard - Set the text for (Last created multiboard) item in column 1, row rowNumber to (playerColor[((Player number of (Picked player)) - 1)] + ((Name of (Picked player)) + |r))
- Multiboard - Set the text for (Last created multiboard) item in column 2, row rowNumber to 0
- Multiboard - Set the text for (Last created multiboard) item in column 3, row rowNumber to Not Set
- Set rowNumber = (rowNumber + 1)
-
Loop - Actions
If a button (any button; options are normal/nightmare/hell) is not pressed quickly enough, another trigger defaults the difficulty level to one.
-
Difficulty Safety
- Events
- Conditions
-
Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
- playerDifficulty[0] Greater than (>) 0
- playerDifficulty[1] Greater than (>) 0
- playerDifficulty[2] Greater than (>) 0
- playerDifficulty[3] Greater than (>) 0
- playerDifficulty[4] Greater than (>) 0
- playerDifficulty[5] Greater than (>) 0
- playerDifficulty[6] Greater than (>) 0
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Then - Actions
- -------- If every player has chosen a difficulty level (obviously requires every player to be active), then the rest of the if statement is ignored. --------
- Do nothing
-
Else - Actions
-
Do Multiple ActionsFor each (Integer A) from 0 to 6, do (Actions)
-
Loop - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- playerDifficulty[(Integer A)] Greater than (>) 0
-
Then - Actions
- -------- Loops through every player. If it finds a player that has chosen a difficulty level, it skips him. --------
- Do nothing
-
Else - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Player(((Integer A) + 1))) slot status) Equal to (==) Is playing
-
Then - Actions
- -------- Loops through every player. If it finds a player that has not chosen a difficulty level, then it defaults his level to one. --------
- Set playerDifficulty[(Integer A)] = 1
- Multiboard - Set the text for (Last created multiboard) item in column 3, row boardRow[(Integer A)] to |cffdeb887Normal|r
- Game - Display to (Player group((Player(((Integer A) + 1))))) for 5.00 seconds the text: (|cffaeea8aSince you have not selected a difficulty level, your difficulty has defaulted to |r + (|cffdab8c7 + (Normal + |r|cffaeea8a.|r)))
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Do Multiple ActionsFor each (Integer A) from 0 to 6, do (Actions)
-
If - Conditions
- Trigger - Run First Run <gen> (ignoring conditions)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
This is my actual problem. As player one while testing alone, the game creates a dialog box for me with the correct buttons. However, when I press a button (any of the three), nothing happens. Eventually the game decides that I did not press a button, and defaults my difficulty level to one (normal).
When I test this with a second computer over a LAN network, the same thing happens. Both players get the dialog box. However, neither player's clicked button is recognized. They both get their difficulty level defaulted.
Does anybody know how to get an array of dialog boxes to work? Or must I create seven different dialog boxes (using seven different variables)?
Thanks for your time.
Last edited: