What it does
Starts connecting to a named multiplayer room, such as the tactical room.
Syntax
1
NetJoinRoom(roomName string) → integer2
NetJoinRoom(roomName string, jsonOptions string) → integerParameters
| Name | Type | In forms | Meaning |
|---|---|---|---|
| roomName | string | all | The room's name on the server, for example "aukimi-tactical". |
| jsonOptions | string | 2 | Room options as JSON text. Without it, the options from the scene's multiplayer settings are used. |
Every form returns
integer
1 if the connection started, 0 if roomName is empty, jsonOptions is not valid JSON, or the start failed (see NetLastError()).
Good to know
- The command only starts the operation and does not wait. Poll NetState() or NetIsConnected() each frame, and read NetLastError() if it fails.
- The project id, server and player name come from the scene's multiplayer settings.
- Only available in the aukimi editor: exported games do not provide this command.
Example · generated
Form 1, the short one
DO Print(NetJoinRoom("player")) Sync()LOOPForm 2, with every argument
DO Print(NetJoinRoom("player", "{}")) Sync()LOOPNetJoinRoom is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.