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

Impulse: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Use template instead of link)
 
(62 intermediate revisions by 32 users not shown)
Line 1: Line 1:
A [[console command]] which can do lots of different stuff depending on its numeric parameter.
{{LanguageBar}}
{{TabsBar}}
{{split|based on engine}}
{{This is a|console command|name=impulse|engine=Source|engine1=Source 2}}
__NOTOC__
It is a generic client-side [[console command]] that is used to send commands to the [[server]] without modifying the [[usercmd]].


Here is a list. All impulses marked as a cheat will require [[sv_cheats]] to be enabled.
The advantage is that new commands can be added without compatibility-breaking networking changes; the disadvantage is that only one impulse can be sent at a time, and that the commands themselves are non-descriptive.
==Syntax==
 
{{Syntax|impulse <number>}}
{{confirm|Impulses are not [[prediction|predicted]].}}
==Impulse List==
 
Syntax:<pre>impulse NUMBER</pre>
 
Impulse commands are generally used for development functions and/or cheats, and almost all require {{cmd|sv_cheats}}. See <code>[[CBasePlayer]]::ImpulseCommands()</code>, <code>CBasePlayer::CheatImpulseCommands()</code> and <code>CHL2_Player::CheatImpulseCommands()</code>.
 
==Impulses==
===General===
===General===
These commands are used in-game by default.
These are available in most or all GoldSrc, Source and Source 2 games.
;impulse 100:Toggles the flashlight on/off for the player.<br/>Default key: <code>F</code>
{| class="standard-table"
! #
! Notes
! Description
|-
!76
| Works only in {{bms}}.
| Caches human grunt when first used, then creates {{ent|npc_human_grunt}} which is partially submerged under floor. Mentioned in {{srcsdk|4}} despite the complete absence of this [[NPC]].
|-
|-
!81
|
| Gives the player a {{ent|weapon_cubemap}}, used to test [[cubemaps]].
|-
!100
| Not a cheat (except in {{portal2}})
| Toggle the player flashlight. Might require {{ent|item_suit}} or cheats {{portal2|only}} enabled, depending on the game. Bound to '''F''' by default.
|-
!101
|
| In {{hl2|4}} gives player 25 health (if the player's health is less than 100) with suit and weapons with full ammo.


===[[Half-Life 2]]===
In {{portal|4}} also gives fully charged [[weapon_portalgun|portal gun]].
;impulse 50:Makes player command (call/send) a squad.<br/>Default key: <code>C</code>
;impulse 51:Spawns [[item_dynamic_resupply]].
;impulse 52:Rangefinder. Prints Starting position, ending position, 3D distance and 2D distance.


===Spawn Commands===
In {{portal2|4}} only fully charged portal gun. In {{p2ce|4}} gives fully charged portal gun and fully charged [[weapon_paintgun|paint gun]].
;impulse 82:Cheat. Spawns an armed [[prop_vehicle_jeep|buggy]].
;impulse 101:Commonly used cheat. Gives the player all weapons, extra ammo, extra health and extra energy. (Can also be used In counter strike source to fill up the players cash reserves)
;impulse 102:Cheat. Spawns a human skull. (The ''models\Gibs\AGIBS.mdl'' gib.) It spawns a more dynamic set of gibs in [[Half-Life: Source]].


===Other Commands===
In {{bms|4}} it does the same thing as in {{hl2|4}}, doesn't give [[item_longjump|long jump module]].
;impulse 81:Cheat. Gives the player [[weapon_cubemap]] which is useful for checking cubemaps.
;impulse 103:Cheat. Reports status (AI, health, etc.) of the NPC under the crosshairs.
;impulse 106:Cheat. Displays the classname, targetname and modelname of the entity under the crosshairs.
;impulse 107:Cheat. Prints what texture the crosshairs are pointing at.
;impulse 108:Cheat. Debugs the NPC under the crosshairs.
;impulse 200:Cheat. Toggles between lowering/raising the weapon completely, clearing it from the screen, useful for taking screenshots.
;impulse 203:Cheat. Remove the entity under the crosshairs.
 
===Multiplayer games===
;impulse 201:Paints decal in multiplayer.<br />Default key: <code>T</code>


In {{tf2|4}} it refills health and ammo for all weapons.
|-
!102
|
| Spawns a [[VPhysics]] human skull (<code>models\Gibs\AGIBS.mdl</code>) from inside the player (might land behind you). Meant to spawn a "random" gib and seems to be used in {{hls|4}}.
|-
!103
|
| Prints [[AI]] state of the [[NPC]] the player is looking at to the console. Requires {{cmd|developer|1}}.
|-
!106
|
| Prints the class, [[targetname]] and [[model]] of the entity under the crosshairs to the console.
|-
!107
|
| Prints the material that player is looking at to console. Only works on brushes: use {{cmd|mat_crosshair}} instead, which works on displacements too.
|-
!108
|
| Starts debugging on NPC under the crosshair.
|-
!195, 196, 197
| Nonfunctional, creates nonexistent entity that used to exist in {{goldsrc|4}}
| {{goldsrc|2}} leftover supposed to show the shortest path to the nearest air, large, and human nodes respectively.
|-
!200
|
| Plays the current [[viewmodel]]'s holster animation. Doesn't actually prevent attacking. (The current weapon just won't be visible.) Not all weapons have holstering sequences.
|-
!201
| Not a cheat
| Creates a player [[spraycan|spray]] on the brush under the crosshair. Use '''Options, Multiplayer''' to set a spray. Default key is '''T'''.
|-
!202
| Obsolete
| Spray blood over the [[brush]] under the crosshair.
|-
!202
| Not a cheat
| Plays a "player jingle" soundfile. To enable hearing/playing jingles, set {{cmd|cl_customsounds|1}}. Set the sound file for a jingle using {{cmd|cl_soundfile|<file path relative to game folder>}}. Sound files must be Source-compatible [[WAV]] files under 128KB (512KB in newer engines). Jingles function using the same system as sprays, and are subject to the same anti-spam cooldown. {{note|This works with the SDK codebase, but games seem to typically disable jingles.}}
|-
!203
|
| Removes the entity under the crosshairs. Same as {{cmd|ent_remove}}.
|}


===[[Half-Life 2]]===
{| class="standard-table"
! #
! Notes
! Description
|-
! 50
| Not a cheat
| Makes player command (call/send) a squad. Bound to '''C''' by default.
|-
! 51
| Not a cheat (in DM)
| Spawns {{ent|item_dynamic_resupply}}.
|-
! 52
|
| Rangefinder. Prints Starting position, ending position, 3D distance and 2D distance.
|-
! 82
|
| Spawns an armed {{ent|prop_vehicle_jeep}}. Same as {{cmd|ch_createjeep}}.
|-
! 83
|
| Spawns a {{ent|prop_vehicle_airboat}}. Same as {{cmd|ch_createairboat}}.
|}


===Nonfunctional===
===[[Counter-Strike: Global Offensive]]===
;impulse 195:Cheat. Would show the shortest path in the level to the nearest node_viewer_fly node.
{| class="standard-table"
;impulse 196:Cheat. Would show the shortest path in the level to the nearest node_viewer_large node.
! #
;impulse 197:Cheat. Would show the shortest path in the level to the nearest node_viewer_human node.
! Notes
;impulse 202:Would play 'player jingle'.
! Description
;impulse 202:Cheat. Would splatter blood decal.
|-
! 100
| Not a cheat
| Start weapon inspection.
|-
! 202
|
| Doesn't work.
|}

Latest revision as of 03:41, 7 July 2025

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)
edit

Split-arrows.png Split

It has been suggested that this article or section be split into multiple articles: based on engine. (Discuss)

impulse is a console command available in all Source Source and Source 2 Source 2 games.

It is a generic client-side console command that is used to send commands to the server without modifying the usercmd.

The advantage is that new commands can be added without compatibility-breaking networking changes; the disadvantage is that only one impulse can be sent at a time, and that the commands themselves are non-descriptive.

Confirm:Impulses are not predicted.

Syntax:

impulse NUMBER

Impulse commands are generally used for development functions and/or cheats, and almost all require sv_cheats. See CBasePlayer::ImpulseCommands(), CBasePlayer::CheatImpulseCommands() and CHL2_Player::CheatImpulseCommands().

Impulses

General

These are available in most or all GoldSrc, Source and Source 2 games.

# Notes Description
76 Works only in Black Mesa. Caches human grunt when first used, then creates npc_human_grunt which is partially submerged under floor. Mentioned in Source SDK Source SDK despite the complete absence of this NPC.
81 Gives the player a weapon_cubemap, used to test cubemaps.
100 Not a cheat (except in Portal 2) Toggle the player flashlight. Might require item_suit or cheats (only in Portal 2) enabled, depending on the game. Bound to F by default.
101 In Half-Life 2 Half-Life 2 gives player 25 health (if the player's health is less than 100) with suit and weapons with full ammo.

In Portal Portal also gives fully charged portal gun.

In Portal 2 Portal 2 only fully charged portal gun. In Portal 2: Community Edition Portal 2: Community Edition gives fully charged portal gun and fully charged paint gun.

In Black Mesa Black Mesa it does the same thing as in Half-Life 2 Half-Life 2, doesn't give long jump module.

In Team Fortress 2 Team Fortress 2 it refills health and ammo for all weapons.

102 Spawns a VPhysics human skull (models\Gibs\AGIBS.mdl) from inside the player (might land behind you). Meant to spawn a "random" gib and seems to be used in Half-Life: Source Half-Life: Source.
103 Prints AI state of the NPC the player is looking at to the console. Requires developer 1.
106 Prints the class, targetname and model of the entity under the crosshairs to the console.
107 Prints the material that player is looking at to console. Only works on brushes: use mat_crosshair instead, which works on displacements too.
108 Starts debugging on NPC under the crosshair.
195, 196, 197 Nonfunctional, creates nonexistent entity that used to exist in GoldSrc GoldSrc GoldSrc GoldSrc leftover supposed to show the shortest path to the nearest air, large, and human nodes respectively.
200 Plays the current viewmodel's holster animation. Doesn't actually prevent attacking. (The current weapon just won't be visible.) Not all weapons have holstering sequences.
201 Not a cheat Creates a player spray on the brush under the crosshair. Use Options, Multiplayer to set a spray. Default key is T.
202 Obsolete Spray blood over the brush under the crosshair.
202 Not a cheat Plays a "player jingle" soundfile. To enable hearing/playing jingles, set cl_customsounds 1. Set the sound file for a jingle using cl_soundfile <file path relative to game folder>. Sound files must be Source-compatible WAV files under 128KB (512KB in newer engines). Jingles function using the same system as sprays, and are subject to the same anti-spam cooldown.
Note.pngNote:This works with the SDK codebase, but games seem to typically disable jingles.
203 Removes the entity under the crosshairs. Same as ent_remove.

Half-Life 2

# Notes Description
50 Not a cheat Makes player command (call/send) a squad. Bound to C by default.
51 Not a cheat (in DM) Spawns item_dynamic_resupply.
52 Rangefinder. Prints Starting position, ending position, 3D distance and 2D distance.
82 Spawns an armed prop_vehicle_jeep. Same as ch_createjeep.
83 Spawns a prop_vehicle_airboat. Same as ch_createairboat.

Counter-Strike: Global Offensive

# Notes Description
100 Not a cheat Start weapon inspection.
202 Doesn't work.