Skip to content

Settings

The values a server owner sets, and the matches a server plays: the engine’s own and the mod’s. A module makes one of its server state a setting by giving it set_by. That is the group who may change it with /set, or config for the server’s configuration alone: its file, the environment and --set. See settings for where values come from.

A mod starts the next match itself with start_match, the rotation’s or one it names, and tells players which comes next with announce_next_match, as a vote does once it ends. See matches for the rotation.

On the server config: Config

As a server_state's set_by: the server's configuration alone may set it, never a player's /set.

On the server announce_next_match(map, gametype)

Tells every player the match that comes next, so their game downloads its files while this one plays; it starts nothing.

It is checked as start_match is. A later call replaces it, and a player who joins is told the last. start_match() still starts the rotation’s next match, which the rotation announces itself as each match starts.

NameTypeWhat it is
mapstringNeeded.
gametypestringNeeded.
Fails
  • a value of the wrong type
announce_next_match("yard", "tdm")
On the server start_match(map?, gametype?)

Ends this match and starts the next: with no arguments the rotation's, else that map and gametype.

It fails at the call for a map the server has not, a gametype the map does not list, or one the mod has not. The next map loads while this match plays on; then this match’s ending handlers run, and the switch removes every entity, timer and waiting handler and starts match_state and player_state from their defaults, while server_state stays and match.number counts on. Without a rotation, start_match() plays this match again; start_match(match.map, match.gametype) restarts it and leaves the rotation where it is.

NameTypeWhat it is
mapstring?May be left out.
gametypestring?May be left out.
Fails
  • a value of the wrong type

To play team deathmatch on yard once a team wins

Section titled “To play team deathmatch on yard once a team wins”
event("team_won", t.record { team = t.int })
on("team_won", function()
start_match("yard", "tdm")
end)
start_match()
On the server snapshot_rate(rate)

Asks for rate snapshots a second: 10, 12, 15, 20, 30 or 60, which divide the server's 60 ticks a second; 20 without it.

One module declares it, at its top as it loads: a second module’s fails at load, naming both. Any other rate fails at load, and on an edit is printed and the rate kept. The server sends at the most of those within it and its max_snapshot_rate setting, 60 by default, and prints the rate it sends at. Each player’s game gets the most of the rates dividing that one whose snapshots each have 500 bytes of its rate: at 60 a second, a player at 10000 bytes a second gets 20, and one at 25000 gets 30. A player’s game draws the others two of its snapshots behind the newest, 100 ms at 20 and 33 ms at 60, easing into a new rate’s delay. on_tick runs 20 times a second at any rate.

NameTypeWhat it is
ratenumberNeeded.
Fails
  • a value of the wrong type

To send fast moves at once, for a mod of duels

Section titled “To send fast moves at once, for a mod of duels”
snapshot_rate(60)