Setting up 1v1 Warmup Arenas

Official Maps with 1v1 Warmup Arenas
Map Name 	BSP name
Dust II 	de_dust2
Inferno 	de_inferno
Mirage 	de_mirage
Nuke 	de_nuke
Overpass 	de_overpass
Shortnuke 	de_shortnuke
Train 	de_train
Vertigo 	de_vertigo
Pick/Ban lobby(Broken Fang Premier Mode)	lobby_mapveto
1v1 Weapons
AK-47
Galil AR
FAMAS
AWP
M4A4
M4A1-S
Desert Eagle
USP-S
Glock-18
This is the documentation of a way to use the VScripts
* csgo/scripts/vscripts/warmup/warmup_arena.nut
* csgo/scripts/vscripts/warmup/warmup_teleport.nut
that are designed for the management of 1v1 warmup arenas in .
The implementation described below equals the one of de_vertigo (2021-05-05).
== Gameplay Description ==
Officially, the 1v1 warmup plays as follows:
* It is only active during warmup of the game modes and , i.e. if is 0 and is 1 or 2.
* During warmup, respawning players are teleported to a separate room ("1v1 arena") with one enemy player (if there is one), emitting the player spawn sound used in .
* Both players get 100 HP, kevlar (no helmet), their knife and a randomly chosen weapon from a hard-coded list inside warmup_arena.nut.
* If there is only one player in an arena, he will be reset in this arena if a respawning enemy player is teleported there.
* Dropped weapons are cleared in an arena if two players spawn, namely in a sphere around the arena's logic_script with a radius of 640 units.
* In Competitive, 5 arenas are used. In Wingman, only 2 arenas are regarded.
== Map Requirements ==
This section covers the requirements to a map to additionally support 1v1 warmup arenas.
=== Overview ===
This is how the following implementation will work:
* During warmup, the players actually spawn at their default spawns on the regular part of the map, but all of the spawn points are inside a big trigger_multiple that teleports them into an arena with a free slot. The VScript warmup/warmup_teleport.nut is the entity script of those triggers and handles the assignment of players to the arenas.
* Each of the 5 arenas has a logic_script with the VScript warmup/warmup_arena.nut keeping track of its current players.
* In each arena there are two trigger_multiples inside each other with different team filters filling the entire volume of the arena. These shall fire outputs if a (Counter-)Terrorist enters an arena or dies in one to lock or unlock that arena for other players.
=== Required Entities - General ===
These entities are required once in the map.
Class 	Where? 	Name 	KeyValues	Outputs 	Comment
trigger_multiple 	so that all Competitive and Wingman CT spawns are inside it	not needed	
 {| class="standard-table" style="white-space:nowrap;"	Property Name	Value
Entity Scripts 	warmup/warmup_teleport.nut 	 	 	 	
Start Disabled 	Yes 	 	 	 	
Filter Name 	@warmup.filter_ct 	 	 	 	
Delay Before Reset	0 	 	 	 	
=== Required Entities - Arenas ===
The following is required for every individual arena.
To avoid VScript errors, there should be at least 5 arenas, which is also the maximum number of arenas that the scripts (currently) support.
==== Geometry and Detail ====
As a guideline: Valve uses room dimensions of about 512x1024x192 units for each arena. Still, it is possible to make them smaller or slightly larger.
The official maps use cover for both players, especially so that there is no direct line of sight between the two players' spawn points. The arenas are completely separated from the rest of the map, although they needn't.
==== Player Spawning Logic ====
The following entities are required for each arena.
The entity names must be exact because the scripts rely on them.
If you are done creating one arena and you want to copy-paste it, you have to make renaming changes to these entities, which is the adjustment of the yellow highlighted 1's.
Replace them by 2, 3, 4 and 5 accordingly.
Class 	Where? 	Name 	KeyValues	Outputs 	Comment
info_target 	place as CT spawn point, including orientation	arena1-ctspawn	 	 	The scripts will only call GetOrigin() and GetAngles() from these entities to teleport players to them, so one could use any entity for this purpose if it has a name, an origin and an orientation, e.g. info_player_start, however its keyvalue targetname for the Name must be added manually with SmartEdit turned off.
info_target 	place as T spawn point, including orientation 	arena1-tspawn 	 	 	The scripts will only call GetOrigin() and GetAngles() from these entities to teleport players to them, so one could use any entity for this purpose if it has a name, an origin and an orientation, e.g. info_player_start, however its keyvalue targetname for the Name must be added manually with SmartEdit turned off.
logic_script 	in the middle of the arena on the ground 	arena1-script 	
 {| class="standard-table" style="white-space:nowrap;"	Property Name	Value
Entity Scripts	warmup/warmup_arena.nut 	 	 	 	
Think Function	ArenaStart 	 	 	 	
EntityGroup[0]	arena1-trigger_ct 	 	 	 	
EntityGroup[1]	arena1-trigger_t 	 	 	 	
=== Testing and Debugging ===
] ent_fire logic_script runscriptcode "DebugInfo()"
===arena1 debug info: ===
Available T spawn = false
Available CT spawn = false
Current T player = ([9] player)
Current CT player = ([6] player)
===arena1 end debug info ===
===arena2 debug info: ===
Available T spawn = false
Available CT spawn = true
Current T player = ([5] player)
Current CT player = (null : 0x00000000)
===arena2 end debug info ===
===arena3 debug info: ===
Available T spawn = false
Available CT spawn = false
Current T player = ([2] player)
Current CT player = ([3] player)
===arena3 end debug info ===
===arena4 debug info: ===
Available T spawn = false
Available CT spawn = false
Current T player = ([4] player)
Current CT player = ([1] player)
===arena4 end debug info ===
===arena5 debug info: ===
Available T spawn = true
Available CT spawn = false
Current T player = (null : 0x00000000)
Current CT player = ([7] player)
===arena5 end debug info ===
To see if everything works correctly, you can open in the console and
* look for VScript errors.
* invoke and to visualize I/O.
* invoke and to see the states of each arena, as seen on the right. To avoid VScript error messages from other logic_scripts, you can also do "try {DebugInfo()} catch(ex) {}".
** The Available T/CT spawn should be false if there is a T/CT in the arena.
** The Current T/CT player should either be null if the corresponding spawn is available or a ([?] player) if not.
=== Modifying Gameplay ===
You cannot or should not manipulate the orignal scripts
* csgo/scripts/vscripts/warmup/warmup_arena.nut
* csgo/scripts/vscripts/warmup/warmup_teleport.nut,
but you can still change gameplay per map by e.g. copy-pasting these scripts and editing them or by firing RunScriptCode to the arena scripts or by writing an own VScript to change variables or functions in the arena scripts.
For example, you could create a logic_script in your map and set its Entity Scripts to a .nut file with the following content which will change the weapons, replace kevlar with kevlar + helmet and increase the weapon clearing radius.
Category:Counter-Strike: Global Offensive
Category:Level Design
Category:Tutorials