Skip to content

Cvars and commands

Roman Chistokhodov edited this page Sep 12, 2024 · 44 revisions

Cheat commands

Cheat commands can be quite useful while testing the maps.

  • buddha - Alternative to god. Player can take damage, but their health never gets lower than 1hp.
  • fire - trigger entity(-ies) by name (the first argument) or the entity in front of the player (if the argument is not provided). The special name !cross also means the entity in front of the player. The second (optional) argument is either on, off or set allows to change the input trigger type. If the second argument is set, the third argument is expected which is a number to set (can be used to set the value for game_counter, etc.). Note: the player is passed as an activator.
  • give_inventory and remove_inventory - give or remove player inventory item.
  • set_global_state and set_global_value - see Global variables.

See also: TWHL article about cheats in Half-Life

Client Commands

Some client commands are executed purely on client side without interacting with the server. Others are sent from client to the server (and usually can be bound to keyboard or mouse buttons).

Pure client commands:

  • hud_color - change the current HUD color (only available if hud_color.configurable feature is enabled).
  • test_particles - produce some particles. This is for ParticleMan testing.
  • dump_ammo_types_client - report ammo types as known to the client. Used for debugging.

Client commands sent to server:

  • nightvision - toggle nightvision (see Nightvision).
  • recruit_followers and disband_followers - fast ally recruiting, see Followers.

Server commands

To see the output of the following commands you must set developer cvar to 1 or higher.

  • report_ai_state - report AI state of all monsters with provided classname.
  • entities_count - print the current number of entities on the map at console.
  • calc_ratio - report a Calc Ratio of specified entity. See Math and Locus system.
  • calc_state - report state of specified entity (On or Off). See Master entities.
  • dump_ammo_types - report registered ammo types.
  • dump_precached_models and dump_precached_sounds - show the count and the list of precached models (including sprites and brush models) or sounds. Useful to keep track of the number of precached resources and to see what's exactly is being precached.
  • dump_sound_replacements - report sound replacements in use. See Sound replacement
  • dump_soundscripts - report soundscripts. See soundscript debugging

Server cvars

The following features are currently implemented as cvars, but they might be changed into the features configurable via featureful_server.cfg file.

  • pushablemode controls how func_pushables are pushed by a player.
    • -1 is for default Half-Life behavior before the anniversary update (the excessive acceleration is present).
    • 0 is for default Half-Life behavior in anniversary update.
    • 1 is for g-cont fix (used in some Xash3D mods). Allow player to push pushables by going back, left or right. Prevent excessive acceleration by ignoring the effect of +use when the regular forward push is applied.
  • pickup_policy controls how player can pick up items.
    • 0 is by touch only (like in Half-Life).
    • 1 is by pressing +use only.
    • 2 is for both by touch and pressing +use.
  • npc_tridepth. Triangulation depth to use when building paths for monsters. Possible values: 1, 2, 3. Note that higher values may affect the performance.
  • npc_tridepth_all. If set to 0, only player's followers and monsters in scripts will use the value specified by npc_tridepth as the triangulation depth, and other monsters will use the value 1. If set to 1, all monsters will use the value specified by npc_tridepth. Note that this may affect the performance.
  • npc_forget_enemy_time. If monster didn't observe its enemy for this amount of time (in seconds), the monster forgets about their enemy. Setting 0 means that monsters never forget their enemies (the standard behavior in Half-Life).
  • npc_active_after_combat. If set to 1, monsters will wander around a bit after the combat ends.
  • items_physics_fix - various attempts to fix some bugs with items that drop from breakables. Consult features/featureful_exe.cfg for the description.

