-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification on documentation for SYNC_STAGE #166
Comments
Hi, This is a feature not used often, since levels have been introduced, so the API needs some refactor and the doc is a bit outdated. To begin with pull the latest nodegame-client, or install latest dev, otherwise an error will be raised. Say you have a stage with three steps, you can do the following: In player.js: stager.extendStep('step1', {
stepRule: stepRules.SOLO,
});
stager.extendStep('step2', {
stepRule: stepRules.SOLO,
});
stager.extendStep('step3', {
stepRule: stepRules.WAIT,
}); In logic.js stager.extendStep('step1', {
stepRule: stepRules.OTHERS_SYNC_STAGE,
cb: function() {
// Prevents to go to next step, instead goes to next stage.
node.game.breakStage(true);
}
}); It is a bit cumbersome, but it will work. |
I have updated the doc, it should be clearer now. There is a warning that the API is in refactor and it may change in the next release. |
Can I close? |
Great! Thank you! It works. |
Hi, I'm having trouble implementing
SYNC_STAGE
following the Synchronization documentation. I have a stage with multiple steps for which I wantSYNC_STAGE
, then for the rest of the game I would likeSYNC_STEP
. So far, I have set the default step rule to beSYNC_STEP
in the logic and did not change the default step rule fromWAIT
in the player. Then, I extended the specific stage to havestepRule: stepRules.SYNC_STAGE
in bothplayer.js
andlogic.js
. However, once both players reach the end of the stage and pressDone
, they cannot advance as the logic has not advanced past the first step. The documentation says that forSYNC_STAGE
, the players wait for a message from the server to step-- however, I couldn't find how to send this message. Any advice? Thanks!The text was updated successfully, but these errors were encountered: