NetJoinRoom

Family: Multiplayer · 2 forms

What it does

Starts connecting to a named multiplayer room, such as the tactical room.

Syntax

1
NetJoinRoom(roomName string) → integer
2
NetJoinRoom(roomName string, jsonOptions string) → integer

Parameters

NameTypeIn formsMeaning
roomNamestringallThe room's name on the server, for example "aukimi-tactical".
jsonOptionsstring2Room 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()LOOP

Form 2, with every argument

DO  Print(NetJoinRoom("player", "{}"))  Sync()LOOP

NetJoinRoom 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.

93 commands in Multiplayer