(Solved) Trouble sending new session id to another player
EDIT: I got it working by having Player B search for the session tag.
Okay so I'm trying to make a room-based matchmaking system. The goal is to simply have two players agree to fight each other, then create a new session and send both of them to the new session.
So far I've achieved simple interactions like:
- Player A queue up for battle
- Player B challenges Player A (using p2p message)
- Player A accepts and creates a new session
x Player A sends the new session ID back to Player B so that Player B can also join
However here is the problem, since the gms_session_create* functions moves you to the new session, I don't know why but when I tested it Player B can't receive the P2P message from Player A.
I was thinking about using a unique tag, and have Player B continuously looks for session with that tag, but I'm not sure how to go about implementing it, the documents have too little example.
Also a different question: is it normal for the script set inside gms_script_set_session_change(script) to be called repeatedly every 15 or so seconds? I put a show_message call to test it and removed all the session swapping related codes but the script is still getting called randomly (like the game keeps re-joining the same session)
Last message on 6 Oct 2020