Counter-Strike: Global Offensive/Game Modes/Wingman: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "'''Wingman''' is a game mode in Counter-Strike: Global Offensive where two team of 2 people play a match in a competitive environment, with shorter round times and only one bo...")
 
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
 
(18 intermediate revisions by 12 users not shown)
Line 1: Line 1:
'''Wingman''' is a game mode in Counter-Strike: Global Offensive where two team of 2 people play a match in a competitive environment, with shorter round times and only one bombsite. Here, you can learn how to make a map for it, and how all of this works.
{{Lang|Counter-Strike: Global Offensive/Game Modes/Wingman}}
{{back|Counter-Strike: Global Offensive Level Creation}}{{Delisted|csgo}}
[[File:Csgo icon wingman.png|left|link=]]
'''Wingman''' (internally: <tt>'''scrimcomp2v2'''</tt>) is a [[CS:GO Game Modes|game mode]] in {{csgo|4}}.


Wingman is not a simple CFG file – it is a real official game mode. That means that you can have a completely normal map AND support Wingman at the same time, as it happens with the official Cobblestone, Inferno and Overpass. Because of that, the map itself has to allow for this kind of thing. You can't 'enable' Wingman in any map that hasn't already followed the process described in this tutorial already.
Here, you can learn how to modify a Competitive map for it, and how all of this works.


This tutorial is only really applicable already have (or is planning to do) a map that is made for the Classic game mode, but wants to also support the Wingman mode. If you are designing your map to only work with Wingman, then you probably don't need this tutorial.
A map is launched in the Wingman game mode with the commands <code>game_type 0; game_mode 2; [[map (console command)|map]] <mapname></code>, or shorter: <code>map <mapname> scrimcomp2v2</code>.
{{clr}}
__TOC__


== Used entities ==
== Game Mode Description ==
{| class="standard-table" style="float:right;"
|+ Pivotal ([[CFG]]) differences
! Property !! {{csgo mode|comp}} Competitive !! {{csgo mode|wingman}} Wingman
|-
| ''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 {{csgo mode|Competitive}} game mode.
The round ending events are equal, meaning that this game mode can be played with [[func_bomb_target|bombsites]], [[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]].


* A ''logic_auto''
Officially, the game mode plays as follows:
* A ''logic_script'' called '''script.2v2'''
* Two teams of two [[player]]s play a match in a competitive environment.
* Spawn points for both teams called '''spawnpoints.standard'''
* There is one accessible [[func_bomb_target|bombsite]].
* Spawn points for both teams called '''spawnpoints.2v2'''
* ''func_buyzone''s called '''buyzone.2v2'''
* ''func_brush''es called '''brush.blocker'''


== Creating the map ==
== Adding Wingman Support to a Map ==
 
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.
 
The following sections are about how mapmakers can reproduce this.
 
{{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.}}


=== Scripting ===
=== Scripting ===
Our map must detect if the current game mode of the match is Wingman; to do that, we must use VScripting. However, Valve has already make a script that does that and made it available to any map, so you don't have to worry about that. To run that 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'', and in the Outputs tab, set the output to "OnMapSpawn", the target entity to "script.2v2", via the output "RunScriptCode", with the parameter of "EnableWingman()".
{| class="wikitable mw-collapsible mw-collapsed" style="float:right; margin:1em; background-color:transparent"
! <code>csgo/scripts/vscripts/2v2/2v2_enable.nut</code>
|-
|
<syntaxhighlight lang=cpp highlight=22>
// 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);
}
 
}
</syntaxhighlight>
{{bug|hidetested=1|The highlighted line doesn't have the intended effect, because <code>SetEnabled</code> is not a valid input for [[func_buyzone]].}}
|}
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 everyone, 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 [[CS:GO Map Publish Tool|publishing]]!}}
 
To run this script, create a {{ent|logic_script}} entity in your map, and give it the [[targetname]] '''script.2v2''' (arbitrary).
Set its <code>Entity Scripts</code> property to <code>2v2/2v2_enable.nut</code>.
 
Then create a {{ent|logic_auto}} with the following [[output]]:
{| {{OutputsTable|sortable=0}}
| [[File:io11.png|link=]] || OnMapSpawn || script.2v2 || RunScriptCode || EnableWingman() || 0 || No
|}
 
Every round, this will run the <code>EnableWingman</code> function which fires [[I/O]] events to some named entities in our level depending on the current game mode.
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 [[info_player_counterterrorist|CT and T]], and change their names to '''spawnpoints.standard'''. The script will deactivate these in Wingman.


This will change the entities in our level depending on the game mode we are on. Because of that, all the following entity names are required to be exactly as it is here, otherwise it may not work.
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 <code>Enable by default?</code> to <code>No</code>.


=== Spawn points and buyzones ===
If these spawns are not already inside of a {{ent|func_buyzone}}, create one for them, select the team and name it '''buyzone.2v2'''. Do the same for the other team.
{{bug|hidetested=1|
Set all buyzones to start enabled! In Valve's script, <code>EnableWingman()</code> does never enable any buyzone in any game mode because <code>"SetEnabled"</code> (which is used in that script) is not a valid input for <tt>func_buyzone</tt>. The script is still useful though, as it <tt>Disable</tt>s the Wingman buyzone when needed.
Also, the script does not disable the standard buyzones in Wingman for the case that no spawn shifting is done. If this is an issue, write your own script and fix this or find a different solution.
}}


Here, we set the custom spawn points. But before that, select all the normal spawn points (both CT and T) that are going to be used in the normal Classic mode. Change their names to '''spawnpoints.standard'''. The script will deactivate these when needed.
=== Blocking the Playable Area ===


