Page 1 of 1
[Bug] During the first state, notification are ignored
Posted: 27 May 2013, 13:22
by pikiou
In states.inc.php I have this as the next state after gameSetup:
Code: Select all
2 => array(
"name" => "test",
"description" => '',
"descriptionmyturn" => '',
"type" => "activeplayer",
"action" => "stTest",
"possibleactions" => array("playCard"),
"transitions" => array("playCard" => 2)
),
And in gamename.game.php:
Code: Select all
function stTest() {
self::notifyAllPlayers("testing", '', array());
}
Well, when I start the game, self::notifyAllPlayers is called but no notification is received.
And if I play a card, which runs state 2 again, a notification is received, as expected.
Ow, and placing this.setupNotifications() in the dojo object constructor doesn't change anything.
Re: [Bug] During the first state, notification are ignored
Posted: 27 May 2013, 14:56
by sourisdudesert
Hello,
In fact, your notification is sent when the game is created. At this step, players are not on the game page so no one is there to receive the notification.
Cheers,
Re: [Bug] During the first state, notification are ignored
Posted: 23 May 2020, 18:06
by Ralchimist
Hello,
sorry to move up this old topic, but I would like to know the good way to notify players at the very beginning of the game. (before the first player turn)
In my game, I have to roll dices and notify players with the animation and the result.
Should I create a new player action to make the first player click so I can send the notification?
Or is there another way?
If it exist, i'll prefer to avoid a player action, like a condition "if all players are on table"=> send notification.
NB: my code works fine on the next turns. Only the first doesn't work.
Thanks for your help.
Re: [Bug] During the first state, notification are ignored
Posted: 23 May 2020, 20:51
by vincentt
Hi,
I had the same issue on Dice Forge, and the easiest way to do it was to have the dice already rolled and the information displayed in the log.
You can take a look at the project/game if you wish.
Cheers
Vincent
Re: [Bug] During the first state, notification are ignored
Posted: 25 May 2020, 07:55
by Ralchimist
Hi Vincent,
thanks for your answer.
Currently that's what I've done on my project.
So do you confirm there is no solution to start animation just after players join? (I have to insist because this could really increase my game experience)
Re: [Bug] During the first state, notification are ignored
Posted: 25 May 2020, 15:12
by XCID
Hi,
I am also in the process of developing my first game here, and I will also have to find a solution for this problem. Although the proposed solution is working and players can see in the log what happened during the setup process, I also wish they could see the actual animations.
In the game Solo, which was developed by Dr. Karotte, who is quite active in the forums, he implemented a "Ready" Button for all players to click, once their game is loaded. That will start the setup process. Don't know if it was for this exact reason, but that is another way to deal with the problem.
Re: [Bug] During the first state, notification are ignored
Posted: 25 May 2020, 16:29
by vincentt
Hi
In term of user experience, I am not sure that a ready button is important when you are not linked to time decision. But you can still do it like this if necessary.
In DF, when we added the Draft Mode, at the end I do think that the animation of setup are rolled but I would have to check.
Vincent
Re: [Bug] During the first state, notification are ignored
Posted: 25 May 2020, 16:45
by Ralchimist
in the game Solo, which was developed by Dr. Karotte, who is quite active in the forums, he implemented a "Ready" Button for all players to click, once their game is loaded. That will start the setup process. Don't know if it was for this exact reason, but that is another way to deal with the problem.
In term of user experience, I am not sure that a ready button is important when you are not linked to time decision. But you can still do it like this if necessary.
I will try this solution:
create a "ghost" multiplayer state, which is automatically end in javascript for each player (auto-click on a button).
So my animation should start.
I'll let you now asap!
Thanks for your contribution!
Re: [Bug] During the first state, notification are ignored
Posted: 25 May 2020, 18:06
by RicardoRix
You can have animations in your JS setup function if you like.