Counter-Strike: Global Offensive/Game Modes/Custom: Difference between revisions
No edit summary |
No edit summary |
||
(23 intermediate revisions by 14 users not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar|title = Custom Game Mode}} | |||
{{back|Counter-Strike: Global Offensive Level Creation}}{{Delisted|csgo}} | |||
'''Custom''' is a [[game mode]] in {{csgo|4}}. | |||
It is an "empty" game mode allowing the mapmaker to customize it per map. [[ConVar]]s can be set with a map specific [[CFG]] file <code>csgo/maps/cfg/<mapname>.cfg</code>. | |||
{{Warning|The default value of the [[ConVar]] <code>sv_autoexec_mapname_cfg</code> is <code>0</code>, so this game mode does not execute that file by default. To get around this, use <code>csgo/cfg/gamemode_custom_server.cfg</code>, [[point_servercommand]], [[point_clientcommand]] or [[VScript]], see [[#Execute CFG files using VScript|below]].}} | |||
{{Note|That CFG file can also be executed with the console command {{ent|exec|<mapname> */maps}}. Use {{ent|execwithwhitelist}} for the whitelist restriction.}} | |||
{{Tip|When writing a CFG file for the game rules, you can use a command such as <code>exec gamemode_competitive</code> as a first line to use a different game mode's gamerules as a baseline, so there might be less ConVars that you need to manipulate.}} | |||
Every map can be run in the Custom game mode. Possibilities are: | |||
* Run it through the Workshop menus and choose the Custom game mode, if possible. | |||
* Set {{ent|game_type|3}} and {{ent|game_mode|0}} in the console before loading the map via <code>[[map (console command)|map]] <mapname></code>. This is equivalent to invoking <code>map <mapname> custom</code>. | |||
{{Tip|This game mode does not have in icon for the loading screen, but the game searches it, so one can ship their own icon at <code>csgo/materials/panorama/images/icons/ui/custom.svg</code>.}} | |||
== Game Mode Description == | |||
This game mode allows map makers to run their map with a bunch of custom settings via a custom [[CFG|config file]] <code>csgo/maps/cfg/<mapname>.cfg</code>. | |||
It allows to play mode variants like ''scoutzknivez'' and aim maps with their unique settings embedded right in the map. | |||
So, how many new game modes will Custom support? We don’t know! We can’t wait to see what the community comes up with. | |||
We’ve provided some Custom mode examples in the SDK which you can get by [steam://install/745 clicking here]. | |||
== | === Technical details === | ||
When a map is loaded in any game mode, all [[whitelistcmd|whitelisted ConVars]] are set to their default value and are then possibly overwritten by subsequent config executions. | |||
If <code>'''sv_autoexec_mapname_cfg'''</code> is not <code>0</code> while loading a map in the Custom game mode, then the [[CFG]] file <code>csgo/maps/cfg/<mapname>.cfg</code> is executed using {{ent|execwithwhitelist}}, only affecting [[whitelistcmd|whitelisted ConVars]] listed in <code>csgo/bspconvar_whitelist.txt</code>. | |||
Otherwise, the resulting game rules are very similar to Casual but with the noticeable differences <code>mp_timelimit 5</code>, <code>mp_roundtime 5</code> and {{ent|bot_quota_mode|normal}}. | |||
== Publishing == | |||
When you upload your map to the workshop, your cfg file will automatically get packed into your bsp file, so don't worry about packing it yourself.{{confirm}} | |||
;What else can I ship with my BSP? | |||
:Lots of stuff! New textures, new models, new sounds and most importantly (for custom gameplay) you can ship [[VScript]] files. If you aren't familiar with VScript files, they are [[Squirrel]] language-based scripts that can be run in-game. To learn more about them, see [[VScript]]. | |||
;How do I pack additional files in my BSP? | |||
:This is covered on the [[CS:GO Map Publish Tool]] page along with what files are automatically packed in the BSP on upload. | |||
== Execute CFG files using VScript == | |||
{| style="float:right;" | |||
| <syntaxhighlight lang=cpp> | |||
nType <- ScriptGetGameType() | |||
nMode <- ScriptGetGameMode() | |||
if (nType == 3 && nMode == 0) | |||
{ | |||
SendToConsole("exec " + GetMapName() + " */maps") | |||
} | |||
</syntaxhighlight> | |||
|} | |||
To achieve what this game mode used to be made for, namely the execution of <code>csgo/maps/cfg/<mapname>.cfg</code>, but without depending on <code>sv_autoexec_mapname_cfg</code>, we need only one short [[VScript]] with the concept named at [[CS:GO Game Modes#Game Mode dependent Events]]. | |||
* Create a text file with the content shown on the right. Save it at <code>csgo/scripts/vscripts/</code> or in a subfolder from there as a <code>.nut</code> file. | |||
* In [[Hammer]], create a [[logic_script]] and add this file to its <code>Entity Scripts</code>. | |||
* In-game, the script will be executed every time a round starts. If the current game mode is Custom, the script executes the CFG file <code>csgo/maps/cfg/<mapname>.cfg</code>. | |||
</ | |||
{{Note|Incidentally, many other things can be done other than just a CFG execution, see [[List of CS:GO Script Functions#Global functions|List of CS:GO Script Functions]].}} | |||
Accordingly, both the script and the CFG file must be packed to the [[BSP]] file when publishing, see e.g. [[VIDE]]. | |||
{{csgo-navbox}} | |||
[[Category:Counter-Strike: Global Offensive]] | [[Category:Counter-Strike: Global Offensive]] | ||
[[Category:Level_Design]] | |||
[[Category:Entry pages]] |
Latest revision as of 02:09, 14 May 2025


It is covered here for historical and technical reference.
Custom is a game mode in Counter-Strike: Global Offensive.
It is an "empty" game mode allowing the mapmaker to customize it per map. ConVars can be set with a map specific CFG file
csgo/maps/cfg/<mapname>.cfg
.

sv_autoexec_mapname_cfg
is 0
, so this game mode does not execute that file by default. To get around this, use csgo/cfg/gamemode_custom_server.cfg
, point_servercommand, point_clientcommand or VScript, see below.

exec gamemode_competitive
as a first line to use a different game mode's gamerules as a baseline, so there might be less ConVars that you need to manipulate.Every map can be run in the Custom game mode. Possibilities are:
- Run it through the Workshop menus and choose the Custom game mode, if possible.
- Set game_type 3 and game_mode 0 in the console before loading the map via
map <mapname>
. This is equivalent to invokingmap <mapname> custom
.

csgo/materials/panorama/images/icons/ui/custom.svg
.Game Mode Description
This game mode allows map makers to run their map with a bunch of custom settings via a custom config file csgo/maps/cfg/<mapname>.cfg
.
It allows to play mode variants like scoutzknivez and aim maps with their unique settings embedded right in the map. So, how many new game modes will Custom support? We don’t know! We can’t wait to see what the community comes up with. We’ve provided some Custom mode examples in the SDK which you can get by clicking here.
Technical details
When a map is loaded in any game mode, all whitelisted ConVars are set to their default value and are then possibly overwritten by subsequent config executions.
If sv_autoexec_mapname_cfg
is not 0
while loading a map in the Custom game mode, then the CFG file csgo/maps/cfg/<mapname>.cfg
is executed using execwithwhitelist, only affecting whitelisted ConVars listed in csgo/bspconvar_whitelist.txt
.
Otherwise, the resulting game rules are very similar to Casual but with the noticeable differences mp_timelimit 5
, mp_roundtime 5
and bot_quota_mode normal.
Publishing
When you upload your map to the workshop, your cfg file will automatically get packed into your bsp file, so don't worry about packing it yourself.[confirm]
- What else can I ship with my BSP?
- Lots of stuff! New textures, new models, new sounds and most importantly (for custom gameplay) you can ship VScript files. If you aren't familiar with VScript files, they are Squirrel language-based scripts that can be run in-game. To learn more about them, see VScript.
- How do I pack additional files in my BSP?
- This is covered on the CS:GO Map Publish Tool page along with what files are automatically packed in the BSP on upload.
Execute CFG files using VScript
nType <- ScriptGetGameType()
nMode <- ScriptGetGameMode()
if (nType == 3 && nMode == 0)
{
SendToConsole("exec " + GetMapName() + " */maps")
}
|
To achieve what this game mode used to be made for, namely the execution of csgo/maps/cfg/<mapname>.cfg
, but without depending on sv_autoexec_mapname_cfg
, we need only one short VScript with the concept named at CS:GO Game Modes#Game Mode dependent Events.
- Create a text file with the content shown on the right. Save it at
csgo/scripts/vscripts/
or in a subfolder from there as a.nut
file. - In Hammer, create a logic_script and add this file to its
Entity Scripts
. - In-game, the script will be executed every time a round starts. If the current game mode is Custom, the script executes the CFG file
csgo/maps/cfg/<mapname>.cfg
.

Accordingly, both the script and the CFG file must be packed to the BSP file when publishing, see e.g. VIDE.
|