Counter-Strike: Global Offensive/Game Modes/Wingman: Difference between revisions
(Added Gamemode Description section, CFG difference table, 2v2 script file, WrongWay image, links, assorted some text.) |
m (→Scripting: Some spelling and changed code representation (ExpandBox -> collapsible table).) |
||
Line 5: | Line 5: | ||
Here, you can learn how to modify a competitive map for it, and how all of this works. | Here, you can learn how to modify a competitive map for it, and how all of this works. | ||
A map is | A map is launched in the Wingman game mode with the commands {{ent|game_type|0}}, {{ent|game_mode|2}} and <code>[[Map (ConCommand)|map]] <mapname></code>, or all in one: <code>map <mapname> scrimcomp2v2</code>. | ||
== | == Game Mode Description == | ||
{| class="standard-table" style="float:right;" | {| class="standard-table" style="float:right;" | ||
|+ Pivotal ([[CFG]]) differences | |+ Pivotal ([[CFG]]) differences | ||
Line 22: | Line 22: | ||
| Max Money || $16000 || $8000 | | Max Money || $16000 || $8000 | ||
|} | |} | ||
Technically, this | 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 [[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. | ||
Line 31: | Line 31: | ||
* There is one accessible [[func_bomb_target|bombsite]]. | * There is one accessible [[func_bomb_target|bombsite]]. | ||
== Adding Wingman | == Adding Wingman Support to a Map == | ||
Any competitive map can be modified to support Wingman in the same way as Cobblestone, Inferno, Overpass, Vertigo, Nuke and Train. | Any competitive map can be modified to support Wingman in the same way as Cobblestone, Inferno, Overpass, Vertigo, Nuke and Train. | ||
Line 39: | Line 39: | ||
This tutorial is for the case that you already have (or are planning to create) a map for one of the Classic game modes that shall also support the Wingman mode. | This tutorial is for the case that you already have (or are planning to create) a map for one of the Classic game modes that shall also support the Wingman mode. | ||
=== Used | === Used Entities === | ||
* A ''[[logic_auto]]'' | * A ''[[logic_auto]]'' | ||
Line 51: | Line 51: | ||
=== Scripting === | === Scripting === | ||
Our map must [[CSGO Game Mode Commands#Gamemode dependent Events|detect the current game mode]] and check if it is Wingman; To do that, we must use [[VScript]]ing. | Our map must [[CSGO Game Mode Commands#Gamemode dependent Events|detect the current game mode]] and check if it is Wingman; To do that, we must use [[VScript]]ing. | ||
Fortunately, Valve has already | Fortunately, Valve has already made a VScript that does that and made it available to any map, so you don't have to write any code. | ||
{ | {| class="wikitable mw-collapsible mw-collapsed" style="float:right; margin:1em;" | ||
<syntaxhighlight lang=cpp> | ! <code>csgo/scripts/vscripts/2v2/2v2_enable.nut</code> | ||
|- | |||
| <syntaxhighlight lang=cpp> | |||
// This function is called from the map OnMapSpawn | // This function is called from the map OnMapSpawn | ||
Line 86: | Line 88: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| | |} | ||
To run that script, create a ''[[logic_script]]'' entity in your map, and call it '''script.2v2'''. | To run that 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>. | ||
Line 94: | Line 95: | ||
This will change the entities in our level depending on the game mode we are on. Because of that, all of the following entity names are required to be exactly as listed here, otherwise it will not work. | This will change the entities in our level depending on the game mode we are on. Because of that, all of the following entity names are required to be exactly as listed here, otherwise it will not work. | ||
=== Spawn points and | === Spawn points and Buyzones === | ||
Here, we set the custom spawn points. | Here, we set the custom spawn points. | ||
Line 109: | Line 110: | ||
The standard buyzone will not be disabled by the script in Wingman, as it is either outside the playable area or unable to affect gameplay. | The standard buyzone will not be disabled by the script in Wingman, as it is either outside the playable area or unable to affect gameplay. | ||
=== Blocking the | === Blocking the Playable Area === | ||
[[Image:Toolswrongway.png|thumb|right|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.]] | [[Image:Toolswrongway.png|thumb|right|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.]] | ||
Line 122: | Line 123: | ||
Anyway, if you do everything right, it should be working. | Anyway, if you do everything right, it should be working. | ||
=== Blocking Navigation | === Blocking Navigation Meshes === | ||
You should use ''[[func_nav_blocker]]'' entities to stop [[bot]]s from trying to walk through the blockers in Wingman. | You should use ''[[func_nav_blocker]]'' entities to stop [[bot]]s from trying to walk through the blockers in Wingman. | ||
Line 129: | Line 130: | ||
The VScript will finally fire <code>BlockNav</code> to these entities in Wingman or <code>UnblockNav</code> in all other game modes. | The VScript will finally fire <code>BlockNav</code> to these entities in Wingman or <code>UnblockNav</code> in all other game modes. | ||
== Testing and | == Testing and Uploading == | ||
To play a map in Wingman mode, type in the commands {{ent|game_type|0}} and {{ent|game_mode|2}} into the console and then enter the <code>[[Map (ConCommand)|map]]</code> command to access your map. | To play a map in Wingman mode, type in the commands {{ent|game_type|0}} and {{ent|game_mode|2}} into the console and then enter the <code>[[Map (ConCommand)|map]]</code> command to access your map. |
Revision as of 08:02, 15 July 2021
Wingman is a game mode in 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 and map <mapname>
, or all in one: map <mapname> scrimcomp2v2
.
Game Mode Description
Property | Competitive | 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 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 CS:GO Game Mode Commands) and maxplayers.
Officially, the game mode plays as follows:
- Two teams of two people 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, Overpass, Vertigo, Nuke and Train. If these maps are launched in Wingman, the spawnpoints and buyzones are shifted if needed and there are blockers that limit the playable area to only one bombsite.
If you are designing your map to only work with Wingman, then you probably don't need this tutorial. This tutorial is for the case that you already have (or are planning to create) a map for one of the Classic game modes that shall also support the Wingman mode.
Used Entities
- A logic_auto
- A logic_script called script.2v2
- Default spawn points for both teams called spawnpoints.standard
- Wingman spawn points for both teams called spawnpoints.2v2
- func_buyzones called buyzone.2v2
- func_brushes called brush.blocker
- func_nav_blockers called navblocker.2v2
Scripting
Our map must detect the current game mode and check if it is Wingman; To do that, we must use VScripting. Fortunately, Valve has already made a VScript that does that and made it available to any map, so you don't have to write any code.
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);
}
}
|
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, create an output to OnMapSpawn
with the target entity script.2v2, via the output RunScriptCode
, with the parameter of EnableWingman()
.
This will change the entities in our level depending on the game mode we are on. Because of that, all of the following entity names are required to be exactly as listed here, otherwise it will not work.
Spawn points and Buyzones
Here, we set the custom spawn points. But before that, select all of 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 in Wingman, otherwise enable them.
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, just create another one for them, select the team and name it buyzone.2v2. Do the same for the other team. The standard buyzone will not be disabled by the script in Wingman, as it is either outside the playable area or unable to affect gameplay.
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.
The way to do this is by adding physical blockers in every hallway that leads to the other bombsite to block players from going there.
To do that, create some brushes in the places that you don't want the player to go with the tools/toolsclip texture.
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 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!
Anyway, if you do everything right, it should be working.
You should use func_nav_blocker entities to stop bots from trying to walk through the blockers in Wingman.
To do this, create brushes with the tools/toolstrigger
texture.
Then convert it to a func_nav_blocker entity and name it navblocker.2v2.
The VScript will finally fire BlockNav
to these entities in Wingman or UnblockNav
in all other game modes.
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!