Client cvars

  • cl_viewbob - disable or enable weapon bobbing.
  • cl_rollangle - angle of view rolling when player goes sideways. Set to 0 to disable viewroll.
  • cl_weapon_sparks - whether to create sparks from the bullet impact on the walls.
  • cl_weapon_wallpuff - whether to create a puff from the bullet impact on the walls.
  • cl_muzzlelight - whether some player weapons produce a dynamic light upon firing.
  • cl_flashlight_custom - whether to use a custom flashlight code.
  • cl_flashlight_radius - radius of light spot for a custom flashlight.
  • cl_flashlight_fade_distance - the distance the falloff of custom flashlight begins.
  • cl_nvgstyle - 0 means Opposing Force nightvision style. 1 means Counter-Strike nightvision style.
  • cl_nvgradius_cs - radius of dynamic light of Counter-Strike like nightvision.
  • cl_nvgradius_of - radius of dynamic light of Opposing Force like nightvision.
  • cl_subtitles - whether to show captions. For mods that use sound/captions.txt system.
  • hud_min_alpha - the minimum alpha values for HUD parameters like health, armor and ammo.
  • hud_scale - change the HUD sprites scale. 1 means original size. 0 means autoscale. Anything above 1 is upscale. Note that HUD scaling doesn't work in Software mode.
  • _satctrl - the Satchel Charge control scheme. 0 is classic (secondary attack throws more satchels, the detonation is always on the primary attack), 1 is anniversary (throw by primary attack, detonate by secondary attack).
  • _grenphys - the Hand Grenade physics. 0 is classic, 1 is anniversary (higher velocity).
  • cl_motd_vgui - whether the VGUI interface is preferred for MOTD (Message Of The Day) over the non-VGUI one (used in multiplayer). The client library must be built with VGUI support.
  • cl_scoreboard_vgui - whether the VGUI interface is preferred for Scoreboard in multiplayer. The client library must be built with VGUI support.

Multiplayer cvars

List of new multiplayer related cvars:

  • mp_allowmonsterinfo - show monsters' display names in multiplayer.
  • npc_dropweapons - enable/disable weapon dropping by monsters in multiplayer.
  • mp_weapon_respawndelay - control weapon respawn time.
  • mp_ammo_respawndelay - control ammo respawn time.
  • mp_item_respawndelay - control item respawn time.
  • mp_npckill - control whether ally npc can get damage in co-op game.
  • mp_respawndelay - delay player respawn.
  • mp_dropweapons - control whether players can drop their weapons.
  • mp_healthcharger_rechargetime - control wall medkit recharge time in multiplayer.
  • mp_hevcharger_rechargetime - control wall hev charger recharge time in multiplayer.
  • mp_dmgperscore - control how many points the player gets for dealing the damage in Co-op.
  • mp_allydmgpenalty - control how many points the player loses when deals damage to allies in Co-op.
  • mp_keepinventory - keep player inventory across changelevels in co-op.

Skill cvars

List of new cvars used to configure monsters, weapons and items parameters depending on the difficulty level. All given cvars come in 3 versions - for easy, normal and hard difficulties.

Monster cvars

Alien slave

  • sk_islave_zap_rate - rate of zap attack. In Half-Life it's hardcoded as 1 for easy and normal, and 1.5 for hard difficulty.
  • sk_islave_revival - 1 means alien slaves will try to revive their fallend comrades. By default it's 0 for easy and normal, and 1 on hard difficulty.
  • sk_vortigaunt_armor_charge - amount of armor charge the friendly alien slave can give to the player when player is low on armor.

Babygarg

  • sk_babygargantua_health
  • sk_babygargantua_dmg_slash
  • sk_babygargantua_dmg_fire
  • sk_babygargantua_dmg_stomp

Barnacle

  • sk_barnacle_health

Bullsquid

  • sk_bullsquid_toxicity - whether bullsquids can use the toxic attack. By default it's 0 on easy, and 1 on normal and hard difficulties.
  • sk_bullsquid_dmg_toxic_poison - the amount of poison damage inflicted by toxic projectile. If not specified, it depends on the sk_bullsquid_dmg_spit value.
  • sk_bullsquid_dmg_toxic_impact - the amount of acid damage inflicted by toxic projectile on impact. If not specified, it depends on the sk_bullsquid_dmg_spit value.

Floater

  • sk_floater_health
  • sk_floater_explode - the explosion damage.

Flybee

  • sk_flybee_health
  • sk_flybee_dmg_kick - melee attack damage.
  • sk_flybee_dmg_beam - beam damage.
  • sk_flybee_dmg_flyball - damage of every flyball projectile.

Panthereye

  • sk_panthereye_health
  • sk_panthereye_dmg_claw

Scientist

  • sk_scientist_heal_time - delay before scientist can heal again. In Half-Life it's hardcoded as 60 seconds.

Cleansuit scientist

  • sk_cleansuit_scientist_health

Otis

  • sk_otis_health

Opfor human grunt

  • sk_hgrunt_ally_health
  • sk_hgrunt_ally_kick
  • sk_hgrunt_ally_pellets
  • sk_hgrunt_ally_gspeed

Medic grunt

  • sk_medic_ally_health
  • sk_medic_ally_kick
  • sk_medic_ally_gspeed
  • sk_medic_ally_heal

