Level Editor/Scripting/Map entities: Difference between revisions

Level Editor: map entities in gamemode scripts
 
American spelling
 
Line 38: Line 38:
* [[Level Editor/Scripting/Reference/GamemodeServerApi#markers|api.markers()]]: every marker's name, in map order.
* [[Level Editor/Scripting/Reference/GamemodeServerApi#markers|api.markers()]]: every marker's name, in map order.
* [[Level Editor/Scripting/Reference/GamemodeServerApi#marker|api.marker(name)]]: where it stands (the origin, and a line in the log, for a name the map does not place).
* [[Level Editor/Scripting/Reference/GamemodeServerApi#marker|api.marker(name)]]: where it stands (the origin, and a line in the log, for a name the map does not place).
* [[Level Editor/Scripting/Reference/GamemodeServerApi#marker_facing|api.marker_facing(name)]]: the way it faces, level and one metre long. A point it looks at is <code>api.marker(n) + api.marker_facing(n) * distance</code>.
* [[Level Editor/Scripting/Reference/GamemodeServerApi#marker_facing|api.marker_facing(name)]]: the way it faces, level and one meter long. A point it looks at is <code>api.marker(n) + api.marker_facing(n) * distance</code>.


== Switchable parts ==
== Switchable parts ==
Line 61: Line 61:
== The map's own bots ==
== The map's own bots ==
Bots that belong to the map are fixtures such as training dummies, not stand-ins for players: nobody can kick them, and they take no player's seat.
Bots that belong to the map are fixtures such as training dummies, not stand-ins for players: nobody can kick them, and they take no player's seat.
* [[Level Editor/Scripting/Reference/GamemodeServerApi#spawn_bot|api.spawn_bot]] spawns one with a name, loadout and team; [[Level Editor/Scripting/Reference/GamemodeServerApi#map_bots|api.map_bots()]] and [[Level Editor/Scripting/Reference/GamemodeServerApi#is_map_bot|api.is_map_bot]] list and recognise them.
* [[Level Editor/Scripting/Reference/GamemodeServerApi#spawn_bot|api.spawn_bot]] spawns one with a name, loadout and team; [[Level Editor/Scripting/Reference/GamemodeServerApi#map_bots|api.map_bots()]] and [[Level Editor/Scripting/Reference/GamemodeServerApi#is_map_bot|api.is_map_bot]] list and recognize them.
* Training orders: [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_idle|api.bot_idle]] (stand still, never shoot), [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_dodge|api.bot_dodge]] (a moving target), [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_shoot|api.bot_shoot]] (fire at one player only).
* Training orders: [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_idle|api.bot_idle]] (stand still, never shoot), [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_dodge|api.bot_dodge]] (a moving target), [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_shoot|api.bot_shoot]] (fire at one player only).
* [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_build|api.bot_build]], [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_demolish|bot_demolish]] and [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_has_building|bot_has_building]]: buildings for a map bot that holds a building tool.
* [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_build|api.bot_build]], [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_demolish|bot_demolish]] and [[Level Editor/Scripting/Reference/GamemodeServerApi#bot_has_building|bot_has_building]]: buildings for a map bot that holds a building tool.