For more information on items not covered within this document, please set up a Q&A Session with Nico.
Currently, the lobby system needs to be opened as a Table Realms project file, and the existing assets should be switched out with whichever assets you would like to use in your project.
Important Note: When importing your assets, ensure that there are no name duplications between existing assets and assets being imported.
The hierarchy and layouts should not need to be changed.
Future iterations of the lobby system will allow it to be imported, much like base.lua and other scripts.
The values associated with these keys can be retrieved anywhere from the model
player.[player id].lobby.avatar
This contains the Base64 string of the players avatar
player.[player id].lobby.ready
String flag for when a player is ready in the current session (‘true’ or ‘false’)
player.[player id].lobby.color
Color assigned to the player (format: red|green|blue|alpha in 0-1 values)
player.[player id].lobby.roundsPlayed
The number of rounds played by the player
player.[player id].lobby.playedWith
Map of how many games the player has played with each of the other players
player.[player id].lobby.music
Flag for music on/off
player.[player id].lobby.sound
Flag for sound on/off
SendAction("start")
This action should initialize and start the game. On the platform, you need to register an event listener for the ‘start’ action.
Max and min player settings can be found in the lobby script as variables
You will need to set up some sort of companion player manager in your game
Note from Nico: I might move my stuff into lua if it is deemed necessary, or we will create an equivalent in Construct.
The avatar component can be added like a normal image component. You can specify both a placeholder image and a ready image. If the ready image is not nil, it will be used when a players ready flag is Set.
The index value of the avatar is what is used to associate it to a player, for example avatar with index 1 will display the first player’s avatar and ready state
Lobby:
| Object for Event | Condition | Parameters | Object for Action | Action | Parameters |
|---|---|---|---|---|---|
| Table Realms | Action executed named | “start” | Table Realms | send command | “gameStarted”=“” |
| —————- | ——— | ———- | —————– | —— | ———- |
| Table Realms | Command Received named | “gameStarted” | TableRealms | Set String | “page”=“Game” |
| —————- | ——— | ———- | —————– | —— | ———- |
| System | go to layout | “How To Play” | |||
| —————- | ——— | ———- | —————– | —— | ———- |
| Browser | log in console | “The host has started the game” |
The last row in the table is not necessary for full execution of the lobby, but it does help with debugging!