Level Editor/Scripting/Reference/GamemodeServerApi
Reached as api from server.gd. Reached as api from bot.gd.
What a server script can do: everything that changes the match.
Reached as api in server.gd, and in bot.gd, which shares the very same object. Players, zones, pickups and tracks are always plain ids and names.
See Level Editor/Scripting/Reference for every class, and Level Editor/Scripting/Reference/Sandbox for the rest of GDScript a script may use.
Methods
declare_player_counter
server.gd, bot.gdDeclare a counter with one value per player. Only in _declare(). Every write is held between minimum and maximum, and every player starts at initial.
name:StringNameinitial:int, default0minimum:int, default0maximum:int, default0x7FFFFFFFReturns:void
declare_team_counter
server.gd, bot.gdDeclare a counter with one value per team. Only in _declare(). Every write is held between minimum and maximum, and every team starts at initial.
name:StringNameinitial:int, default0minimum:int, default0maximum:int, default0x7FFFFFFFReturns:void
declare_global_counter
server.gd, bot.gdDeclare a counter with one value for the whole match. Only in _declare(). Every write is held between minimum and maximum; it starts at initial.
name:StringNameinitial:int, default0minimum:int, default0maximum:int, default0x7FFFFFFFReturns:void
get_player
server.gd, bot.gdA player counter's value for one player. 0 for a counter that was never declared.
entity_id:intname:StringNameReturns:int
set_player
server.gd, bot.gdSet a player counter for one player, held to its declared range. Returns the value stored.
entity_id:intname:StringNamevalue:intReturns:int
add_player
server.gd, bot.gdAdd to a player counter for one player (a negative delta subtracts), held to its declared range. Returns the value stored.
entity_id:intname:StringNamedelta:intReturns:int
get_team
server.gd, bot.gdA team counter's value for one team. 0 for a counter that was never declared.
team:intname:StringNameReturns:int
set_team
server.gd, bot.gdSet a team counter for one team, held to its declared range. Returns the value stored.
team:intname:StringNamevalue:intReturns:int
add_team
server.gd, bot.gdAdd to a team counter for one team (a negative delta subtracts), held to its declared range. Returns the value stored.
team:intname:StringNamedelta:intReturns:int
get_global
server.gd, bot.gdA global counter's value. 0 for a counter that was never declared.
name:StringNameReturns:int
set_global
server.gd, bot.gdSet a global counter, held to its declared range. Returns the value stored.
name:StringNamevalue:intReturns:int
add_global
server.gd, bot.gdAdd to a global counter (a negative delta subtracts), held to its declared range. Returns the value stored.
name:StringNamedelta:intReturns:int
transfer_player
server.gd, bot.gdAdd as much of amount to a player counter as its range allows, and return how much actually moved. Always use the return value: adding 5 to a counter with room for 2 moves 2.
entity_id:intname:StringNameamount:intReturns:int
transfer_team
server.gd, bot.gdAdd as much of amount to a team counter as its range allows, and return how much actually moved.
team:intname:StringNameamount:intReturns:int
reset_player_counters
server.gd, bot.gdPut every one of a player's counters back to its declared starting value. Counters keep their values through a death; call this in _player_spawned when dying should cost a player what they had.
entity_id:intReturns:void
counter_maximum
server.gd, bot.gdA counter's declared maximum. scope is SCOPE_PLAYER, SCOPE_TEAM or SCOPE_GLOBAL. 0 for a counter that was never declared. Lets bot.gd read the mode's limits instead of copying them.
scope:intname:StringNameReturns:int
declare_team
server.gd, bot.gdDeclare a team and return its id. Only in _declare(). The first team declared is team 1, the next team 2, and so on. A map that declares none plays with two, "Team 1" and "Team 2". maximum caps how many players the team may hold; 0 means no limit.
team_name:Stringmaximum:int, default0Returns:int
teams
server.gd, bot.gdEvery playing team's id, in order. Never includes 0, which means "on no team" and covers both an unplaced player and a spectator.
PackedInt32Arrayteam_name
server.gd, bot.gdA team's name, or "" for a team that does not exist.
team:intReturns:String
team_maximum
server.gd, bot.gdHow many players a team may hold, or 0 when there is no limit.
team:intReturns:int
set_spectating
server.gd, bot.gdTake a player out of the round without disconnecting them, or put them back in with false. While spectating they take no damage, do not collide, cannot use weapons and are not drawn.
entity_id:intspectating:boolReturns:void
is_spectating
server.gd, bot.gdWhether a player is spectating.
entity_id:intReturns:bool
players
server.gd, bot.gdThe entity ids of every player in the match, bots included, alive or not, sorted. The map's own bots (spawn_bot) are fixtures, not players, and are left out here and in players_on_team; their hooks still run.
Arrayplayers_on_team
server.gd, bot.gdThe entity ids of every player on one team, sorted.
team:intReturns:Array
team_of
server.gd, bot.gdThe team a player is on, or 0 for none (not placed yet, or spectating).
entity_id:intReturns:int
party_team_of
server.gd, bot.gdThe team this player's Steam party is playing on: where most of the party-mates already in the match are, or 0 when they came alone or none of them has a team yet. The default join seats a player there.
entity_id:intReturns:int
set_team_of
server.gd, bot.gdPut a player on a team. The mode decides who is on which team.
entity_id:intteam:intReturns:void
is_alive
server.gd, bot.gdWhether a player is alive and in play.
entity_id:intReturns:bool
position_of
server.gd, bot.gdWhere a player is now, as of this server tick.
entity_id:intReturns:Vector3
death_position
server.gd, bot.gdWhere the player whose death _player_died is handling died. Drop whatever the body leaves behind here, not at position_of. Vector3.INF outside _player_died.
Vector3spawn_points
server.gd, bot.gdThe positions of a team's spawn points, as placed in the level editor.
team:intReturns:PackedVector3Array
zones
server.gd, bot.gdThe key of every zone in the map: every area trigger, the payload carts' push areas, and the world boundary. The zone hooks hand you these keys.
PackedStringArrayzone_label
server.gd, bot.gdThe name the author gave a zone in the editor. Compare this, not the key: several zones may share a name, but each key is unique.
zone:StringNameReturns:StringName
zones_labeled
server.gd, bot.gdThe keys of every zone the author gave this name, in map order.
label:StringNameReturns:Array
zone_team
server.gd, bot.gdThe team a zone belongs to, set as its Zone Team in the editor. 0 is neutral.
zone:StringNameReturns:int
zone_occupants
server.gd, bot.gdThe entity ids of the living players inside a zone, sorted.
zone:StringNameReturns:Array
zone_position
server.gd, bot.gdWhere a zone is in the world: the position of its origin. For pointing a bot at it.
zone:StringNameReturns:Vector3
forbid_building
server.gd, bot.gdNobody may build inside a zone from now until the map ends: a building whose center would stand in it is refused. For your spawn rooms, from _start. A zone on a moving platform cannot be forbidden, and says so in the log.
zone:StringNameReturns:void
tracks
server.gd, bot.gdEvery payload track's name, in map order: the name the track has in the level editor. Every distance the track calls take or give is meters along the track, 0 at its start. An unknown track reads as 0 or empty, and commands to it are ignored.
PackedStringArraytrack_length
server.gd, bot.gdA track's length in meters.
track:StringNameReturns:float
track_checkpoints
server.gd, bot.gdEach checkpoint's distance from the track's start in meters, in order. What reaching one means is up to the mode; usually set_track_floor to it.
track:StringNameReturns:PackedFloat32Array
track_markers
server.gd, bot.gdThe names of a track's markers, in order along the track. A marker is a track anchor the map's author named in the editor; it means nothing until your script reads it. The cart passing one calls _track_marker.
track:StringNameReturns:PackedStringArray
track_marker
server.gd, bot.gdA marker's distance from the track's start in meters, or -1.0 when the track has no marker by that name. For planning ahead of the cart, such as slowing it down before it reaches the marker.
track:StringNamemarker:StringNameReturns:float
track_progress
server.gd, bot.gdHow far the cart has come, in meters, as of this server tick.
track:StringNameReturns:float
track_point
server.gd, bot.gdThe world position a distance along the track, on the line the cart rides. A distance past either end gives that end. Safe in _spawn_position.
track:StringNamedistance:floatReturns:Vector3
track_zone
server.gd, bot.gdThe key of the zone the cart carries with it, or &"" for a cart without one. It arrives through the zone hooks like any other zone, and its label is the track's name.
track:StringNameReturns:StringName
set_track_speed
server.gd, bot.gdSet the speed the cart heads for, in meters per second: negative rolls it back, 0 stops it. The cart speeds up and slows down smoothly, never past its top speed, and stops at either end and at its floor (set_track_floor). Setting the same speed again costs nothing, so set it every tick.
track:StringNamespeed:floatReturns:void
track_speed
server.gd, bot.gdThe speed last set with set_track_speed: where the cart is heading, not how fast it is moving while it gets there.
track:StringNameReturns:float
set_track_floor
server.gd, bot.gdStop the cart rolling back past a distance from the start. Raise it to a checkpoint once the cart reaches it, and the checkpoint holds. It never pulls the cart forward. Starts at 0.
track:StringNamedistance:floatReturns:void
set_track_dispenser
server.gd, bot.gdTurn the cart's dispenser on for a team: every few tenths of a second it gives health and ammunition to that team's players standing near it and in its sight, as a built dispenser does, with a heal beam from the lamp on its roof to each of them. That team's bots go to it to heal and restock. 0 turns it off, and it starts off.
track:StringNameteam:intReturns:void
markers
server.gd, bot.gdThe name of every Map Marker the map places, in map order. A marker is a named spot and facing the author put in the level editor for a script to read, so a station can move in the editor without the script changing.
PackedStringArraymarker
server.gd, bot.gdWhere the marker named marker_name stands. The origin, and a line in the log, for a name the map does not place.
marker_name:StringReturns:Vector3
marker_facing
server.gd, bot.gdThe way the marker named marker_name faces, level and one meter long: the arrow at its feet in the editor. A point it looks at is api.marker(n) + api.marker_facing(n) * distance.
marker_name:StringReturns:Vector3
parts
server.gd, bot.gdThe name of every switchable part the map has, in map order. A part is a group the author ticked Switchable in the level editor: everything in it, walls, props and all, comes and goes together, and it starts the way its Starts Enabled box says.
PackedStringArraypart_enabled
server.gd, bot.gdWhether the part named part_name is there now. False for a name the map does not have.
part_name:StringReturns:bool
set_part_enabled
server.gd, bot.gdPut the part named part_name in the world, or take it out with false: it is seen and it blocks, or it is neither, on the server and on every player's screen, including players who join later. Switching it to the state it is in costs nothing. False, and a line in the log, for a name the map does not have.
part_name:Stringenabled:boolReturns:bool
doors
server.gd, bot.gdThe name of every door the map has, in map order: the name the author gave it in the level editor.
PackedStringArraydoor_open
server.gd, bot.gdOpen the door named door, as walking up to it would. False if it is locked, and false with a line in the log for a name the map does not have. A door that is open or opening stays so.
door:StringNameReturns:bool
door_close
server.gd, bot.gdClose the door named door, locked or not. A door shut or shutting stays so.
door:StringNameReturns:bool
door_toggle
server.gd, bot.gdClose the door if it is open or opening, open it otherwise.
door:StringNameReturns:bool
door_lock
server.gd, bot.gdLock the door: walking up to it no longer opens it, nor does door_open, and bots stop pathing through it. An open door stays open until it closes.
door:StringNameReturns:bool
door_unlock
server.gd, bot.gdUnlock the door.
door:StringNameReturns:bool
door_state
server.gd, bot.gdWhere the door is: DOOR_CLOSED, DOOR_OPENING, DOOR_OPEN or DOOR_CLOSING. DOOR_CLOSED for a name the map does not have.
door:StringNameReturns:int
door_locked
server.gd, bot.gdWhether the door is locked. False for a name the map does not have.
door:StringNameReturns:bool
fire_input
server.gd, bot.gdFire input at every entity named target, as an output would: a door (Open, Close, Toggle, Lock, Unlock), a zone by its trigger name (Enable, Disable, Toggle), a relay (Trigger, Enable, Disable, Toggle, CancelPending), a timer (Enable, Disable, Toggle, FireTimer, RefireTime), a counter (Add, Subtract, SetValue, Enable, Disable) or a button (Press, Lock, Unlock). parameter is the number some inputs take, as text ("5"); delay the seconds before it lands. False, with a line in the log, for a name the map does not have.
target:StringNameinput:StringNameparameter:String, default""delay:float, default0.0Returns:bool
counter_value
server.gd, bot.gdThe value of the counter named counter, 0 for a name that is no counter.
counter:StringNameReturns:float
bosses
server.gd, bot.gdThe entity id of every boss the map places with a Boss Spawn, in map order. Bosses are level content: they stand whether or not the mode mentions them, and _entity_damaged and _entity_died report what happens to them.
Arrayentity_name
server.gd, bot.gdThe name the author gave the boss's spawn in the editor. Compare this to tell your bosses apart.
entity_id:intReturns:StringName
entity_team
server.gd, bot.gdThe team whose base the boss guards, as set on its spawn. Its own team's weapons do not hurt it.
entity_id:intReturns:int
entity_health
server.gd, bot.gdThe boss's health now. A boss heals itself if its spawn says so, once nobody has hurt it for a while; no weapon heals one.
entity_id:intReturns:float
entity_max_health
server.gd, bot.gdThe health the boss started with, as set on its spawn.
entity_id:intReturns:float
entity_alive
server.gd, bot.gdWhether the boss is still alive. A dead boss sinks and stays dead until revive_boss.
entity_id:intReturns:bool
revive_boss
server.gd, bot.gdBring a dead boss back where it stood, at full health and idle, as if the round had just begun for it. Nothing happens to a living one. For a practice boss; a boss a match is played over should stay dead.
entity_id:intReturns:void
entity_position
server.gd, bot.gdWhere the boss stands. It never moves.
entity_id:intReturns:Vector3
entity_zone
server.gd, bot.gdThe key of the zone that is the boss's arena: the zone named by its spawn's Arena Zone that contains the boss. &"" when its spawn names none or the mode has no zones. It arrives through the zone hooks like any other zone.
entity_id:intReturns:StringName
spawn_pickup
server.gd, bot.gdPut a pickup on the ground and return its handle. kind is soul, ammo_small, ammo_medium, ammo_large, health_small, health_medium or health_large. team is whose it is (0 for nobody's), lifetime the seconds it lasts untaken (0 for until somebody takes it), and radius how close a player has to come. It comes to rest on the floor below position.
kind:StringNameposition:Vector3team:int, default0lifetime:float, default0.0radius:float, default1.5Returns:int
scatter_pickups
server.gd, bot.gdPut count pickups in a ring of radius spread around origin, and return their handles. Every one stays on the near side of any wall between it and origin, so use this, not a loop of spawn_pickup, for what a death drops.
kind:StringNameorigin:Vector3count:intspread:float, default1.2team:int, default0lifetime:float, default0.0radius:float, default1.5Returns:Array
despawn_pickup
server.gd, bot.gdRemove a pickup. False when the handle names nothing. A supply station's pack comes back on the station's usual timer.
handle:intReturns:bool
pickups
server.gd, bot.gdEvery pickup's handle, sorted.
Arraypickup_kind
server.gd, bot.gdWhat a pickup is, or &"" once it is gone.
handle:intReturns:StringName
pickup_team
server.gd, bot.gdWhose a pickup is (0 for nobody's).
handle:intReturns:int
pickup_position
server.gd, bot.gdWhere a pickup is.
handle:intReturns:Vector3
teleport
server.gd, bot.gdMove a player to a position.
entity_id:intposition:Vector3Returns:void
kill
server.gd, bot.gdKill a player, for the mode's own hazards: a pit, a crusher, a trap. Nobody gets the kill. _player_died runs as for any other death.
entity_id:intReturns:void
set_spawn_immunity
server.gd, bot.gdMake a player immune to damage and keep their reserve ammo topped up, while they move and shoot normally. Healing still works. It lasts until you turn it off; for a spawn room, turn it on in _zone_entered and off in _zone_exited.
entity_id:intimmune:boolReturns:void
has_spawn_immunity
server.gd, bot.gdWhether a player has spawn immunity.
entity_id:intReturns:bool
set_class_change_allowed
server.gd, bot.gdLet a living player change class where they stand, or stop them again with false. A player's first pick, and any pick made while dead, always works. For a spawn room, open it in _zone_entered and close it in _zone_exited.
entity_id:intallowed:boolReturns:void
may_change_class
server.gd, bot.gdWhether a player may change class where they stand. Changing team costs a player a life unless this is true.
entity_id:intReturns:bool
resupply
server.gd, bot.gdRefill a player: full health, and full ammo and reserve on every weapon, exactly as a respawn does. Call it from _zone_entered or _zone_tick to make a resupply zone.
entity_id:intReturns:void
respawn_in
server.gd, bot.gdBring a dead player back after seconds. Call it from _player_died with its default_seconds for the normal timer, or with your own number: "the losing team respawns faster" is a subtraction. A player nobody calls this for stays dead.
entity_id:intseconds:floatReturns:void
bots
server.gd, bot.gdThe entity ids of every bot in the match, sorted. Bots are also in players. The map's own bots (spawn_bot) are not: they are in map_bots.
Arrayis_bot
server.gd, bot.gdWhether a player is a bot, the map's own included.
entity_id:intReturns:bool
spawn_bot
server.gd, bot.gdSpawn a bot that belongs to the map: a fixture such as a training dummy, not a stand-in for a player. Nobody can kick it, the quick-play filler never trims it, and it takes no player's seat or place in the server's bot count. It is on the scoreboard as bot_name, it obeys orders like any bot, and it is gone when the map is.
loadout names its items by slot, comma-separated, slot 1 first ("Shotgun,Pistol,Cast Iron Pan"); bias spreads the spec points its items leave free (pick, power, support), so Vector3(0, 1, 0) makes it as thicc as the items allow and Vector3(1, 0, 1) as thin. It keeps that loadout for life. Its team is team, set before _player_joined runs, and it appears at home every time it spawns, whatever _spawn_position says. Respawning it is up to _player_died, as for anybody.
Returns its entity id, or 0 when the loadout or the team does not exist (the reason goes to the log). Call it from _start.
bot_name:Stringteam:intloadout:Stringhome:Vector3bias:Vector3, defaultVector3.ONEReturns:int
is_map_bot
server.gd, bot.gdWhether a player is one of the map's own bots (spawn_bot).
entity_id:intReturns:bool
map_bots
server.gd, bot.gdThe entity ids of the map's own bots, sorted.
Arraybot_attack
server.gd, bot.gdOrder a bot to hunt one player. It closes in, fights, and finds them again if it loses them. False when entity_id is not a bot, as for every order.
entity_id:inttarget_id:intReturns:bool
bot_move_to
server.gd, bot.gdOrder a bot to go somewhere. It shoots at what it passes but does not chase: the order for a carrier heading home.
entity_id:intposition:Vector3arrive_radius:float, default2.0Returns:bool
bot_defend
server.gd, bot.gdOrder a bot to hold ground. It fights anything that comes within radius and returns to position when nothing is there.
entity_id:intposition:Vector3radius:float, default10.0Returns:bool
bot_collect
server.gd, bot.gdOrder a bot to go and take a pickup. The order ends by itself when the pickup is gone, and is refused (false) for one that is already gone.
entity_id:inthandle:intReturns:bool
bot_roam
server.gd, bot.gdHand a bot back to its own devices: hunting whoever is nearest, wandering when there is nobody. What a bot with no orders does.
entity_id:intReturns:bool
bot_escort
server.gd, bot.gdOrder a bot to stay with a player and fight what threatens them first. Ends by itself when that player dies or leaves.
entity_id:inttarget_id:intReturns:bool
bot_idle
server.gd, bot.gdStand still, never shoot, and face look_at: a training dummy.
entity_id:intlook_at:Vector3Returns:bool
bot_dodge
server.gd, bot.gdStrafe and jump at random about centre, staying within radius, facing the nearest enemy and never firing: a moving target for aim practice.
entity_id:intcentre:Vector3radius:float, default4.0Returns:bool
bot_shoot
server.gd, bot.gdStand where it is and fire at target_id and at nobody else, reloading as it runs dry; while the target is dead it waits for it. It does not resupply itself: keep it in ammunition with resupply.
entity_id:inttarget_id:intReturns:bool
edit_bot_loadout
server.gd, bot.gdOpen the loadout editor for player entity_id on bots (entity ids; the editor shows the first) and let them give every one of them a new loadout: the class window, without the parts a bot cannot keep. Called from _zone_used, the permission lasts while the player stands in that zone; from anywhere else, until they leave the match. The bots take the new loadout at once, at full health. With weapons_only the editor hides the spec points and each bot keeps its own build, re-spread over what its new weapons cost: a range of thin and thicc targets stays thin and thicc. False when bots is empty, names anything that is not a bot, or entity_id is not a human player.
entity_id:intbots:Arrayweapons_only:bool, defaultfalseReturns:bool
bot_build
server.gd, bot.gdPut up a building for one of the map's own bots (spawn_bot) holding a Struction Console, already built, at level (1 to 3), standing on the floor at position and facing look_at. kind is sentry, dispenser, teleporter_entrance or teleporter_exit. It is the bot's building as one it placed itself would be: on its team, upgraded by its wrench, credited to it. A builder has one of each kind, so building a kind it already has takes the old one down. The building outlives the bot's death and falls to damage like any other; bot_demolish or a new loadout for the bot takes it down. Free: it costs the bot no metal. False, and nothing built, for any other bot or player, a bot whose console is not in its hands yet (its loadout arrives a moment after spawn_bot: try again next tick), an unknown kind or a level out of range.
entity_id:intkind:StringNameposition:Vector3look_at:Vector3level:int, default1Returns:bool
bot_demolish
server.gd, bot.gdTake down the kind building of one of the map's own bots. False when it has none standing.
entity_id:intkind:StringNameReturns:bool
bot_has_building
server.gd, bot.gdWhether one of the map's own bots has a kind building standing: false once players have destroyed it.
entity_id:intkind:StringNameReturns:bool
place_building
server.gd, bot.gdPut up a building of the map's own, with no builder: kind (sentry, dispenser, teleporter_entrance or teleporter_exit) already built at level (1 to 3), for team, standing on the floor at position and facing look_at. key is the map's name for it: placing under a key that already holds one replaces it. It fights for team like any building, a wrench of that team upgrades and repairs it, and what it does is credited to itself, which the kill feed names: "Sentry Gun" killed you. False, and nothing built, for an unknown kind, a level out of range or a position that is not one.
key:StringNamekind:StringNameteam:intposition:Vector3look_at:Vector3level:int, default1Returns:bool
remove_building
server.gd, bot.gdTake down the map's building under key. False when none stands there.
key:StringNameReturns:bool
has_building
server.gd, bot.gdWhether the map's building under key stands: false once it is destroyed.
key:StringNameReturns:bool
bot_order
server.gd, bot.gdWhat a bot was last ordered: attack, move, defend, collect, escort, roam, idle, dodge, shoot, or &"" for a bot nobody has ordered.
entity_id:intReturns:StringName
bot_set_skill
server.gd, bot.gdHow good a bot is at fighting, from 0 to 1: aim, reactions and accuracy together. The map decides how hard its bots are; set it in _player_joined.
entity_id:intskill:floatReturns:bool
bot_skill
server.gd, bot.gdA bot's fighting skill, from 0 to 1. 0 for a player who is not a bot.
entity_id:intReturns:float
bot_kit
server.gd, bot.gdThe kit a bot was dealt, such as &"trooper" or &"medic"; &"custom" for a loadout given by hand; &"" for a human or a bot with no kit yet.
entity_id:intReturns:StringName
bot_role
server.gd, bot.gdWhat a bot's kit is for: &"assault", &"support", &"defense" or &"sniper", or &"" with no kit. Deal jobs by this: support escorts the carrier, defense holds the base.
entity_id:intReturns:StringName
bot_kits
server.gd, bot.gdThe name of every kit there is.
PackedStringArraybot_set_kit
server.gd, bot.gdGive a bot a different kit from its next life, never mid-fight. False for a human, a player who is gone, or a kit that does not exist.
entity_id:intkit:StringNameReturns:bool
declare_winner
server.gd, bot.gdDeclare the winner and end the round; team 0 is a draw. The game does the rest: the result screen goes up, players vote for the next map, and the server changes to it. reason is a short line the result screen prints under the winning team, such as "held the hill for 60 seconds".
Only the first call counts. Afterwards no zone, pickup or tick hook runs.
team:intreason:String, default""Returns:void
match_state
server.gd, bot.gdWhich phase the match is in: MATCH_LIVE, MATCH_DECIDED, MATCH_RESULT, MATCH_VOTING or MATCH_LOADING. Once the round is decided the game already stops scoring, respawns and the mode's hooks, so a mode only needs this for something of its own that should stop too.
intnotify
server.gd, bot.gdFlash a message across the top of one player's screen, under the gamemode's widgets, for a few seconds. title is the line; body is a shorter line under it; warn marks something they lose by ignoring, drawn in the warning color and held longer. A new message replaces the one on screen, so send what matters now (a checkpoint reached, your boss under attack), not every hit. Bots are skipped, so looping over players() is fine.
entity_id:inttitle:Stringbody:String, default""warn:bool, defaultfalseReturns:void
open_tile_map
server.gd, bot.gdOpen a plan of a grid on a player's screen, seen from its door, which is drawn at the bottom: title over columns x rows tiles, each holding one of your options, with Clear All, Apply and Close under it. Clicking a tile offers every option; Clear All puts option 0 on every tile.
Each option is a Dictionary {"label": "Sentry", "icon": "sentry", "level": 2}: what the picker's button says, the picture on the tile (empty, sentry, dispenser, teleporter, low_wall, high_wall, crates, or "" for the label alone), and a level the tile shows beside it (0 for none). values holds an option index per tile: row 0 is the row nearest the door, each row runs left to right as seen from the door, and the tiles are named that way, A1 in the door's left corner. Apply calls _form_submitted(entity_id, form, values) with the tiles in the same order; form is the name you give it here, so one script can tell its maps apart. Called from _zone_used, the map answers only while the player stands in that zone. door is where along the bottom edge the door is drawn, from 0 (the left end) to 1 (the right). At most 12 tiles a side and 24 options; long labels are cut short. A new map replaces the one on screen. False, and nothing shown, for a bot, a player who is gone, or a map that does not fit.
entity_id:intform:StringNametitle:Stringcolumns:introws:intoptions:Arrayvalues:PackedInt32Arraydoor:float, default0.5Returns:bool
notify_all
server.gd, bot.gdFlash a message on every player's screen.
title:Stringbody:String, default""warn:bool, defaultfalseReturns:void
notify_team
server.gd, bot.gdFlash a message on the screens of one team.
team:inttitle:Stringbody:String, default""warn:bool, defaultfalseReturns:void
log
server.gd, bot.gdPrint a line tagged with the map's name and server, for testing.
message:StringReturns:void
Constants
SCOPE_PLAYER
server.gd, bot.gdThe player counters, for counter_maximum.
SCOPE_TEAM
server.gd, bot.gdThe team counters, for counter_maximum.
SCOPE_GLOBAL
server.gd, bot.gdThe global counters, for counter_maximum.
MATCH_LIVE
server.gd, bot.gdmatch_state(): the round is being played.
MATCH_DECIDED
server.gd, bot.gdmatch_state(): a winner has been declared; the world plays on for a moment.
MATCH_RESULT
server.gd, bot.gdmatch_state(): the world is paused and the result is showing.
MATCH_VOTING
server.gd, bot.gdmatch_state(): players are voting for the next map.
MATCH_LOADING
server.gd, bot.gdmatch_state(): the next map is loading.
DOOR_CLOSED
server.gd, bot.gddoor_state(): shut.
DOOR_OPENING
server.gd, bot.gddoor_state(): on its way open.
DOOR_OPEN
server.gd, bot.gddoor_state(): open.
DOOR_CLOSING
server.gd, bot.gddoor_state(): on its way shut.