Counter-Strike: Global Offensive/Game Modes/Wingman: Difference between revisions
(Moved lang template to top. Added icon. Internal name. Colorful game link.) |
(Rewording. Preparing to move page (Lang).) |
||
Line 1: | Line 1: | ||
{{Lang| | {{Lang|CS:GO Game Modes/Wingman}} | ||
{{back|Counter-Strike: Global Offensive Level Creation}} | {{back|Counter-Strike: Global Offensive Level Creation}} | ||
[[File:Csgo icon wingman.png|left]] | [[File:Csgo icon wingman.png|left|link=]] | ||
'''Wingman''' (internally: <code>'''scrimcomp2v2'''</code>) is a [[game mode]] in {{game name|csgo|name=Counter-Strike: Global Offensive}}. | '''Wingman''' (internally: <code>'''scrimcomp2v2'''</code>) is a [[game mode]] in {{game name|csgo|name=Counter-Strike: Global Offensive}}. | ||
Line 13: | Line 13: | ||
{| class="standard-table" style="float:right;" | {| class="standard-table" style="float:right;" | ||
|+ Pivotal ([[CFG]]) differences | |+ Pivotal ([[CFG]]) differences | ||
! Property !! Competitive !! Wingman | ! Property !! {{csgo mode|comp}} Competitive !! {{csgo mode|wingman}} Wingman | ||
|- | |- | ||
| ''Players per team'' || 5 || 2 | | ''Players per team'' || 5 || 2 | ||
Line 25: | Line 25: | ||
| Max Money || $16000 || $8000 | | Max Money || $16000 || $8000 | ||
|} | |} | ||
Technically, this game mode is almost equal to the | Technically, this game mode is almost equal to the {{csgo mode|Competitive}} game mode. | ||
The round ending events are equal, meaning that this game mode can be played with [[func_bomb_target|bomb sites]], [[hostage_entity|hostages]] or none of them. | The round ending events are equal, meaning that this game mode can be played with [[func_bomb_target|bomb sites]], [[hostage_entity|hostages]] or none of them. | ||
The crucial differences are the game mode's [[CFG]] file (see the table on the right) and [[maxplayers]]. | |||
The crucial differences are the game mode's [[CFG]] file (see | |||
Officially, the game mode plays as follows: | Officially, the game mode plays as follows: | ||
Line 36: | Line 35: | ||
== Adding Wingman Support to a Map == | == Adding Wingman Support to a Map == | ||
Any | Any {{csgo mode|Comp}} map can be modified to support {{csgo mode|Wingman}} in the same way as Cobblestone, Inferno, Nuke, Overpass, Vertigo and Train. | ||
These maps are actually too large for Wingman, but if they are launched in Wingman, the spawn points and buyzones are "shifted" if needed and there are blockers that limit the playable area to only one bombsite. | |||
How this can be done is explained in the following sections. | |||
{{important|If you are designing your map for Wingman such that no spawn shifting or blocking needs to be done, then you don't need this tutorial.}} | |||
{{note|''de_nuke'' doesn't actually support Wingman, instead Valve uses a different map, ''de_shortnuke'' which is literally half of ''de_nuke'', only consisting of the interior parts for bombsite B, which saves resources.}} | |||
=== Scripting === | === Scripting === | ||
{| class="wikitable mw-collapsible mw-collapsed" style="float:right; margin:1em; background-color:transparent" | |||
{| class="wikitable mw-collapsible mw-collapsed" style="float:right; margin:1em;" | |||
! <code>csgo/scripts/vscripts/2v2/2v2_enable.nut</code> | ! <code>csgo/scripts/vscripts/2v2/2v2_enable.nut</code> | ||
|- | |- | ||
| <syntaxhighlight lang=cpp> | | | ||
<syntaxhighlight lang=cpp highlight=22> | |||
// This function is called from the map OnMapSpawn | // This function is called from the map OnMapSpawn | ||
Line 91: | Line 80: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{bug|The highlighted line doesn't have the intended effect, because <code>SetEnabled</code> is not a valid input for [[func_buyzone]].}} | |||
|} | |} | ||
To run | To shift spawn points or block areas '''only''' in Wingman, our map must [[CS:GO Game Modes#Game Mode dependent Events|detect the current game mode]] which requires [[VScript]]ing. | ||
Fortunately, Valve has already made a VScript that does that (seen on the right) and made it available to any map, so you don't have to write any code. | |||
{{note|Making an own script is also an option; but don't forget to pack custom scripts to the map when [[CSGO Map Publish Tool|publishing]]!}} | |||
To run this script, create a ''[[logic_script]]'' entity in your map, and call it '''script.2v2'''. | |||
Set the <code>Entity Scripts</code> property to <code>2v2/2v2_enable.nut</code>. | Set the <code>Entity Scripts</code> property to <code>2v2/2v2_enable.nut</code>. | ||
Then make a ''[[logic_auto]]'' with the following [[output]]: | |||
{| {{OutputsTable|sortable=0}} | |||
| [[Image:io11.png]] || OnMapSpawn || script.2v2 || RunScriptCode || EnableWingman() || 0 || No | |||
|} | |||
Every round, this will run the <code>EnableWingman</code> function which fires [[I/O]] events to named entities in our level depending on the game mode we are on. | |||
That's why all of the following entity names are required to be exactly as in the above VScript, otherwise it will not work. | |||
=== Spawn points and Buyzones === | === Spawn points and Buyzones === | ||
First, select all of the normal spawn points (both [[info_player_counterterrorist|CT]] and [[info_player_terrorist|T]]) that are going to be used in the normal Classic mode and change their names to '''spawnpoints.standard'''. The script will deactivate these in Wingman. | |||
The script will deactivate these in Wingman | |||
Now, create at least two spawn points for each team that should be used in Wingman. | Now, create at least two spawn points for each team that should be used in Wingman. | ||
Line 109: | Line 105: | ||
Select them all, name them '''spawnpoints.2v2''' and set <code>Enable by default?</code> to <code>No</code>. | Select them all, name them '''spawnpoints.2v2''' and set <code>Enable by default?</code> to <code>No</code>. | ||
If these spawns are not already inside of a [[func_buyzone|buyzone]], | If these spawns are not already inside of a [[func_buyzone|buyzone]], create one for them, select the team and name it '''buyzone.2v2'''. Do the same for the other team. | ||
Do the same for the other team. | {{bug| | ||
The | Set all buyzones to start enabled! In Valve's script, <code>EnableWingman()</code> does never enable any buyzone in all game modes because <code>"SetEnabled"</code> is not a valid input for [[func_buyzone]]. The script is still useful though, as it <code>Disable</code>s the Wingman buyzone when needed. | ||
Also, the script does not disable the standard buyzones in Wingman, as they are assumed to be outside the playable area. If this is an issue, write your own script and fix this or find a different solution. | |||
}} | |||
=== Blocking the Playable Area === | === Blocking the Playable Area === | ||
[[Image:Toolswrongway.png|thumb | [[Image:Toolswrongway.png|thumb|192px|The <code>tools/wrongway</code> [[tool texture]] is only visible to players close to the origin of the entity that this material is applied to.]] | ||
The game can work as it is now, but you will probably want only one [[func_bomb_target|bombsite]] to be reachable. | The game can work as it is now, but you will probably want only one [[func_bomb_target|bombsite]] to be reachable. | ||
To do that, create some [[clip brush]]es with the ''tools/toolsclip'' texture in the places that you don't want the [[player]]s to go. | |||
Convert them to ''[[func_brush]]es'' and name them '''brush.blocker'''. | Convert them to ''[[func_brush]]es'' and name them '''brush.blocker'''. | ||
Set <code>Start disabled</code> to <code>Yes</code> and the script will enable them only in Wingman. | Set <code>Start disabled</code> to <code>Yes</code> and the script will enable them only in Wingman. | ||
You can even use the cool <code>tools/wrongway</code> texture | You can even make more of those and use the cool <code>tools/wrongway</code> texture to signalize to players that they can't go through that invisible wall. It even fades out with distance! For these brushes, you usually want to set their <code>Solidity</code> to <code>Never Solid</code> if they are already inside a larger '''brush.blocker''' because neither is their collision needed nor should it cause problems. | ||
=== Blocking Navigation Meshes === | |||
Now the '''brush.blocker'''s will do a great job on blocking players, however, [[bot]]s might still try to walk through the blockers. | |||
Create ''[[func_nav_blocker]]'' brush entities inside the '''brush.blocker'''s with the <code>tools/toolstrigger</code> texture and name them '''navblocker.2v2'''. | |||
The VScript will finally fire <code>BlockNav</code> to these entities in Wingman or <code>UnblockNav</code> in all other game modes, informing the bots whether they area is blocked or not. | |||
{{tip|If bots keep trying to walk through the blockers, then the ''func_nav_blocker'' might be too narrow and is not blocking any [[Nav Mesh]] areas. For visualization, use the cheat {{ent|nav_edit|1}}. Areas blocked by nav blockers are [[Nav Mesh Editing#Area Attributes|marked]] with a <span style{{=}}color:cyan>cyan rectangle</span> along its border.}} | |||
The VScript will finally fire <code>BlockNav</code> to these entities in Wingman or <code>UnblockNav</code> in all other game modes. | |||
== Testing and Uploading == | == Testing and Uploading == | ||
Line 140: | Line 136: | ||
Done! | Done! | ||
[[Category: Counter-Strike: Global Offensive]][[Category: Level Design]][[Category: Tutorials]] | [[Category: Counter-Strike: Global Offensive]] | ||
[[Category: Level Design]] | |||
[[Category: Tutorials]] |
Revision as of 20:12, 18 February 2022

Wingman (internally: scrimcomp2v2
) is a game mode in Template:Game name.
Here, you can learn how to modify a competitive map for it, and how all of this works.
A map is launched in the Wingman game mode with the commands game_type 0, game_mode 2 and map <mapname>
, or all in one: map <mapname> scrimcomp2v2
.
Game Mode Description
Property | ![]() |
![]() |
---|---|---|
Players per team | 5 | 2 |
Best of | 30 | 16 |
Roundtime in minutes | 1:55 | 1:30 |
Freezetime in seconds | 15 | 10 |
Max Money | $16000 | $8000 |
Technically, this game mode is almost equal to the Competitive game mode.
The round ending events are equal, meaning that this game mode can be played with bomb sites, hostages or none of them.
The crucial differences are the game mode's CFG file (see the table on the right) and maxplayers.
Officially, the game mode plays as follows:
- Two teams of two players play a match in a competitive environment.
- There is one accessible bombsite.
Adding Wingman Support to a Map
Any Competitive map can be modified to support
Wingman in the same way as Cobblestone, Inferno, Nuke, Overpass, Vertigo and Train.
These maps are actually too large for Wingman, but if they are launched in Wingman, the spawn points and buyzones are "shifted" if needed and there are blockers that limit the playable area to only one bombsite.
How this can be done is explained in the following sections.


Scripting
csgo/scripts/vscripts/2v2/2v2_enable.nut
|
---|
// This function is called from the map OnMapSpawn
function EnableWingman()
{
// checks the game mode and type and the current match
local nMode = ScriptGetGameMode();
local nType = ScriptGetGameType();
// type 0, mode 0 = casual
// type 0, mode 1 = competitive
// type 1, mode 0 = arms race
// type 1, mode 1 = demolition
// type 1, mode 2 = deathmatch
// etc
if (nMode == 2 && nType == 0) // if we are running 2v2, do stuff
{
EntFire("spawnpoints.standard", "SetDisabled", 0, 0);
EntFire("spawnpoints.2v2", "SetEnabled", 0, 0);
EntFire("brush.blocker", "Enable", 0, 0);
EntFire("buyzone.2v2", "SetEnabled", 0, 0);
EntFire("navblocker.2v2", "BlockNav", 0, 0);
}
else
{
EntFire("buyzone.2v2", "Disable", 0, 0); // disable 2v2 buyzones
EntFire("navblocker.2v2", "UnblockNav", 0, 0);
}
}
![]() SetEnabled is not a valid input for func_buyzone. [todo tested in ?] |
To shift spawn points or block areas only in Wingman, our map must detect the current game mode which requires VScripting. Fortunately, Valve has already made a VScript that does that (seen on the right) and made it available to any map, so you don't have to write any code.

To run this script, create a logic_script entity in your map, and call it script.2v2.
Set the Entity Scripts
property to 2v2/2v2_enable.nut
.
Then make a logic_auto with the following output:
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
![]() |
OnMapSpawn | script.2v2 | RunScriptCode | EnableWingman() | 0 | No |
Every round, this will run the EnableWingman
function which fires I/O events to named entities in our level depending on the game mode we are on.
That's why all of the following entity names are required to be exactly as in the above VScript, otherwise it will not work.
Spawn points and Buyzones
First, select all of the normal spawn points (both CT and T) that are going to be used in the normal Classic mode and change their names to spawnpoints.standard. The script will deactivate these in Wingman.
Now, create at least two spawn points for each team that should be used in Wingman.
In the official Valve maps, they use 4 for each team.
Select them all, name them spawnpoints.2v2 and set Enable by default?
to No
.
If these spawns are not already inside of a buyzone, create one for them, select the team and name it buyzone.2v2. Do the same for the other team.

Set all buyzones to start enabled! In Valve's script, EnableWingman()
does never enable any buyzone in all game modes because "SetEnabled"
is not a valid input for func_buyzone. The script is still useful though, as it Disable
s the Wingman buyzone when needed.
Also, the script does not disable the standard buyzones in Wingman, as they are assumed to be outside the playable area. If this is an issue, write your own script and fix this or find a different solution.
Blocking the Playable Area

tools/wrongway
tool texture is only visible to players close to the origin of the entity that this material is applied to.The game can work as it is now, but you will probably want only one bombsite to be reachable.
To do that, create some clip brushes with the tools/toolsclip texture in the places that you don't want the players to go.
Convert them to func_brushes and name them brush.blocker.
Set Start disabled
to Yes
and the script will enable them only in Wingman.
You can even make more of those and use the cool tools/wrongway
texture to signalize to players that they can't go through that invisible wall. It even fades out with distance! For these brushes, you usually want to set their Solidity
to Never Solid
if they are already inside a larger brush.blocker because neither is their collision needed nor should it cause problems.
Now the brush.blockers will do a great job on blocking players, however, bots might still try to walk through the blockers.
Create func_nav_blocker brush entities inside the brush.blockers with the tools/toolstrigger
texture and name them navblocker.2v2.
The VScript will finally fire BlockNav
to these entities in Wingman or UnblockNav
in all other game modes, informing the bots whether they area is blocked or not.

Testing and Uploading
To play a map in Wingman mode, type in the commands game_type 0 and game_mode 2 into the console and then enter the map
command to access your map.
When you upload the map to the workshop, be sure to select "Wingman" in the list of game modes so that people can select that when they open the map through the in-game workshop tab. Done!