gms_vs_ready

Usage: gms_vs_ready ( )

Description

Returns whether there are enough players online to start the game. If so, the game will be started immediately. It's essential to move every player to the appropriate room, as soon as server_vs_ready returns true.

Example

//Lobby room, step event
if(gms_vs_ready())
{
    room_goto(rm_play);
}

Replies (12)

Last message on 3 Dec 2017

Arcadian on 23 Nov 2017, 06:48:22
I have a strange issue while using gms_vs_ready() at latest version of 1.4.
Both players are logged in at the lobby for a while, but noone of them is moved to the playroom. In addition, after a while the game is freezed (at both player´s screens), and the total count of online players shows "1" instead "2". The game gets blocked in both PCs.
What can be the reason?
Arcadian on 24 Nov 2017, 06:19:57
EDIT: It seems to be a problem with the VS Mode at the latest version of GameMaker 1.4 (1.4.1773), because if I add this line of code the game freezes, but I have tried to quit it and the game works perfectly well, the game only freezes if it contains this following line (at Step event) (I´m using the latest version of the GM Server):

if gms_vs_ready()=true
{
room_goto(Game)
}
Size43 (Administrator) on 3 Dec 2017, 12:48:11
In which object did you add that code?

I'm thinking the game might be in a loop where it continually goes to the Game room, and then next step goes to that room again (essentially restarting the room), etcetera.
Arcadian on 11 Dec 2016, 12:13:26
Is there any way to put a "switch" in a VS Mode game, so the players are only moved to playing room if they match a condition? For example, you have a VS Mode game, but it only starts when the players have clicked a "I'm ready!!" button of the game. I think actually the players are moved in any case, and I want to check that condition in order to move the players involved in a certain session.
Size43 (Administrator) on 16 Dec 2016, 21:10:51
There's no option for this in the VS mode system, however you can implement it using the session functions.
Arcadian on 17 Dec 2016, 16:16:50
So, while using VS mode, if I don´t set a gm_vs_ready() script (in order to move the players involved in a session to another room), these players are moved in any case?
Miksamoo on 16 Jan 2015, 13:57:44
(And message length limit) In GMS object's game_end event I have gms_logout() function. Sometimes there is no error.
Miksamoo on 16 Jan 2015, 13:55:09
I have problem. When there are enough players to start a game, and first player is started a game, all clients get this error:
___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object GMS:

Player possibly logged out without calling server_logout, and is now stuck in the server. (id = 73898, 3)
at gml_Script_XServer_error (line 3) - show_error(argument0, false);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XServer_error (line 3)
called from - gml_Script_gms_step (line 159) - XServer_error(gms_action_get_argument_string(0));
called from - gml_Object_GMS_StepNormalEvent_1 (line 1) - gms_step()

I know what this is meaning, but I don't understand why it gets this.
Size43 (Administrator) on 16 Jan 2015, 18:18:37
Would you be able to mail (gamemakerserver@outlook.com) me a .gmz that I can use to reproduce this issue?
Miksamoo on 16 Jan 2015, 23:22:58
Yes I can send it, but my projekt is in my school's computer. Possibly on friday I send it.
Size43 (Administrator) on 28 Jan 2015, 15:57:59
Hey,

I've got a fix ready which will fix the crash. (your game has another bug, but I think you'll figure that out pretty quickly after the fix goes live). Because the server has to move to another physical server on Saturday, I won't be uploading the fix right now.

Once the server is up and running again, I'll update the server with the new patch. I'll let you know when that happens.

Size43
Size43 (Administrator) on 16 Jan 2015, 23:31:17
That's fine :)