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

From Valve Developer Community
Jump to navigation Jump to search
m (Fixed bolding)
(info_armsrace_terrorist and info_armsrace_counterterrorist are not unused by the game. Investigated.)
Line 2: Line 2:
|zh-cn=Creating a Arsenal: Arms Race Map:zh-cn
|zh-cn=Creating a Arsenal: Arms Race Map:zh-cn
}}
}}
The '''Arsenal: Arms Race''' game mode is a single extended round with instant respawn. Players start with an SMG, and progress to different weapons as they get kills. The progression of unlocked weapons ends with the golden knife. The first player to get a kill with every weapon wins the match.
The '''Arsenal: Arms Race''' game mode is a single extended round with instant respawn. Players start with an SMG, and progress to different weapons as they get kills. The progression of unlocked weapons ends with the golden knife. The first player to get a kill the last weapon wins the match.
 


The only required entities for a map to work in Arms Race are spawn points for each team.
The only required entities for a map to work in Arms Race are spawn points for each team.


==Spawn points==
==Spawn points==
Arms Race uses the normal [[info_player_counterterrorist]] and [[info_player_terrorist]] entities to decide where to spawn players. You should aim to include at least 16 spawn points for each team, so your map will run smoothly with up to 32 players on a server.
Arms Race uses the normal [[info_player_counterterrorist]] and [[info_player_terrorist]] as well as the [[info_armsrace_terrorist]] and [[info_armsrace_counterterrorist]] entities as player spawns. The spawn priorities of all of these are ignored in Arms Race, so a terrorist will always spawn at a randomly chosen spawnpoint from all existing [[info_player_terrorist]]s and [[info_armsrace_terrorist]]s.
{{warning|The [[info_armsrace_terrorist]] and [[info_armsrace_counterterrorist]] entities are unused, and do not function as spawn points in Arms Race or any other game mode.}}
 
{{Tip|You should aim to include at least 16 spawn points for each team, so your map will run smoothly with up to 32 players on a server.}}
 
{{Placement Tip|Since Arms Race maps use deathmatch-style spawn mechanics, the placement of spawn points doesn't matter much; however, to keep your map simple and easy to understand, you'll probably want to cluster the spawn points together in areas, usually one for each team.}}
 
===Disabling default spawns using VScript===


If you want to use the [[info_armsrace_terrorist]] and [[info_armsrace_counterterrorist]] spawns exclusively, the other must be disabled. One way to disable all [[info_player_counterterrorist]] and [[info_player_terrorist]] spawns '''''only for Arms Race''''' is writing a [[VScript]] with something like:
<source lang=cpp>
TYPE <- ScriptGetGameType()
MODE <- ScriptGetGameMode()


Since Arms Race maps use deathmatch-style spawn mechanics, the placement of spawn points doesn't matter much; however, to keep your map simple and easy to understand, you'll probably want to cluster the spawn points together in areas, usually one for each team.
if (TYPE == 1 && MODE == 0) // Arms Race uses game_type == 1 and game_mode == 0
{
EntFire("info_player_terrorist", "SetDisabled", "", 0)
EntFire("info_player_counterterrorist", "SetDisabled", "", 0)
}
else
{
EntFire("info_player_terrorist", "SetEnabled", "", 0)
EntFire("info_player_counterterrorist", "SetEnabled", "", 0)
}
</source>
Give this text file a name and save it with the <code>.nut</code> extension, for example <code>mapname.nut</code> and put it either directly into <code>csgo/scripts/vscripts/</code> or in a (new) subdirectory from there. Place a [[logic_script]] in your level and add the previous script to its Entity Scripts. Check the console when running the map to see if something goes wrong. When publishing the map, this script must also be packed (see e.g. [[VIDE]]).


==Testing your map==
==Testing your map==
The Arms Race game mode is selected by setting the server-side connvar <code>game_type</code> to 1. To properly test your Arms Race map, include <code>+game_type 1</code> in the launch options before compiling and running the map.
The map is launched in the Arms Race gamemode by first setting the server-side [[ConVar]]s <code>game_type</code> to 1 and <code>game_mode</code> to 0 and then running the map using the <code>[[map]]</code> or <code>[[changelevel]]</code> command. See [[CSGO Game Mode Commands]] for details and tips.


[[Category:Counter-Strike: Global Offensive]]
[[Category:Counter-Strike: Global Offensive]]
[[Category:Level Design Tutorials]]
[[Category:Level Design Tutorials]]

Revision as of 10:59, 3 January 2021

Template:Otherlang2 The Arsenal: Arms Race game mode is a single extended round with instant respawn. Players start with an SMG, and progress to different weapons as they get kills. The progression of unlocked weapons ends with the golden knife. The first player to get a kill the last weapon wins the match.

The only required entities for a map to work in Arms Race are spawn points for each team.

Spawn points

Arms Race uses the normal info_player_counterterrorist and info_player_terrorist as well as the info_armsrace_terrorist and info_armsrace_counterterrorist entities as player spawns. The spawn priorities of all of these are ignored in Arms Race, so a terrorist will always spawn at a randomly chosen spawnpoint from all existing info_player_terrorists and info_armsrace_terrorists.

Tip.pngTip:You should aim to include at least 16 spawn points for each team, so your map will run smoothly with up to 32 players on a server.
PlacementTip.gifPlacement Tip:Since Arms Race maps use deathmatch-style spawn mechanics, the placement of spawn points doesn't matter much; however, to keep your map simple and easy to understand, you'll probably want to cluster the spawn points together in areas, usually one for each team.

Disabling default spawns using VScript

If you want to use the info_armsrace_terrorist and info_armsrace_counterterrorist spawns exclusively, the other must be disabled. One way to disable all info_player_counterterrorist and info_player_terrorist spawns only for Arms Race is writing a VScript with something like:

TYPE <- ScriptGetGameType()
MODE <- ScriptGetGameMode()

if (TYPE == 1 && MODE == 0) // Arms Race uses game_type == 1 and game_mode == 0
{
	EntFire("info_player_terrorist", "SetDisabled", "", 0)
	EntFire("info_player_counterterrorist", "SetDisabled", "", 0)
}
else
{
	EntFire("info_player_terrorist", "SetEnabled", "", 0)
	EntFire("info_player_counterterrorist", "SetEnabled", "", 0)
}

Give this text file a name and save it with the .nut extension, for example mapname.nut and put it either directly into csgo/scripts/vscripts/ or in a (new) subdirectory from there. Place a logic_script in your level and add the previous script to its Entity Scripts. Check the console when running the map to see if something goes wrong. When publishing the map, this script must also be packed (see e.g. VIDE).

Testing your map

The map is launched in the Arms Race gamemode by first setting the server-side ConVars game_type to 1 and game_mode to 0 and then running the map using the map or changelevel command. See CSGO Game Mode Commands for details and tips.