Counter-Strike: Global Offensive/Game Modes/Wingman: Difference between revisions
m (Add link to translates of this tutorials) |
(Added Gamemode Description section, CFG difference table, 2v2 script file, WrongWay image, links, assorted some text.) |
||
Line 1: | Line 1: | ||
{{back|Counter-Strike: Global Offensive Level Creation}} | {{back|Counter-Strike: Global Offensive Level Creation}} | ||
{{Lang|Creating_a_Wingman_Map}}'''Wingman''' is a game mode in Counter-Strike: Global Offensive | {{Lang|Creating_a_Wingman_Map}}'''Wingman''' is a [[CSGO Game Mode Commands|game mode]] in {{csgo}} [[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 lanched 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>. | |||
== | == Gamemode Description == | ||
{| class="standard-table" style="float:right;" | |||
|+ Pivotal ([[CFG]]) differences | |||
! 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 gamemode 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 crucial differences are the game mode's [[CFG]] file (see [[CSGO Game Mode Commands#Game Type and Game Mode|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 [[func_bomb_target|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_buyzone]]s'' called '''buyzone.2v2''' | |||
* ''[[func_brush]]es'' called '''brush.blocker''' | |||
* ''[[func_nav_blocker]]s'' called '''navblocker.2v2''' | |||
=== Scripting === | === Scripting === | ||
Our map must detect | 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 make a VScript that does that and made it available to any map, so you don't have to write any code. | |||
{{ExpandBox| side=right | | |||
<syntaxhighlight lang=cpp> | |||
// 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> | |||
| <code>csgo/scripts/vscripts/2v2/2v2_enable.nut</code> | |||
}} | |||
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>. | |||
Then make a ''[[logic_auto]]'' and in the Outputs tab, create an output to <code>OnMapSpawn</code> with the target entity '''script.2v2''', via the output <code>RunScriptCode</code>, with the parameter of <code>EnableWingman()</code>. | |||
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. | ||
Line 26: | Line 96: | ||
=== Spawn points and buyzones === | === Spawn points and buyzones === | ||
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 | Here, we set the custom spawn points. | ||
But before that, 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. | |||
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 | 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>. | |||
If these spawns are not already inside of a buyzone, just create | If these spawns are not already inside of a [[func_buyzone|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 | === Blocking the playable area === | ||
The game can work as it is now, but you will probably want | [[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.]] | ||
The game can work as it is now, but you will probably want only one [[func_bomb_target|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 [[player]]s 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_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. | |||
You can even use the cool | You can even use the cool <code>tools/wrongway</code> 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. | Anyway, if you do everything right, it should be working. | ||
=== Blocking Navigation meshes === | === Blocking Navigation meshes === | ||
You | You should use ''[[func_nav_blocker]]'' entities to stop [[bot]]s from trying to walk through the blockers in Wingman. | ||
To do this, create brushes with the <code>tools/toolstrigger</code> texture. | |||
Then convert it to a ''[[func_nav_blocker]]'' entity and name it '''navblocker.2v2'''. | |||
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 == | |||
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. | |||
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! | 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! | |||
[[Category: Counter-Strike: Global Offensive]][[Category: Level Design]][[Category: Tutorials]] | [[Category: Counter-Strike: Global Offensive]][[Category: Level Design]][[Category: Tutorials]] |
Revision as of 08:55, 18 April 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 lanched in the Wingman game mode with the commands game_type 0, game_mode 2 and map <mapname>
, or all in one: map <mapname> scrimcomp2v2
.
Gamemode 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 gamemode 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 make 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!