Starting The Match
Last updated
Last updated
When enough players are present in the lobby and everyone is ready, the LobbyGameMode
will transition into the MatchStarted
state and the OnMatchStarted
event will be called. The lobby can also be started immediately via the StartMatch
function.
Once the match is started, we can travel to a new map where the actual match will be played.
IMPORTANT: Before traveling to a new level we always have to make sure that the Host Reservation is set properly! For more information please refer to The Host Reservation section of the documentation.
We can travel to a new map by using the ServerTravelToLevel
function. The "Travel URL" should be the name of the map that we want to open. The map name can be given in the following formats (without the quotes):
Short package name: "MyMap"
Long package name: "/Game/Maps/MyMap" (recommended)
In packaged projects you can only travel to maps that were included for packaging. You can do this by going to Project Settings -> Packaging and in the advanced options look for the "List of maps to include in a packaged build".
You might want to update the Session Settings of the match before traveling to the match. For example if players can join matches mid game, then you probably want to update settings such as the "Playlist", "Map Name", and "Game Mode" to match the current state of the game.
The next section of the documentation explains how to Update Session Settings.
While in the lobby, you can use the kronos.LobbyStartMatch
console command to start the match regardless of how many players are in the lobby. This can be very useful when you are testing the game alone.