Help me understanding this.

Posted by Uhaszysz
if i put gms_self_set("maxHp",maxHp); in create and only once then i am able to receive this anytime i want. Where this is held? on server? and for how long?
And if this is p2p or all players are synced on this website owner's server?

And also one quick question. how could i get players in room that i am not inside. I want to find empty room and get its id to connect then.

Replies (1)

Last message on 14 Mar 2021

Size43 (Administrator) on 14 Mar 2021, 16:10:49
The variables are stored both client-side and server-side. The value stored server-side is sent to other clients when they connect. It is stored until the client disconnects.

All communication in GameMaker Server goes via the server, so nothing is happening peer-to-peer.

You can enumerate all players in a session using gms_other_find and gms_other_count, and you can figure out which room they're in by using gms_other_get(other_player_id, "room"). Though you might also be interested in using the session system, which allows you to start multiple separate "instances" of the game where players don't see eachother. (so you can have two groups of players in the same room, but different sessions, so they don't see eachother)