Setting up 1v1 Warmup Arenas
This is the documentation of a way to use the VScripts
that are designed for the management of 1v1 warmup arenas in Counter-Strike: Global Offensive.
The implementation described below equals the one of de_vertigo (2021-05-05).
Officially, the 1v1 warmup plays as follows:
- It is only active during warmup of the game modes Competitive and Wingman, i.e. if
game_typeis 0 and
game_modeis 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 Deathmatch.
- Both players are get 100 HP, kevlar (no helmet), their knife and a randomly chosen weapon from a hard-coded list inside
- 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.
- In Competitive, 5 arenas are used. In Wingman, only 2 arenas are regarded.
This section covers the requirements to a map to additionally support 1v1 warmup arenas.
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.nuthandles the assignment of players to the arenas.
- Each of the 5 arenas has a logic_script with the VScript
warmup/warmup_arena.nutkeeping track of its current players.
- In each arena there are two trigger_multiples inside each other with different team filters filling the entire arena. These are always testing if a (Counter-)Terrorist is in the arena and locks or unlocks the arena for other players.
Required Entities - General
These entities are required once in the map.
|trigger_multiple||so that all Competitive and Wingman CT spawns are inside it||not needed||
Tip: One can create two unique trigger brushes for Competitive and Wingman spawns of a team, select both and hit trigger_multiple.+ to tie them to a single
|trigger_multiple||so that all Competitive and Wingman T spawns are inside it||not needed||
|The previous and the following triggers rely on these, because the scripts must differentiate between Terrorists and Counter-Terrorists.|
|This is used to clear the weapons of (re-)spawning players before they are equipped by an arena script.|
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 as 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.
To keep the renaming work at a minimum, make an instance only with the following five arena specific entities.
- Inside this instance, omit the prefix "arenaX-" (including the dash) wherever it appears.
- In the actual map, place a func_instance inside an arena, select the VMF and set the Fix Up Name (the named entities' prefix) to arena1, ..., arena5. The previously omitted dash will be added automatically.
- Make sure that the trigger dimensions (see below) fill the entire playable area of each arena. This can be ensured by adding clip brushes to the instance around the triggers.
|info_target||place as CT spawn point, including orientation||arena1-ctspawn||The scripts will only call |
|info_target||place as T spawn point, including orientation||arena1-tspawn|
|logic_script||in the middle of the arena on the ground||arena1-script||
|This entity should be placed in the center of the arena on the ground due to the weapon clearing radius of 640 units around it.|
The Think function fires the input
|trigger_multiple||fills the entire playable area of the arena||arena1-trigger_ct||
Tip: As these are two brushes with identical dimensions, use hide and unhide one of them, to make selecting the other easier. and in Hammer toThe functions
|trigger_multiple||fills the entire playable area of the arena||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 = ( player) Current CT player = ( player) ===arena1 end debug info === ===arena2 debug info: === Available T spawn = false Available CT spawn = true Current T player = ( player) Current CT player = (null : 0x00000000) ===arena2 end debug info === ===arena3 debug info: === Available T spawn = false Available CT spawn = false Current T player = ( player) Current CT player = ( player) ===arena3 end debug info === ===arena4 debug info: === Available T spawn = false Available CT spawn = false Current T player = ( player) Current CT player = ( player) ===arena4 end debug info === ===arena5 debug info: === Available T spawn = true Available CT spawn = false Current T player = (null : 0x00000000) Current CT player = ( player) ===arena5 end debug info ===
To see if everything works correctly, you can open in the console and
- look for VScript errors.
ent_messages_draw 1to visualize I/O.
ent_fire logic_script runscriptcode "DebugInfo()"to see the states of each arena, as seen on the right.
Available T/CT spawnshould be
falseif there is a T/CT in the arena.
Current T/CT playershould either be
nullif the corresponding spawn is available or a player if not.
You cannot or should not manipulate the orignal scripts
but you can still change gameplay per map by either 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.