Map (console command): Difference between revisions
No edit summary |
Mycatismycat (talk | contribs) (add changelevel) |
||
(27 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{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|engine=GoldSrc|engine1=source|engine2=source 2}} It loads the specified map and starts a game on it. | |||
{{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> | |||
map <mapname> [*sp/*mp] // Portal 2 | |||
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. | |||
{{Example|1={{hl2}} <code>map d1_trainstation_01</code><br>{{portal2}} <code>map mp_coop_fan *sp</code><br>{{csgo}} <code>map de_dust2 deathmatch</code><br>{{cs2}} <code>map de_dust2 gamemode=deathmatch</code>}} | |||
{{note| | |||
{{l4dbranch|since}} {{also|{{src13mp}}{{tf2branch}}}} If you type the map name partially, like {{code|map l4d_river}} or {{code|map de_du}}, then submit it, it will load the first result it found ({{code|l4d_river01_docks}} or {{code|de_dust}}).</br> | |||
{{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}}.}} | {{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?}} | |||
}} | |||
{{note| | |||
{{portal2}} will automatically launch maps starting with <code>mp_coop</code> in co-op mode, but you can still launch them in "singleplayer mode" by appending <code>*sp</code> at the end of the command. The inverse is also possible. | |||
:{{Example|1=<code>map sp_a2_triple_laser *mp</code>}} | |||
}} | |||
== | ==Similar Commands== | ||
<code>map_background</code> | {| class=wikitable | ||
! ConCommand !! Description | |||
|- | |||
<code>map_commentary</code> | | <code>map_background</code> | ||
| Analogous to <code>map</code> 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 {{hl2|4}} and its series but it does no longer work properly in newer games. Works in {{tf2|4}} and {{portal|4}} | |||
|- | |||
<code>maps</code> | | <code>map_commentary</code> | ||
| Analogous to <code>map</code> but also enables [[commentary mode]], introduced in {{hl2lc|4}} and {{src06|4}}. | |||
|- | |||
| <code>maps <substring></code> | |||
| Lists all the maps the game has access to that contain a certain character sequence. Use <code>*</code> to list all maps. | |||
|- | |||
| <code>changelevel</code> | |||
| Simillar to <code>map</code> but keeps weapons and other player information from the previous map. | |||
|} |
Latest revision as of 23:00, 3 July 2025
map
is a console command available in all GoldSrc,
Source, and
Source 2 games. It loads the specified map and starts a game on it.

Apparently, both commands behave like
changelevel
since 
Usage
map <mapname> map <mapname> [*sp/*mp] // Portal 2 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.


map d1_trainstation_01

map mp_coop_fan *sp

map de_dust2 deathmatch

map de_dust2 gamemode=deathmatch

(in all games since ) (also in
) If you type the map name partially, like map l4d_river or map de_du, then submit it, it will load the first result it found (l4d_river01_docks or de_dust).
The optional
gamemode
parameter can be one of the values deathmatch, casual, competitive, armsrace, coopstrike ...
, see CS:GO Game Modes.
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?]

will automatically launch maps starting with
mp_coop
in co-op mode, but you can still launch them in "singleplayer mode" by appending *sp
at the end of the command. The inverse is also possible.
Example:
map sp_a2_triple_laser *mp
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 ![]() ![]() ![]() |
map_commentary
|
Analogous to map but also enables commentary mode, introduced in ![]() ![]() |
maps <substring>
|
Lists all the maps the game has access to that contain a certain character sequence. Use * to list all maps.
|
changelevel
|
Simillar to map but keeps weapons and other player information from the previous map.
|