This article's documentation is for anything that uses the Source engine. Click here for more information.

Map (console command): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Game mode parameter seems to be only csgo. cs2 has a new system.)
Line 1: Line 1:
{{for|about=the console command|the place in a game|[[Map (level design)]]|the file format|[[MAP file format]]}}
{{for|about=the console command|the place in a game|[[Map (level design)]]|the file format|[[MAP file format]]}}
{{this is a|console command|name=map|notitlechange=1}} It loads the specified map and starts a game on it.
{{this is a|console command|name=map|notitlechange=1}} It loads the specified map and starts a game on it.
{{warning|For multiplayer games, this command will kick everyone from your server before changing the map, or does a ''hard change'', so to speak. If you want to soft change your map from console use the {{ent|changelevel}} command.}}
{{warning|For multiplayer games, this command may kick everyone from your server before changing the map, or does a ''hard change'', so to speak. If you want a ''soft'' change, use {{ent|changelevel}}.<br>Apparently, both commands behave like <code>changelevel</code> since {{csgo}}.}}


==Usage==
==Usage==
{{pre|map <mapname> [gamemode]}}
<pre>
map <mapname>
map <mapname> [gamemode] // CS:GO
map <mapname> [key1=value1] [key2=value2] [...] // CS2
</pre>


The .[[BSP|bsp]] extension must be omitted. The game can access both maps in mounted [[VPK]]s and in the <code>maps\</code> folder. Maps that are in a subdirectory of <code>maps\</code> need to have the folder name included in the console command.
The .[[BSP|bsp]] extension must be omitted. The game can access both maps in mounted [[VPK]]s and in the <code>maps\</code> folder. Maps that are in a subdirectory of <code>maps\</code> need to have the folder name included in the console command.


{{Note|{{code|gamemode}} is only present in {{csgo|1}}.
{{Example|1={{hl2}} <code>map d1_trainstation_01</code><br>{{csgo}} <code>map de_dust2 deathmatch</code><br>{{cs2}} <code>map de_dust2 gamemode=deathmatch</code>}}
{{Confirm|Confirm whether CSS has this.}}
{{note|
{{csgo}} The optional <code>gamemode</code> parameter can be one of the values <code>deathmatch, casual, competitive, armsrace, coopstrike ...</code>, see [[CS:GO Game Modes]].
{{todo|A similar list exists for {{l4d2}}.}}
{{cs2}} A list of key-value pairs can be passed. As seen in the example above, this can be used to set the game mode.{{inline note|name=What else?}}
}}
}}
{{ModernExample|<code>map de_dust2 deathmatch</code>}}
{{tip|{{csgo}} The optional <code>gamemode</code> parameter can be <code>deathmatch, casual, competitive, armsrace, coopstrike ...</code>, see [[CS:GO Game Modes]].<br>{{todo|A similar list exists for {{l4d2}}.}} }}


==Similar Commands==
==Similar Commands==

Revision as of 21:21, 9 January 2025

This article is about the console command. For the place in a game, see Map (level design).  For the file format, see MAP file format.

map is a console command available in all Source Source games. It loads the specified map and starts a game on it.

Warning.pngWarning:For multiplayer games, this command may kick everyone from your server before changing the map, or does a hard change, so to speak. If you want a soft change, use changelevel.
Apparently, both commands behave like changelevel since Counter-Strike: Global Offensive.

Usage

map <mapname>
map <mapname> [gamemode] // CS:GO
map <mapname> [key1=value1] [key2=value2] [...] // CS2

The .bsp extension must be omitted. The game can access both maps in mounted VPKs and in the maps\ folder. Maps that are in a subdirectory of maps\ need to have the folder name included in the console command.

PlacementTip.pngExample:Half-Life 2 map d1_trainstation_01
Counter-Strike: Global Offensive map de_dust2 deathmatch
Counter-Strike 2 map de_dust2 gamemode=deathmatch
Note.pngNote:

Counter-Strike: Global Offensive The optional gamemode parameter can be one of the values deathmatch, casual, competitive, armsrace, coopstrike ..., see CS:GO Game Modes.

Todo: A similar list exists for Left 4 Dead 2.

Counter-Strike 2 A list of key-value pairs can be passed. As seen in the example above, this can be used to set the game mode.[What else?]

Similar Commands

ConCommand Description
map_background Analogous to map but loads a map as a background for the main menu. The player will not be able to move normally, but they can still use the console to move, attack, etc. This was introduced and used in Half-Life 2 Half-Life 2 and its series but it does no longer work properly in newer games. Works in Team Fortress 2 Team Fortress 2 and Portal Portal
map_commentary Analogous to map but also enables commentary mode, introduced in Half-Life 2: Lost Coast Half-Life 2: Lost Coast and Source 2006 Source 2006.
maps <substring> Lists all the maps the game has access to that contain a certain character sequence. Use * to list all maps.