Half-Life 2: Deathmatch

Half-Life 2: Deathmatch

Zbyt mało ocen
List of Common HL2:DM Map Debugging Commands
Autorstwa: CLANG-CLANG
These are commands that I often use to test and debug maps with.

If you're trying to figure out something, or just want to mess around or explore maps, this guide may help you.
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
Intro
These are the most common console commands I use to debug, test, or explore Half-Life 2: Deathmatch maps with.

To keep things simple, this guide doesn't cover every potential command that could be useful, but the ones I use the most.

If you wish to see all console commands, I suggest looking the VDC's list of HL2 Console Commands instead. The in-game console commands find command and help command are useful, too.
Accessing Missing/Hidden Commands
A lot of useful console commands are in HL2:DM's game engine, but cannot be normally accessed due to unknown reasons.

For example, if you wanted to match a server's physics setting, you cannot change anything other than the gravity setting.

A workaround to this is to install SourceMod, and then start the game with a special launch option.

Installing SourceMod
The instructions are almost the same if you're installing SourceMod for a server or game client.

1. First download MetaMod[www.sourcemm.net], and move the files from the download to "steamapps\common\Half-Life 2 Deathmatch\hl2mp". The addons folder should be the only new item inside hl2mp.
2. Next, download SourceMod[www.sourcemod.net], and again, click-drag both folders to "steamapps\common\Half-Life 2 Deathmatch\hl2mp".

