Hey guys, another question since I'm still very much learning. How would I go about displaying a specific dialog depending on the player? Ie Player 1 has 1 dialog window, player 2 has another, etc.
Right, you can use show hide to show or hide dialogs or even dialog items to players, but if you want all players to see the same dialog but different dialog items the dialog size is the same for all players, in this case you would have to exchange the normal borders with images and make the original dialog transparent or create a button as abackground
But in general you can make 1 dialog just visible for 1 player each just like eiviyn has said
there are different ways to do this.
you can define a trigger per player in which you create the dialog and set the show dialog for that player.
or you can setup a list of dialogs and then iterate through all the players and display the dialog
the latter looks something like this:
-------------------------
Dialog for all Players
Events
Game - Map initialization
Local Variables
DialogList = No Dialog <Dialog[4]>
Conditions
Actions
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set DialogList[1] = (Last created dialog)
-- create other dialog information for player 1 dialog (buttons, background, etc) --
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set DialogList[2] = (Last created dialog)
-- create other dialog information for player 2 dialog (buttons, background, etc) --
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set DialogList[3] = (Last created dialog)
-- create other dialog information for player 3 dialog (buttons, background, etc) --
Player Group - Pick each player in (All players) and do (Actions)
Actions
Dialog - Show DialogList[(Picked player)] for (Player group((Picked player)))
------------------
I haven't tested the above if it actually works, but it should work in theory.
So then with the Picked player I would just put the player number in? (would Player one be a value of 0 or a 1 in this case?) Or am I at it all wrong.
But yea, I'd like to have a completely different set of dialog options for each player. For instance you have a math game (yea I know):
Player 1's buttons:
1+1 = 2
1+1 = 3
1+1 = 4
Player 2's buttons:
2x2 = 2
2x2 = 4
2x2 = 6
Player 3's buttons:
1+4 = 6
1+4 = 5
1+4 = 4
Etc. It then goes turn based for each of the players. When each of them answer their question, the dialog for the next player appears.
in the case that I mentioned it displays the dialog boxes for all players at the same time.
if you want for example to display it first for player 1, then for player 2, etc. you want to use different triggers.
you want to catch the button clicking of the previous player to trigger the dialog for the next player.
so if I would set up an example of this using your math example:
I would make a few global variables to keep track of:
- the current player (CurrentPlayer)
- the current dialog being displayed (ActiveDialog)
- the correct answer for the dialog (CorrectAnswer)
next I would setup several triggers to fire after one another:
========= the first trigger =============
Dialog for starter player
Events
Game - Map initialization
Local Variables
Conditions
Actions
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set ActiveDialog = (Last created dialog)
Dialog - Create a Label for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top with an offset of (50, 50) with the text "1+1=..." color set to White text writeout set to false with a writeout duration of 2.0
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "2" and the hover image set to ""
Variable - Set CorrectAnswer = (Last created dialog item)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "3" and the hover image set to ""
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "4" and the hover image set to ""
Dialog - Show (Last created dialog) for (Player group(Current Player))
=========== end of first trigger ===========
======== the other triggers all look like this =======
Dialog for next player
Events
Dialog - Any Dialog Item is Clicked by Player Any Player
Local Variables
Conditions
Actions
Dialog - Hide ActiveDialog for (Player group(Current Player))
General - If (Conditions) then do (Actions) else do (Actions)
If
(Used dialog item) == CorrectAnswer
Then
------- answer was correct
Else
------- answer was wrong
Variable - Set Current Player = (Current Player + 1)
------- check if player is in use, if not continue increasing until you've reached the last number then start at 1 again.
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set ActiveDialog = (Last created dialog)
Dialog - Create a Label for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top with an offset of (50, 50) with the text "2x2=..." color set to White text writeout set to false with a writeout duration of 2.0
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "2" and the hover image set to ""
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "4" and the hover image set to ""
Variable - Set CorrectAnswer = (Last created dialog item)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "6" and the hover image set to ""
Dialog - Show (Last created dialog) for (Player group(Current Player))
================ end of this trigger ============
ofcourse this second trigger isn't usable at all since you'll end up using only this trigger.
you need to adjust it however you wish. you can setup a list of dialogs at initialization and just toggle them for the players in this bit.
keep the current position in a variable or something.
Hope this helps ya further ;)
Players are numbered: 0 through 15. positions 0 and 15 are Neutral and Hostile respectively so they aren't normally controlled by a user.
so basicly Player 1 = number 1.
Hey guys, another question since I'm still very much learning. How would I go about displaying a specific dialog depending on the player? Ie Player 1 has 1 dialog window, player 2 has another, etc.
Thanks in advance, Helix
Now I've not tested this myself, but when you show/hide dialog, there is an option to only show it to specific players/player groups.
Right, you can use show hide to show or hide dialogs or even dialog items to players, but if you want all players to see the same dialog but different dialog items the dialog size is the same for all players, in this case you would have to exchange the normal borders with images and make the original dialog transparent or create a button as abackground
But in general you can make 1 dialog just visible for 1 player each just like eiviyn has said
there are different ways to do this.
you can define a trigger per player in which you create the dialog and set the show dialog for that player.
or you can setup a list of dialogs and then iterate through all the players and display the dialog
the latter looks something like this:
-------------------------
Dialog for all Players
Events
Game - Map initialization
Local Variables
DialogList = No Dialog <Dialog[4]>
Conditions
Actions
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set DialogList[1] = (Last created dialog)
-- create other dialog information for player 1 dialog (buttons, background, etc) --
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set DialogList[2] = (Last created dialog)
-- create other dialog information for player 2 dialog (buttons, background, etc) --
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set DialogList[3] = (Last created dialog)
-- create other dialog information for player 3 dialog (buttons, background, etc) --
Player Group - Pick each player in (All players) and do (Actions)
Actions
Dialog - Show DialogList[(Picked player)] for (Player group((Picked player)))
------------------
I haven't tested the above if it actually works, but it should work in theory.
@Helral: Go
So then with the Picked player I would just put the player number in? (would Player one be a value of 0 or a 1 in this case?) Or am I at it all wrong.
But yea, I'd like to have a completely different set of dialog options for each player. For instance you have a math game (yea I know): Player 1's buttons: 1+1 = 2 1+1 = 3 1+1 = 4
Player 2's buttons: 2x2 = 2 2x2 = 4 2x2 = 6
Player 3's buttons: 1+4 = 6 1+4 = 5 1+4 = 4
Etc. It then goes turn based for each of the players. When each of them answer their question, the dialog for the next player appears.
@helixdnb:
in the case that I mentioned it displays the dialog boxes for all players at the same time.
if you want for example to display it first for player 1, then for player 2, etc. you want to use different triggers.
you want to catch the button clicking of the previous player to trigger the dialog for the next player.
so if I would set up an example of this using your math example:
I would make a few global variables to keep track of:
- the current player (CurrentPlayer)
- the current dialog being displayed (ActiveDialog)
- the correct answer for the dialog (CorrectAnswer)
next I would setup several triggers to fire after one another:
========= the first trigger =============
Dialog for starter player
Events
Game - Map initialization
Local Variables
Conditions
Actions
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set ActiveDialog = (Last created dialog)
Dialog - Create a Label for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top with an offset of (50, 50) with the text "1+1=..." color set to White text writeout set to false with a writeout duration of 2.0
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "2" and the hover image set to ""
Variable - Set CorrectAnswer = (Last created dialog item)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "3" and the hover image set to ""
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "4" and the hover image set to ""
Dialog - Show (Last created dialog) for (Player group(Current Player))
=========== end of first trigger ===========
======== the other triggers all look like this =======
Dialog for next player
Events
Dialog - Any Dialog Item is Clicked by Player Any Player
Local Variables
Conditions
Actions
Dialog - Hide ActiveDialog for (Player group(Current Player))
General - If (Conditions) then do (Actions) else do (Actions)
If
(Used dialog item) == CorrectAnswer
Then
------- answer was correct
Else
------- answer was wrong
Variable - Set Current Player = (Current Player + 1)
------- check if player is in use, if not continue increasing until you've reached the last number then start at 1 again.
Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
Variable - Set ActiveDialog = (Last created dialog)
Dialog - Create a Label for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top with an offset of (50, 50) with the text "2x2=..." color set to White text writeout set to false with a writeout duration of 2.0
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "2" and the hover image set to ""
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "4" and the hover image set to ""
Variable - Set CorrectAnswer = (Last created dialog item)
Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "6" and the hover image set to ""
Dialog - Show (Last created dialog) for (Player group(Current Player))
================ end of this trigger ============
ofcourse this second trigger isn't usable at all since you'll end up using only this trigger.
you need to adjust it however you wish. you can setup a list of dialogs at initialization and just toggle them for the players in this bit.
keep the current position in a variable or something.
Hope this helps ya further ;)
Players are numbered: 0 through 15. positions 0 and 15 are Neutral and Hostile respectively so they aren't normally controlled by a user.
so basicly Player 1 = number 1.
Nevermind, figured it out.