Now, create at least 2 spawn points for each team – those are going to be used in Wingman. In the official Valve maps, they use 4 for each team, so it's probably better to use that. Select them all and name them '''spawnpoints.2v2''', and set "Enable by default?" to No.  
[[File: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.


If these spawns are not already inside of a buyzone, just create a brush, convert it into an entity (Ctrl+T), and choose ''func_buyzone''. Select the team, name it '''buyzone.2v2'''. Do the same things for the other team. You don't have to do anything to the standard buyzone, since it will already be outside the play area anyway.
To do that, create some [[clip texture|clip brush]]es with the <code>tools/toolsclip</code> texture in the places that you don't want the [[player]]s to go. Tie them to {{ent|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.


=== Blocking the play area ===
You can even make more of those and use the cool <code>tools/wrongway</code> texture to signalize to players that there is an invisible wall. It even fades out with distance! For these brushes, it is good practice to set their <code>Solidity</code> to <code>Never Solid</code> if they are already inside a larger '''brush.blocker''' because then their collision is not needed.


The game can work as it is now, but you will probably want so that you can only go to one bombsite. The way to do this is by adding physical blocks in every hallway that leads to the other bombsite to block people from going there. To do that, create some brushes in the places that you don't want to player to go with the ''tools/toolsclip'' texture. Convert then to a ''func_brush'' and name them '''brush.blocker'''. Set "Start disabled" to Yes and the script will do the work for you.
=== Blocking Navigation Meshes ===


You can even use the cool ''tools/wrongway'' texture on that to signalize to players that they can't go through that invisible wall. It even fades out with distance!
Now the '''brush.blocker'''s will do a great job on blocking players, however, [[bot]]s might still try to walk through the blockers.


Anyway, if you do everything right, it should be working.  
Create {{ent|func_nav_blocker}} brush entities inside the '''brush.blocker'''s with the <tt>tools/toolstrigger</tt> texture and name them '''navblocker.2v2'''.
The VScript will finally fire <tt>BlockNav</tt> to these entities in Wingman or <tt>UnblockNav</tt> in all other game modes, informing the bots whether the area is blocked or not.
{{tip|If bots keep trying to walk through the blockers, then the <tt>func_nav_blocker</tt> might not be blocking the [[Nav Mesh]] areas of interest. 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.}}


== Testing the map ==
== Testing and Uploading ==


Sadly, Valve hasn't yet officially implemented Wingman with the maps in the workshop. That means that, to play the map, you and the players have to write these commands into the console:
To play a map in Wingman mode, type in the commands <tt>[[game_type]] 0; game_mode 2</tt> into the console and then enter the <tt>[[map (console command)|map]]</tt> command to access your map.


<code>game_type 0; game_mode 2;</code>
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!


And then enter the <code>map</code> command to access your map. Done!
{{csgo-navbox}}
[[Category: Counter-Strike: Global Offensive]]
[[Category: Level Design]]
[[Category: Tutorials]]

Latest revision as of 07:17, 20 May 2025

English (en)Deutsch (de)Русский (ru)Translate (Translate)
Counter-Strike: Global Offensive Level Creation
Icon-delisted.png
This page documents information about a game or software, Counter-Strike: Global Offensive Counter-Strike: Global Offensive, that is no longer available for purchase or download digitally.
It is covered here for historical and technical reference.
Csgo icon wingman.png

Wingman (internally: scrimcomp2v2) is a game mode in Counter-Strike: Global Offensive Counter-Strike: Global Offensive.

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; map <mapname>, or shorter: map <mapname> scrimcomp2v2.

Game Mode Description

Pivotal (CFG) differences
Property CS:GO/CS2 Competitive Competitive CS:GO/CS2 Wingman Wingman
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 CS:GO/CS2 Competitive Competitive game mode. The round ending events are equal, meaning that this game mode can be played with bombsites, 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 CS:GO/CS2 Competitive Competitive map can be modified to support CS:GO/CS2 Wingman 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.

The following sections are about how mapmakers can reproduce this.

Icon-Important.pngImportant: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.pngNote: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.

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);
	}
  
 }
Icon-Bug.pngBug:The highlighted line doesn't have the intended effect, because SetEnabled is not a valid input for func_buyzone.

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 everyone, so you don't have to write any code.

Note.pngNote:Making an own script is also an option; but don't forget to pack custom scripts to the map when publishing!

To run this script, create a logic_script entity in your map, and give it the targetname script.2v2 (arbitrary). Set its Entity Scripts property to 2v2/2v2_enable.nut.

Then create a logic_auto with the following output:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn script.2v2 RunScriptCode EnableWingman() 0 No

Every round, this will run the EnableWingman function which fires I/O events to some named entities in our level depending on the current game mode. 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, 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 func_buyzone, create one for them, select the team and name it buyzone.2v2. Do the same for the other team.

Icon-Bug.pngBug:

Set all buyzones to start enabled! In Valve's script, EnableWingman() does never enable any buyzone in any game mode because "SetEnabled" (which is used in that script) is not a valid input for func_buyzone. The script is still useful though, as it Disables the Wingman buyzone when needed. Also, the script does not disable the standard buyzones in Wingman for the case that no spawn shifting is done. If this is an issue, write your own script and fix this or find a different solution.

Blocking the Playable Area

The 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. Tie 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 there is an invisible wall. It even fades out with distance! For these brushes, it is good practice to set their Solidity to Never Solid if they are already inside a larger brush.blocker because then their collision is not needed.

Blocking Navigation Meshes

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 the area is blocked or not.

Tip.pngTip:If bots keep trying to walk through the blockers, then the func_nav_blocker might not be blocking the Nav Mesh areas of interest. For visualization, use the cheat nav_edit 1. Areas blocked by nav blockers are marked with a cyan rectangle along its border.

Testing and Uploading

To play a map in Wingman mode, type in the commands game_type 0; 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!