Skip to content
Documentation

Multiplayer Actions

Built-in authoring reference for Mercury 1.0.1. All actions.

Host Multiplayer

Starts a multiplayer game this player owns. Desktop builds run the server INSIDE the game (no setup — friends on the network join with the address in $net_invite / the lobby); in a browser it joins the configured server, where the first player in the room hosts.

Reference key: netHost.

Editor category: Multiplayer > Sessions and Lobbies.

Example: On a “Host game” title-menu button, add Host Multiplayer — then Draw Text $net_invite so friends can see the address to join.

Parameter Type Optional Details
Room text Yes The room to host. Blank uses the project’s room from Game Settings (or the game title).
Player Name text Yes Shown to other players. Blank keeps the name from Game Settings, or “Player N”.
Who Can Join enum Yes Wifi lets other machines and phones on the network join; this-computer keeps the game to windows on this machine. Choices: wifi, this-computer. Default: “wifi”.
Password text Yes The room password. The first player into a room sets it; everyone after must give the same one. Blank uses the password from Game Settings (usually none). A lone $global reads a text variable, such as one the player typed.

Join Multiplayer

Joins one multiplayer room as a client. Hosting and disconnecting are separate atomic actions.

Reference key: netConnect.

Editor category: Multiplayer > Sessions and Lobbies.

Example: On a Join button, join the selected room with the player’s chosen name.

Parameter Type Optional Details
Room text Yes Players in the same room play together. Blank uses the project’s room from Game Settings (or the game title).
Player Name text Yes Shown to other players. Blank keeps the name from Game Settings, or “Player N”.
Server text Yes A server address (ws://… or wss://…) to use for this connection instead of the one in Game Settings — how a player joins a friend’s hosted game by address.
Password text Yes The room password. The first player into a room sets it; everyone after must give the same one. Blank uses the password from Game Settings (usually none). A lone $global reads a text variable, such as one the player typed.

Leave Multiplayer

Leaves the room and closes the connection. Other players get a Player Left event.

Reference key: netDisconnect.

Editor category: Multiplayer > Sessions and Lobbies.

Example: On a “Leave” menu button, leave multiplayer before going back to the title scene.

Lock Multiplayer Room

Host only. A locked room takes no new players — with “Next room when full” on in Game Settings, newcomers are sent to a new room instead. Lock when a match starts so no one arrives mid-game. $net_locked is 1 while locked.

Reference key: netLockRoom.

Editor category: Multiplayer > Sessions and Lobbies.

Example: When the host presses Start Match, lock the room, then change to the arena scene.

Parameter Type Optional Details
Mode enum Yes Lock stops new players joining this room; unlock opens it again; toggle flips it. Choices: lock, unlock, toggle. Default: “lock”.

Send Message

Sends a named message (with an optional value) to other players in the room. On arrival it fires their Message Received event: the channel is the filter, the value lands in $net_msg and the sender’s id in $net_msg_from.

Reference key: netSend.

Editor category: Multiplayer > Messages.

Example: On Button Pressed [Fire], Send Message “fire” with value $angle to everyone.

Parameter Type Optional Details
Channel text No The message’s name. Message Received events with this channel (or a blank channel) run on the other players.
Value number Yes A number, “text”, or $global to send along. Receivers read it as $net_msg.
To enum Yes Everyone includes this player (the event also runs locally); others excludes it; host reaches the room host; player targets one player id. Choices: everyone, others, host, player. Default: “everyone”.
Player Id number Yes The target player id — used only when To is “player”.

Show Lobby

Opens the built-in multiplayer lobby — a ready-made screen with name/room fields, Join and Host buttons, and the invite address while hosting. With “Connect automatically” off it already opens at game start; use this action to open it from a menu.

Reference key: netLobby.

Editor category: Multiplayer > Sessions and Lobbies.

Example: On a “Play online” title-menu button, add Show Lobby.

Parameter Type Optional Details
Mode enum Yes Show opens the built-in multiplayer lobby, hide closes it, toggle flips it. Choices: show, hide, toggle. Default: “show”.

Myth Engine Documentation