Launching the Game With SourceMod
1. Open Steam, and open your Library.
2. Find Half-Life 2: Deathmatch, and click the gear on the right, and in this new menu, click Properties.
3. You should see Launch Options. Add this line to it (you shouldn't have to remove anything else): -insecure

This disables VAC, and allows loading plugins like SourceMod from the "Half-Life 2 Deathmatch\hl2mp\addons" folder.

Test If SourceMod Works!
1. Launch HL2:DM.
2. Either Create Server in the UI, or open console with the tilde key (button left of 1, and above tab) and type map dm_lockdown into console and press Enter.
3. Press the say key (y or u by default), and type !sm_cvar sv_friction 0.

Disable SourceMod
1. Open Steam, and open your Library.
2. Find Half-Life 2: Deathmatch, and click the gear on the right, and in this new menu, click Properties.
3. You should see Launch Options. Remove -insecure from the text box there.
Common Console Errors
Since you're using the developer console, you might see some errors pop up a lot.

A lot of these issues have been fixed on hosted servers with the use of custom server binaries or plugins[github.com], but haven't been fixed when maps are loaded on your own machine; this method of starting games is called using a listen server[en.wikipedia.org].

The #1 rule of HL2:DM mapping is to never trust the listen server.

Playing sequence...
This is a bug caused by sound errors.

There isn't much you can do to fix this, outside of filtering the console spam out entirely:
con_filter_enable 1 // 1 filters out completely, 2 displays filtered text brighter Def. 0 con_filter_text_out "Playing sequence" // Prevents annoying console spam involving sound Def. ""

Ignoring unreasonable position from vphysics!
This means that something has fallen through the map's floor, and will perpetually keep fall until the map is reset.

This is a bug usually caused by an item or prop respawning, and being too close to the floor.

Usually placing entities 16 units above the floor from it's bounding box fixes this issue (thanks to TheNewGuy for this info).

DataTable warning: player: Out-of-range value in SendPropFloat 'm_flPlaybackRate', clamping.
This means that an object has hit the maximum speed possible as decided by the command sv_maxvelocity (default 3500), and is being intentionally being slowed by the game engine.

This is typically caused by players really fast from map elements like jump pads and wind tunnels.

This is very rarely an issue, so this error can be ignored.

Bad SetLocalAngles on [targetname]
This is a bug involving func_rotating, which occurs after a map has been open for a very long time.

You can either restart the map, or if you're the mapper, you can fix this with a logic_relay restarting the rotation.
General Commands
These commands are almost always used.

sv_lan
1 to disable people joining your listen server (non-dedicated server) unless they're on your LAN. Highly recommended!
0 to allow people to join your game, and lists your game on the master server (game list).

map mapname
Load this named map.

Map search: maps string will list all maps with that string (text) inside it, while an asterisk (as maps *) will lists all maps that you have scattered around in the hl2mp directory.

sv_cheats
1 to enable cheat commands to be ran
0 to disable this setting

Note: Some commands that were entered before sv_cheats was enabled will activate when enabled.

noclip
Toggle player collision on and off.

Note: You will still activate triggers if touched.

impulse 101
Instantly obtain all standard weapons and additional ammo; getting maximum ammo for all weapons requires activating this command three times.

buddha
Toggle pseudo-godmode on and off. You'll take damage, but you're effectively invulnerable, with some rare exceptions.

This a workaround to godmode (god) not working on this version of Source Engine 1.

developer
2 to enable some extra commands, alongside with printing game actions to the console & the top-left of your HUD.
0 to disable this setting.
Entities
Quick Tips
  • In Hammer, inside an object's properties, you can press Disable SmartEdit to get an engine property as its outputname.
  • To change an object's flags in-game, you'll need to add the total number of enabled flags together. You'll either need a custom FGD, or to search the entity's classname on VDC to get these values.
  • If a target is not named, it's name is instead the entity's classname
  • !picker targets the entity under your crosshair; this includes invisible objects such as triggers
  • !player targets yourself and other connected players (usually)
  • Anything starting with cl_* means it only targets things that are shown on the client-side. This means that there may be some inaccuracies under flaky networking conditions, or if certain glitches happen.

ent_fire targetname addoutput "outputname value"
Change the properties of an entity.

Unlike in Hammer, the double quotes are recommended to prevent numbers from being read as a time delay to the engine (it assumes the action is instant (0) if not inputted).

ent_text
Toggle showing information about the entity that's closest the crosshair.

Requires developer 1 or higher.

showtriggers_toggle
Toggles the visibility of trigger brushes on and off.

Note: A similarly named command called showtriggers int exists, but is nonfuctional.

ent_bbox targetname
Show the bounding box around an object. If no targetname is provided, it targets !picker instead.

Requires developer 1 or higher.

ent_fire !picker kill
Until map restart, remove targetted entity from the game.

ent_fire !picker addoutput "targetname name_here"
Give whatever your looking at a targetname, allowing it's name to be used for console commands, and potentially being targeted by other map I/O actions.

sv_showladders
1 shows the ladders position, it's ladder type (redundant in HL2:DM), and it's dismount points (use key entry/exit positions).
0 reverts this setting

This requires a map change or map restart to apply changes to this command's settings.
False Ladders?
If a ladder cannot be used, or seems much faster to climb than standard ladders, then it likely is made out of lots of clip brushes in a way similar to stairs instead.

These are called clip ladders; you'll need to use r_drawclipbrushes to see and test those instead.

ent_create npc_alyx
Spawn Alyx at your crosshair; this is the quickest way to spawn something with a player's dimensions

sv_dump_edicts
Get the current grouped count of entity types on the map. This can be used to get the stats of player-usable resources without needing to decompile the map.

cl_showents
List all existing map entities into the game console in their indexed order - this can be used to figure out things like predicting player respawns (HL2:DM's player respawns are not random).

ent_messages_draw
1 to draw entity events and actions to the game world
0 to disable

report_entities
Grabs the existing number of entities on the map, counts them by classname, and reports the total entity and edict count at the end to the console.

Entity Search Commands

Warning: This are using the server side commands; there similared worded commands starting with cl_* that checks the client side only!

find_ent classname or targetname
Search entities on the client-side.

Example - Search By Classname
Input
find_ent weapon_357
Output
Searching for entities with class/target name containing substring: 'weapon_357' 'weapon_357' : '' (entindex 37) 'weapon_357' : '' (entindex 392) 'weapon_357' : '' (entindex 515) Found 3 matches.

Example - Search By Targetname

Input
find_ent sink
Output
Searching for entities with class/target name containing substring: 'sink' 'prop_physics_respawnable' : 'sinks1' (entindex 20) 'prop_physics_respawnable' : 'sinks1' (entindex 21) 'prop_physics_respawnable' : 'sinks2' (entindex 15) 'prop_physics_respawnable' : 'sinks1' (entindex 22) 'prop_physics_respawnable' : 'sinks2' (entindex 16) 'prop_physics_respawnable' : 'sinks2' (entindex 17) 'prop_physics_respawnable' : 'sinks2' (entindex 18) 'prop_physics_respawnable' : 'sinks1' (entindex 47) 'prop_physics_respawnable' : 'sinks1' (entindex 19) 'prop_physics_respawnable' : 'sinks1' (entindex 48) 'prop_physics_respawnable' : 'sinks2' (entindex 49) 'prop_physics_respawnable' : 'sinks2' (entindex 50) 'info_lighting_relative' : 'sink_lighting' (entindex 491) Found 13 matches.

find_ent_index entindex
Search if an entity exists with that number, and if so, reports back with it's classname, targetname (if applicable), and entity index (entindex). Otherwise reports that an entity with that number does not exist.

Example

Input
find_ent_index 50
Output
'prop_physics_respawnable' : 'sinks2' (entindex 50)

firetarget targetname

Tries to +use target. If no targetname is supplied, uses !picker instead.

cl_pdump entindex
Continuously monitor an entity's condition on the top-left of the HUD. This command is actually intended as a network prediction command, so it'll show some coding stuff as well.

If you can't read the input, you'll either need to change your screen resolution or HUD, sometimes both.

entindex >=0 to track an entities' state on your HUD
-1 to disable

vcollide_wireframe
Shows the VPhysics collision area of rendered models as a wireframe.
AI
These are useful for co-op maps.

ai_disable
Toggle AI thinking (actions) on and off. [May leave a message on the HUD when disabled.]

ent_fire ai_network "kill"
Until map reset, disable anything involving AI.

notarget
Toggle AI being able to react to the player, unless they get shot, or reacted to them before the command was enabled.
World Visibility & Wireframes
Draw Commands
This hides visual elements that can make debugging a bit easier.

Colour Key
Unless you're using a command that deliberately changes the colour scheme (like mat_wireframe 2), these are the colours that represent what colour represents a shown wireframe.

Colour
Element
Pink
World Brush
Cyan
Model
Yellow
Decal/Overlay
Green
Displacement

mat_wireframe
1 to draw everything rendered as a wireframe, with transparency for everything but world brushes
3 to wireframe everything similar to 1, but won't draw the triangles inside a world brush to reduce visual clutter
0 to revert this setting,

r_drawstaticprops
0 to hide all prop_static
2 to shows static prop wireframes; this is sometimes useful for visibility testing
1 to revert this setting, making static props normal again

r_DrawDisp
0 to hide all displacement (non-flat and/or texture blended) brushes
1 to revert this setting, making displacements visible again

r_drawdecals
2 to view the wireframe, and full area size of all decals (textures that aren't tied to brushes)
0 to hide all decals
1 to revert this setting, viewing decals normally again

r_drawothermodels
This command affects player models, NPCs, prop_dynamic, prop_dynamic_override and viewmodels. Possibly other entities too, but not anything that's affected by r_drawbrushmodels.

2 to draw every non-static model as a wireframe
0 to hide all non-static models from view
1 to revert this setting, drawing affected models back to normal

Cheat-proofing: This command is the best thing in-game that can emulate wallhacking, as it affects the least amount of entity types that encompass player models, while also being limited to the current PVS.
Brushes
This is usually level geometry, but can include gameplay elements like clip brushes as well.

r_drawclipbrushes
1 to view all clip brushes (invisible walls) as hollow geometry (wireframes) through walls.
2 to view all clip brushes as solid, but not through walls.
0 to revert this setting, hiding all clip brushes like normal again

Note: If a hidden brush is invalid and you use a command to make it visible, you will crash the game!

Clip Brush Colour Key
  • Red - Clip everything [VPhysics objects like grenades probably are an exception, as they have their own method of blocking things]
  • Pink - Player Clip only
  • Purple - NPC Clip only

r_drawfuncdetail
0 to hide func_detail from view (compiling optimisation brushes)
1 to revert this setting, making func_detail visible again

r_drawbrushmodels
2 to view brush entities (such as func_door) as wireframes, making them more visible
0 to hide brush entities
1 to revert this settings, restoring the visibility of brush entity

r_drawtranslucentworld
0 to hide translucent (see-through; the name is often confused with transparent) objects, such as brushes and decals
1 to revert this setting, returning general visibility

mat_leafvis
3 to draw all visleafs as wireframes, which is useful for map optimisation
0 to revert this setting, hiding all wireframes from this command.

r_novis
1 to render the whole map at once
0 to revert this setting,

Note: You'll need to move into a new visleaf in order for changes to this command to take effect.
Map Lighting
These commands debug lighting post-compile. If you're mapping in Hammer++ (highly recommended), you can use the 3D Lighting View to get a quick approximation of how a map will look before compiling. It's an absolute life saver!

mat_fullbright
1 to turn the visuals of the map very bright in a solid white colour, as were fully lit this way. If a map has no light entities to generate any lighting, the game will automatically enter this command for you.
2 to remove the coloured textures from the map's world brushes, displacements*, and models (including brush models) with a solid white colour, but retain the material's bump mapping. Map lighting, and other is unaffected.
0 to disable this setting, using the map's compiled lighting instead. Note that maps will no lighting will be fully black instead.

*If a displacement uses blending, the blend from the [base material?] will be affected, but the texture used for the blend will be coloured in contrast to how intense the blend was used over the base material.

r_drawlightinfo
1 to view the positions of where all lights were positioned from compile [Is this just static lights, or are dynamic lights affected too? Flash lights seems to be unaffected, anyhow.]

r_visambient
1 to visualise how ambient lighting (from a light_environment) affects the visleaf you're standing in, with white cubes showing what and how things are affected
0 to disable this setting, hiding the cubes

Requires mat_leafvis 1; developer 1 or higher is highly recommended with this command.
Sounds & Soundscapes
Quick Tips
  • HL2:DM only supports sounds in .wav and .mp3 format, and other limitations too (MP3 can't loop without Hammer I/O, and there's other limits too [Frequency under 44hz I think?]
  • If a custom sound doesn’t work, you may need to delete multiple sound.cache files to get it working again (close the game if open, and search & delete all of them)
  • developer 2 will show the soundscape name in the top-left of the screen and console when triggered

snd_restart
Instantly stop all played sounds on a map; this may cause the game to crash under certain conditions (usually by restrictive sv_pure settings)

play soundpath\soundname.filetype
Instantly play an unmodified sound effect at full volume inside the current active soundscape.

Important Sound Pathing Note
The file path reads from the sound directory, and treats all file paths as if there were started and packed from that directory.

The engine effectively merges all sound files from both hl2 & hl2mp directories, all custom folders inside hl2mp/custom/directory_names_here/sound, and the sound folder inside the map's BSP as one giant cross-referenced sound folder.

Example play command
play weapons\stunstick\spark1.wav

playsoundscape soundscape.soundscape_name
Force change the current soundscape and environmental DSP effect (e.g. echo) to this soundscape, until another soundscape is triggered.

A list of all vanilla HL2:DM soundscapes are listed in this VDC article here.
Player Stats
These commands target the player you control, but some of these commands will target all players on a server.

Quick Notes
  • The !player targetname usually is the method to target yourself, but sometimes you need to remove the exclamation point (as player instead) to get a command to work

noclip
Toggle player collision on and off; however, you may still activate triggers on contact.

An example of noclipping through map geometry, and using it to see through walls.

buddha
Toggle pseudo-godmode on and off. You'll take damage, but you're effectively invulnerable, with some rare exceptions.

This a workaround to godmode (god) not working on this version of Source Engine 1.

impulse 101
Instantly obtain all standard weapons, and their default weapon's reserve ammo.


To get a full inventory's worth of ammo, you'll need to use this command three times.

impulse 81
Instantly add weapon_cubemap to your invetory; a hidden debug weapon usually for testing reflections (cubemaps), but also is used for the Custom Guns server plugin.


weapon_cubemap is grouped with weapon slot 3 (slot3 command), the same weapon slot used to select the SMG and AR2.

If you'd rather equip it without pressing the same keybind three tines, this command will directly equip it instead:
bind key "use weapon_cubemap"

ent_fire !player addoutput "health x"
Instantly give all players x health; x being any number, including decimal places (programmers call these floats)


This is useful for situations where you want to test high amounts of damage and need a good number to start the math from.

Note: It is not possible to set custom armour values without SourceMod plugins.

thirdperson
Instantly switch to a view behind the player, which is useful for player visibility testing (such as lighting) and previewing shadows cast by players.


firstperson
Instantly revert back to the default first-person perspective.

Physics Commands
These commands listed here affect player movement, but they also affect other entities as well.

sv_gravity
The pull of gravity; which affects all players and physics objects. Negative values push objects to the ceiling instead.

300 is roughly low-gravity; depending on server you're emulating
600 is HL2:DM's default

sm_cvar sv_airaccelerate
How fast, and how far a player can quickly turn using air strafing (looking and strafing in the same direction in midair). Higher values allow for tighter and quicker turning.

Common Air Accelerate Values
150 - most common surf mode setting across all Source engine games
100 - the old, bugged, HL2:DM default air acceleration setting [Likely pre-2010 update, where changing this setting also did nothing to the game. According to TheNewGuy, since I practically was a DM fetus at the time, before moving onto other games.]
15 - XDM setting [TDK server uses 16]
10 - HL2:DM default

sm_cvar sv_friction
The strength of world friction; how stiff or smooth it is to move around. Lower values allow for easier crouch sliding and/or bunnyhopping, meanwhile high values can kill it in its tracks.

The friction command affects all objects and players.

Common Friction Values
8 - Garry's Mod friction (incredibly stiff)
3 - XDM movement (easier & faster bunnyhopping)
0 - Outright remove friction [ice physics?]
4 - default HL2:DM ground friction

sm_cvar sv_accelerate
How fast a player can reach their ground top speed, and how easy it is to jiggle peek (ADAD strafing corners).

[Higher values seem to make forward/backward and left/right strafing more of a rectangular shape if the keys are consequentially pressed in a circle shape, but I'm not sure if this is placebo or not.]

11 - XDM ground acceleration (easier to start bunnyhops with, especially with sprint)
10 - default HL2:DM ground acceleration
Misc. Commands
Commands that don't fit anywhere else.

host_timescale
Run the game at anywhere between 0 to 10 times the normal game speed. This is useful to skip waiting for timed events, or rapidly testing item respawns.

You may use decimals (floats) if you want things to move very slowly.

10 is fastest you can go
0.064 is approximately 1 game tick a second, at the 64 tick default [Needs proof.]
1 to revert back to normal speed

getpos
Get the co-ordinates and angles you are currently looking at and output it to console. You can copy & paste this line to easily return to it later.


setpos x y z
Instantly move to these co-ordinates (z is height, and is optional)

setang pitch roll yaw
Instantly look in this direction.

Angle Directions
Pitch - Up/Down +-90°
Yaw - Left/Right 0-360 (supports negative numbers, e.g. -90° is also +270°)
Roll - Diangular Camera Tilt, +-60°. Optional, and good for screenshots.

cl_showpos
1 shows position, angles, and current velocity at the top-right of the HUD
0 to hide it again

Note: This is cheat protected in other Source Engine games (CS:GO, and possibly TF2), but not HL2:DM.

cl_showfps
1 show framerate, with the current map's name in the top right of the HUD in green.
0 to hide this again

condump
Instantly save up to the last 241 lines from your game console (max visible) to an automatically named and numbered text file inside "Half-Life 2 Deathmatch\hl2mp".

The file will be called condumpXX.txt, with it's number being the lowest unused in that folder, starting from "00".

con_logfile "filename.txt"
If not blank, continuously print console output the named text file inside the "Half-Life 2 Deathmatch\hl2mp" directory.

The .txt part is important; without it, this command will not work!

To disable logging, type this into console instead:
con_logfile ""
Screenshot Commands
Commands that are useful for good screenshots.

Hang on, aren't there console commands to take screenshots?
While they do very much exist, you'll get much more flexibility they days using external capture tools such as ShareX[getsharex.com].

https://store.steampowered.com/app/400040/ShareX/

The only notable issue I've found is that external programs won't correctly capture your gamma settings (i.e. mat_monitorgamma is always displayed as as being 2.2); I've found that the main workaround to that is to use Steam Overlay's screenshot tool to take the screenshot instead (it's bound to F12 by default).

Quick Tips
  • Only the Steam overlay can capture modified gamma settings, and the gamma settings only kick in when the game is fullscreened.
  • Fix stuck/broken HUD panels with hud_reloadscheme
  • You may need to adjust your screen resolution based on where you plan on uploading (e.g. Steam guides format the content as narrow, so 4:3/5:4 screen resolutions make better image previews).
  • host_timescale is really useful for slowing down the game for setting up screenshots
  • You can force the camera to tilt with the third argument of setang, which is good for dramatic screenshots
  • The field of view can only be adjusted between 1-90 using fov int; anything else requires SourceMod plugns
  • You may need godmode (buddha) if you keep on getting damaged and the camera keeps on moving

cl_drawhud
0 to hide the in-game HUD
1 to return the HUD to normal again

Example of disabling the HUD only.

Note: hidehud 4 also accomplishes this as well [It has a bit more flexibility, too.]

hud_reloadscheme
Instantly reload all UI elements; useful for fixing stuck HUD elements such as frozen panels.

Example of frozen HUD panels with a custom HUD

r_drawviewmodel
0 to hide the held weapon's model
1 to show it again

Example of hiding the your weapon's view model only.

Note: impulse 200 can do this too, but has a few quirks to it, so the above method is preferred.

cl_showpluginmessages

0 to hide text from server plugins (usually things like a map's time left, or scoring information)
1 to allow it again

Note: If you're not using any server plugins outside of SourceMod, you don't need to use this.
Server Config Settings
These are meta server settings that affect how a server works. Commands here are applicable to dedicated servers, and listen servers alike.

Listen Server vs Dedicated Server
Half-Life 2: Deathmatch (and other Source Engine multiplayer games) create something called a listen server[en.wikipedia.org] when you load a map, without either using the server browser or the connect command.

On the other hand, a dedicated server[en.wikipedia.org] is a command-line only version of the game that does not visually render the game at all, and is intended for computers that will run the game 24/7, with possibly other tasks or other game server running as it as well.

TL;DR - What server type should I use?
TL;DR
Your game client's listen server is fine for browsing through downloaded maps or mods, or pre-test game mapping, but you'll need to know what bugs are much more likely on a listen server - in particular, you need to keep the issues involving VPhysics in mind (weapons/items/health pickups falling through the floor).

But if you're doing anything with other players, having issues with the server created by your game, or encountering bugs you swear aren't normal, switch to a dedicated server instead, even if it's running in tandem with the game.

Server Command Quick Tips
  • If you want people to join a game that's hosted by your computer, I highly recommend using Source Dedicated Server to host the server, and then using the game to connect to it yourself. . This is a better method than using a listen server, as it more stable, less buggy (e.g. less VPhysics issues), and with the added flexibility of setting up server plugins with SourceMod
  • Source Dedicated Server in the Steam Library is horribly outdated; you'll need to use SteamCMD to retrieve the files needed to host a HL2:DM dedicated server.

sv_lan
1 to disable people joining your listen server (non-dedicated server) unless they're on your LAN.
0 to allow people to join your game, and lists your game on the master server (game list).

I highly recommend enabling sv_lan to prevent random people from attempting to join your game!

The laziest way to set this is to copy and paste the code block below into a new line inside your autoexec.cfg, so you won't have enable it every time you open the game:
sv_lan "1" // Forces LAN mode on player created games, preventing randoms from connecting to your computer's listen server. Useful for offline experimentation and modding. Def. 0

sv_password "password here"
If you decide to intentionally allow people to join your game, you may set a password to restrict random people from joining as well.

Note: Quotes are required for passwords with spaces.

sv_allow_point_servercommand
If a map possesses the point_servercommand entity on it, this command dictates if a map use it to change server console variables.

always will enable maps to use point_servercommand if placed on a map.
disallow will stop maps using point_servercommand, preventing potential server exploits from malicious maps, but potentially also breaking some legitimate ones in the process.

point_servercommand in more detail, and why this command exists
point_servercommand is a powerful entity that can apply server commands on your server.

Usually this is used positively, such as setting up non-standard game modes like CTF, relaying game events as server chat to players (e.g. custom holographic pickups on 1adm_sw0starena_v1k), or used as part of a map's Easter Eggs.

However, console commands sent to the server can be used maliciously, as there isn't a way to restrict which commands are allowed through point_servercommand. Major server settings like gravity, player damage, and even how the server networks, are all fair game to this powerful entity.
Command Line Arguments (Launch Options)
This is how you can set the game to use automatically use console commands, and to use special game options that can only be changed when starting the game

  • -command - Commands starting with a minus can only be set as a launch option
  • +cvar - Commands starting with a plus are console commands, and will be entered automatically on launch

How to set launch options
Method 1: Steam Library
This will apply your launch options every time you open the game with Steam.

Note: If you're using a Steam skin and/or the Steam UI has been updated, these instructions might be different.
  1. In the Steam application, click Library.
  2. On the left hand side, click the search bar (with the magnifying glass) and type Deathmatch.
  3. Single-click Half-Life 2: Deathmatch
  4. On the right hand side, click the gear icon, and then click Properties.
  5. Under the General tab (selected by default), add your launch options, separating each additional option with a space.
  6. Close the Properties window to apply.

Method 2: Desktop Shortcut
This will apply your launch options only when you open the game using a shortcut.

  1. In the Steam application, click Library.
  2. On the left hand side, click the search bar (with the magnifying glass) and type Deathmatch.
  3. Single-click Half-Life 2: Deathmatch
  4. On the right hand side, click the gear icon, hover over Manage, and then click Browse local files.
  5. Right click hl2.exe, hover over Send to, and then click Desktop (create shortcut)
  6. Go to your desktop (shortcut: Windows Key + D), right click hl2.exe - Shortcut, and click Properties.
  7. In the Shortcut tab (selected by default), click the Target field, add a single space after the quotation mark, and then type -game hl2mp (otherwise you'll get an error on load).
  8. In the Target field, add your desired launch options after -game hl2mp, with a space between new commands.
  9. Click Apply to save, and/or click Ok to save and close the Properties window.

Launch-only commands
-game hl2mp
If you're launching the game with a shortcut outside of Steam, this needs to be the first launch option, otherwise you'll see the error below.



-novid
Skip the intro video (aka Mr. Valve[combineoverwiki.net])

-insecure
Start the game with Valve Anti-Cheat (VAC) disabled, and allows loading plugins from the addons folder. You will not be able to join VAC-enabled servers until you restart the game without it!

If you want to use hidden server commands using SourceMod, this is a requirement on your listen server (games hosted with Source Dedicated Server are unaffected).

-hijack
If HL2:DM (hl2.exe) is already open, apply as many launch commands as possible to the already open game.

This is useful timesaver if you're starting the game from a shortcut, or rapidly recompiling & testing the map in Hammer. The only caveat is that you might get precaching issues under certain circumstances.

-tickrate X
Change how many times the game server refreshes its actions/calculations per second. Higher is usually better (smoother), but there are caveats:
  • The game has issues with certain tickrates, especially high ones above 100.
  • Glitches occur more frequently and with increased severity with increased tickrate, usually involving physics.
  • You may need to force rates on players through server variables for them to take advantage of the increased tickrate.

Notable tickrates:
  • 100 tick - A balance between smoother gameplay and minimal glitches. The highest recommended tickrate when used in conjunction with game fixes.
  • 128 tick - In other Source engine games, this is the preferred competitive tickrate
  • 66 tick - HL2:DM default tickrate

Console Commands
These commands are very commonly used after starting the game, so setting these as a launch option can be a small timesaver.
+map mapname
Skip the main menu, and instantly load this map on your listen server.
+sv_cheats 1
Enable cheat commands
+developer 2
Enable developer commands
+exec config.cfg
Apply all commands in this configuration file after launch; like using a shortcut, a configuration with debug commands can save you some time as well.

Note: exec reads configs primarily from from Half-Life 2 Deathmatch\hl2mp\cfg - but can read configs inside inside the custom directory, providing that it uses a similar format (custom/custom_folder_name/cfg/*.cfg).

exec also supports file paths with folders inside them, too:
+exec dev_scripts\map_debug.cfg
Credits
CLANG-CLANG - Writer
Additional Commands
This is a similar style of guide, but intended for HL2 single player instead. Since Deathmatch (HL2MP) is so similar to HL2SP), most of these commands should still work (and even then, SourceMod + -insecure mode should expose them if they're hidden).
https://steamcommunity.com/sharedfiles/filedetails/?id=2598659064
Komentarzy: 1
[+] Hman [-] 14 lutego 2023 o 1:48 
very useful thanks