Engineer

  • sk_torch_ally_health
  • sk_torch_ally_kick
  • sk_torch_ally_gspeed

Heavy weapon grunt

  • sk_hwgrunt_health

Osprey

  • sk_osprey

Blackops Osprey

  • sk_blkopsosprey

Male assassin

  • sk_massassin_health
  • sk_massassin_kick
  • sk_massassin_gspeed

Female assassin

  • sk_hassassin_cloaking - whether the cloaking is enabled. By default it's set to 0 on easy and normal, and to 1 on hard difficulty (replicating the behavior from Half-Life).

Pitdrone

  • sk_pitdrone_health
  • sk_pitdrone_dmg_bite
  • sk_pitdrone_dmg_whip
  • sk_pitdrone_dmg_spit

Shock roach

  • sk_shockroach_health
  • sk_shockroach_dmg_bite
  • sk_shockroach_lifespan

Shock trooper

  • sk_shocktrooper_health
  • sk_shocktrooper_kick
  • sk_shocktrooper_gspeed
  • sk_shocktrooper_maxcharge
  • sk_shocktrooper_rchgspeed

Voltigore

  • sk_voltigore_health
  • sk_voltigore_dmg_punch
  • sk_voltigore_dmg_beam
  • sk_voltigore_dmg_explode cvar

Baby voltigore

  • sk_babyvoltigore_health
  • sk_babyvoltigore_dmg_punch

Pitworm

  • sk_pitworm_health
  • sk_pitworm_dmg_swipe
  • sk_pitworm_dmg_beam

Geneworm

  • sk_geneworm_health
  • sk_geneworm_dmg_spit
  • sk_geneworm_dmg_hit

Robogrunt

  • sk_rgrunt_explode

Robocop

  • sk_robocop_health
  • sk_robocop_dmg_mortar - explosion damage on beam attack.
  • sk_robocop_dmg_fist - fist attack damage.
  • sk_robocop_sw_radius - radius of fist attack wave.

Zombified security guard

  • sk_zombie_barney_health
  • sk_zombie_barney_dmg_one_slash
  • sk_zombie_barney_dmg_both_slash

Zombified soldier

  • sk_zombie_soldier_health
  • sk_zombie_soldier_dmg_one_slash
  • sk_zombie_soldier_dmg_both_slash

Gonome

  • sk_gonome_health
  • sk_gonome_dmg_one_slash
  • sk_gonome_dmg_guts
  • sk_gonome_dmg_one_bite

Weapons cvars

  • sk_357_bullet - damage dealt by monsters desert eagle (otis, engineer, medic grunt)
  • sk_556_bullet - damage dealt by monsters SAW machine gun (opfor grunt)
  • sk_762_bullet - damage dealt by monsters sniper rifle (male assassin)
  • sk_plr_pipewrench
  • sk_plr_knife
  • sk_plr_grapple
  • sk_plr_eagle
  • sk_plr_uzi
  • sk_plr_556_bullet
  • sk_plr_762_bullet
  • sk_plr_medkitshot
  • sk_plr_shockroachs
  • sk_plr_shockroachm
  • sk_plr_spore
  • sk_plr_displacer_other
  • sk_plr_displacer_radius
  • sk_mortar - damage of op4mortar and func_mortar_field shells

Items cvars

  • sk_soda - amount of health recovered by soda can. In Half-Life it's hardcoded as 1 for all difficulties.
  • sk_flashlight_drain_time - time in seconds for flashlight to fully drain its battery. By default it's 120 seconds (like in Half-Life).
  • sk_flashlight_charge_time - time in seconds for flashlight to fully recharge. By default it's 20 (like in Half-Life).

Player cvars

  • sk_plr_armor_strength - the armor strength relative to health strength. By default in Half-Life 1 armor point has the same strength as 2 health points.

World objects cvars

  • sk_zaptrap_sense_radius - the distance at which the env_energy_ball_trap starts to sense the player.
  • sk_zaptrap_respawn_time - the respawn time of the projectile.

Experimental cvars

These should be used with care as they change some fundamental behavior. The use of the experimental cvars is discouraged.

  • use_through_walls cvar to enable/disable using things through walls without the need for setting 'Direct Only' flag for entites (probably will be made into compile-time feature). Currently broken with some triggers, e.g. func_tankcontrols.
  • npc_nearest cvar for following monsters to let them find the nearest path to the player even if they can't build the path right to the player.
  • grenade_jump allows to disable changing the vertical velocity of player when hit by explosives.