TF2 Console Commands, Part 2

A Tutorial for Team Fortress 2

Updates

TutorialParentSubmitterStats
  • Addition Added trigger_ignite_arrows Entity Explanation.
Version 11 BETA 1 8mo
  • Addition Added tf_generic_bomb Entity Explanation.
  • Addition Added tf_generic_bomb's Keyvalues, Inputs and Outputs.
Version 11 ALPHA 3 8mo

Welcome To the Second part Of TF2 Console Commands!

Well,

Here's The First Part of This Tutorial:
  1. TF2 Console Commands

Wait a Second..

The Third Part Was Released!

TF2 Console Commands, Part 3


Now.

Time To Continue!

Now, lights.

Lights?, Lemme Explain.

In TF2, Is Possible to Spawn Lights!

But Which Lights is Possible to Spawn?

For Example:

  • light_dynamic

    light_dynamic is a point entity available in all Source games. It is an invisible light source that changes over time. Can be turned on and off through inputs, and can aim at any object, including moving ones. Dynamic lights are calculated on the fly in the game, which means they have a higher processing cost but are much more flexible than static lighting. It is also the only entity except env_projectedtexture that can light up brushes at real-time (But it doesn't replace their original lighting). Note:This entity actually consists of two lights, a cone model light and a spot world light. Some values may affect one and not the other. Note:For the light to work properly the "distance" keyvalue must be greater than the distance from the entity to the surface it is supposed to light, otherwise it will not show. Also, the "brightness" keyvalue should be either 6 or 8, normal brightness values do not apply. Finally, adjusting the angle using the circle tool in the top-right or by using the "point at" tool will only adjust the cone model, the angle keyvalue must be set manually to adjust the spot world light. Note:For the 2013 SDK this is limited to 17 lights on at any one time so use wisely.
  • light_spot

    light_spot is a point entity available in all Source games. It is a cone-shaped, invisible light source. Can be turned on and off through inputs, though switchable lights may cause lightmap errors. This is a static spotlight that can be pointed at another entity. Note:When using this entity it is often necessary to turn the brightness value up significantly for the effects of the light to be visible. Values of 3000-4000 are sometimes necessary for light sources like streetlights. Warning:Naming a static light radically changes its behavior. See Naming Lights for details

Now, more new addconds.

Reminder:

"The addcond command applies a player condition to the user. The addcond command must be followed by a number, such as addcond 5. The duration of the condition can be set by following the command with a second number, such as addcond 5 10, where 10 is the duration in seconds. The effects can usually be removed via removecond followed by the corresponding number, and bots can be given conditions by using bot_command with addcond"

  1. addcond 120 - Listed internally as TF_COND_GRAPPLED_TO_PLAYER.
  2. addcond 121 - Listed internally as TF_COND_GRAPPLED_BY_PLAYER.
  3. addcond 122 - Listed internally as TF_COND_PARACHUTE_DEPLOYED, added when deploying the B.A.S.E. Jumper.
  4. addcond 123 - Gas coating effect from the Gas Passer.
  5. addcond 124 - Afterburn effect applied to Pyros when hit by the Dragon's Fury projectile.
  6. addcond 125 - Listed internally as TF_COND_ROCKETPACK. Applied when the boosters on the Thermal Thruster activate. Removed when the player touches the ground.
  7. addcond 126 - Listed internally as TF_COND_LOST_FOOTING. When added while moving, decreases the player's friction, causing them to slide around. Removed when the player stops moving.
  8. addcond 127 - Listed internally as TF_COND_AIR_CURRENT.

Second Reminder:

Pictogram comment.png Most of the conditions added with addcond will remain for an indefinite duration if no duration is specified, ending when the user dies, changes classes, or manually removes the condition with the removecond command. Some conditions (e.g. 5, 11) can be removed by being healed by a Medic.

Pictogram comment.png Invalid condition numbers will use the closest valid condition.

Now, tf_generic_bomb.

tf_generic_bomb?, Lemme Explain

tf_generic_bomb is an explosive hazard. It functions identically to the tf_pumpkin_bomb, but you can change the damage, explosive radius, explosion particles, and the explosion sound.

For Example:

  1. ent_create tf_generic_bomb models/player/demo.mdl damage 200 radius 300 friendlyfire 1 - Spawns a Generic bomb with Demoman's model and with friendly fire 1 on it. (Meaning that you can damage everyone, even your teammates.)

BUT..

Some models can't have good collisions for tf_generic_bomb.

tf_generic_bomb's Keyvalues, Inputs and Outputs.

Keyvalues:

  1. damage(float) : "Explosion Damage" : 50 : "Amount of damage to do when exploding."
  2.         radius(float) : "Explosion Radius" : 100 : "Explosion radius."
  3.         health(integer) : "Health" : 1 : "Health of the bomb."
  4.         explode_particle(string) : "Explosion Particle" : "" : "Name of the particle effect to play when exploding."
  5.         sound(sound) : "Explosion Sound" : "" : "Name of the sound effect to play when exploding."
  6.         friendlyfire(choices) : "Friendly Fire" : 0 =
  7.         [
  8.                 0 : "Damage attacker and enemies"
  9.                 1 : "Damage everyone"
  10.         ]

Inputs:

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. Bug:

In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.

 Warning:Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.

CallScriptFunction  <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity. Note:This input is missing from some games FGD files.

SetLocalOrigin  <origin> (New with Alien Swarm) !FGD
Set this entity's origin in the map. Note:This input is missing from some games FGD files.

SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles in the map. Note:This input is missing from some games FGD files.

  1. Detonate - Force detonation

OnDetonate

Fired when this bomb detonates.

Now, wheel_of_doom.

wheel_of_doom?, Lemme Explain.

The WOD will pick a random card when the koth point changes owner. Each card has an effect. Known effects include:

  • Everyone gets übercharged
  • Everyone gets critical hits
  • Everyone gets super speed
  • Everyone moonjumps (low gravity)
  • Everyone highjumps (normal gravity but higher jump velocity and no fall damage)
  • Everyone gets super small heads
  • Everyone gets super big heads
  • Everyone is lit on fire
The following effects requires special setup outside of the wheel_of_doom entity.

  • Thriller taunt; Requires 32 info_target entities named along the pattern dance_teleport_[team][number up to 15 starting with 0].
  • Jarate is dropped from the sky; requires a func_brush above the map named spawn_cloud.
  • Ghosts appear; requires allowHaunting to be enabled in a tf_logic_holiday entity.

That Means, you can use the Wheel Of Doom on others map!

For Example:

  1. ent_create wheel_of_doom effect_duration 10 targetname wheel01 - Creates a Wheel Of Doom.
  2. ent_fire wheel01 spin - Forces the Wheel of Doom spins.

wheel_of_doom's Keyvalues, Inputs and Outputs:

Keyvalues

has_spiral <boolean>
Show the spiral effect?
effect_duration <float>
How long effects should last before they are automatically removed.

Inputs

Spin
Spin the wheel.
ClearAllEffects
Remove all active effects.

Outputs

OnEffectApplied
Effect just applied.
OnEffectExpired
Effect just expired.

Now, trigger_ignite_arrows.

trigger_ignite_arrows?, Lemme Explain.

Area used to mark spots that will ignite arrows.

For Example:

  1. ent_create trigger_ignite_arrows model *1 - Creates a trigger_ignite_arrows with model *1.

Now, impulses.

Impulses?, Lemme Explain.

Impulse 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.

Here The List:

  1. 101 = Refills all weapons and health (like Resupply).
  2. 102 = Spawns human skull.
  3. 106 = Identifies model being aimed at.
  4. 107 = Identifies texture being aimed at. 
  5. 200 = Plays holster/draw animations.
  6. 201 = Sprays your selected spray.
  7. 202 = Plays a custom sound to players who have set cl_customsounds 1. The sound is configured using cl_soundfile filename.wav.
  8. Removes object being aimed at like ent_remove and ent_fire _____ kill, but doesn't print "Removed [entity name] (Name)" in the console.
  9. 221 - 239 = If the player is a Spy, starts the disguise process. 221-229 are for a RED disguise, while 231-239 are for a BLU disguise (230 is non-functional). The final digit selects the disguise class, but this number does not correspond to the class numbers shown on the class selection screen.

Example:

  1. impulse 101
  2. impulse 201

But Remember.

Some Of them Doesn't require sv_cheats 1.

Now, some more ent_create commands.

Thoses ent_create commands are from the Team Fortress 2 Wiki - Cheats.

  1. ent_create npc_handgrenade - spawns a grenade that explodes instantly, dealing area damage.
  2. ent_create hightower_teleport_vortex teamnum 2 lifetime 5, spawns a RED Monoculus purple vortex that will suck any player that get close to it.
  3. ent_create item_teamflag GameType 1 TeamNum 3 flag_model models/props_td/atom_bomb.mdl, spawns a Mann vs. Machine bot bomb.
  4. ent_create ambient_generic message ui/gamestartup18.mp3 health 10, spawns Rise of the Living Bread music or any sound from the game.
  5. ent_create tf_spell_pickup, spawns a spell-book which will grant the player a random magic spell when picked up, see Magic spells.
  6. ent_create tf_spell_pickup tier 1, spawns a rare spell-book which will grant the player a random rare magic spell when picked up, see Rare Magic Spells.

Now, obj_sentrygun's Keyvalues.

  1. modelscale <numbers>: Sets model scale.
  2. teamnum <2/3/5>: Team RED/BLU/BOSS (values other than 2 or 3 will spawn a BLU building that will be attacked by both teams, but if it is a Sentry it will only attack BLU)
  3. defaultupgrade <0/1/2>: Level 1/2/3 building
  4. spawnflags <number>: Examples include spawnflags 2 for invulnerability, 4 to make the building upgradable, and 8 to give Sentry Guns infinite ammo. Summing spawnflags can give you multiple effects, for example, 14 would make the building invulnerable, upgradable, and have infinite ammo.

For Example:

  1. ent_create obj_sentrygun teamnum 2 defaultupgrade 2 spawnflags 8 spawns a level 3 RED Sentry Gun with infinite ammo

Now, func_croc.

func_croc?, Lemme Explain.

func_croc is a brush entity available in Team Fortress 2.

Crocs live here!

For Example:

  1. ent_create func_croc model *1 targetname croc01 - Spawns a func_croc with Brush model 1.

Here how it looks like in-game.


A func_croc in action. If a player passes on the brush entity, a crocodile appears and kills the player.

func_croc's Keyvalues, Inputs and Outputs:

Keyvalues

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Note:Try to avoid expensive operations in this function, as it may cause performance problems.

TFTeam (teamnum):

Team <choices>
Team
  • 0 : Any
  • 2 : Red
  • 3 : Blue

Inputs

Targetname:

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. Bug:

In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.

 Warning:Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.

CallScriptFunction  <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity. Note:This input is missing from some games FGD files.

SetLocalOrigin  <origin> (New with Alien Swarm) !FGD
Set this entity's origin in the map. Note:This input is missing from some games FGD files.

SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles in the map. Note:This input is missing from some games FGD files.

EnableDisable:

Enable
Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

Targetname:

OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  
(New with Left 4 Dead)

This Output fires when the entity is killed and removed from the game.

Now, game entities.

Game Entities?, Lemme Explain.

With Game Entities, You can use them for various things.

For Example:

  • Force Spawning.
  • Making Texts appear on Screen.
  • Force round victory and etc.

But.. Which entities?

  1. game_round_win = Tells the game rules that the round has either been won (if a team is assigned) or enter Sudden Death mode (if no team is assigned).
  2. game_forcerespawn = Removes buildings, grenades, etc., from the world and forces all players to respawn (without being killed).

And etc.

But.. How to Use these Game Entities?

With ent_fire.

For Example:

  1. ent_fire game_forcerespawn ForceRespawn - Force players to respawn and remove buildings, grenades, etc., from the world..
  2. ent_fire game_round_win RoundWin - Tell the game rules the round is over.

BUT..

If you to change the entity's team (this is used to determine which team has won the round (0 = none). (game_round_win)

You Just Need:

  1. ent_fire game_round_win SetTeam 0-3 

Team <choices>
Setting this to none will result in Sudden Death or a Stalemate, depending on the server's choice.
  • 0 : None
  • 2 : Red
  • 3 : Blue
And Done.

Now, bots entities.

Bots entities?, Lemme Explain.

In TF2,  It's possible to use entities to create Bots!

But Which Entities?

For Example:

  1. bot_controller
  2. bot_generator

And etc..

But How to use these bot's entities?

with ent_fire..

For Example:

bot_controller

An entity used to create a bot, and then issue commands to it.

Example:

  1. ent_create bot_controller bot_name "Pure Demo" bot_class 4 teamnum 2 targetname controller01
  2. ent_fire controller01 CreateBot

Congrats!, You just created a Bot!

But How to control The Created Bot?

with ent_fire.

For Example:

  1. ent_fire controller01 AddCommandMoveToEntity demo - Add a command to the bot's queue, telling it to move to the specified entity.

BUT..

If you want that your Bot move to you..

You Just Need to:

  1. ent_fire !self addoutput "targetname soldier" - Changes your targetname to soldier.
  2. ent_fire bot_controller AddCommandMoveToEntity soldier - Forces your bot move to you.

BUT..

Remember, if the map has a entity with targetname called Soldier..

You will need to change your targetname to a different one
, it can be anything you want.

For Example:

  1. ZeDemo
  2. 1391
  3. Boxes

And etc..

BUT..

If your bot it's stuck..

You Just Need to:

  1. ent_setname magicbot - Change entity's targetname. (You need to look at your created bot and then use ent_setname command.)
  2. ent_teleport magicbot - Teleports your bot at your aim.

BUT..

If you want to your bot stop.

You Just Need to:

  1. ent_fire controller01 ClearQueue - Clear the bot's command queue.

Here the bot_controller's inputs and outputs.

Inputs

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
CreateBot
Create the bot for this controller.
RespawnBot
Force the bot to respawn.
AddCommandMoveToEntity  <targetname>
Add a command to the bot's queue, telling it to move to the specified entity.
AddCommandAttackEntity  <targetname>
Add a command to the bot's queue, telling it to attack the specified entity.
AddCommandSwitchWeapon  <integer>
Add a command to the bot's queue, telling it to switch to the specified weapon slot.
AddCommandDefend  <float>
Add a command to the bot's queue, telling it to defend the position it's standing at. The parameter specifies the distance from the point that the Bot is allowed to move to fight enemies.
SetIgnoreHumans  <integer>
Set whether or not the Bot should ignore human players. 1 = ignore, 0 = don't ignore.
PreventMovement  <integer>
Set whether or not the Bot is allowed to move. 1 = prevent movement, 0 = allow movement.
ClearQueue
Clear the bot's command queue.

Outputs

OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnForceRespawn
Sent when the entity respawns the players.

Now, bot_npc_archer

bot_npc_archer?, Lemme Explain.

This is a NextBot using the models\player\sniper.mdl model which wields a Huntsman. This entity will move only if a valid navigation mesh exists.

This entity is NOT a bot. As such, it will not take any player slot.

For Example:

  1. ent_create bot_npc_archer - Creates a NextBot using the Sniper's model which wields a Huntsman.

bot_npc_archer's Behavior

Once spawned, this entity will always rejoin its original spawn point before it can attack, unless there is not any valid navigation mesh file.

It will go into humiliation pose unless if one of the following entities is present on the map:

If at least one of those entities exists, the archer will shoot any BLU player which can be attacked.

 Note:The entity aims the BLU players heads and according to the player's speed. As such, he can kill moving targets.

 Bug:

The entity does not compensate for gravity when shooting. The archer will still attempt to shoot at very far targets but his arrows will always miss.

 Bug:

When spawned using the ent_create bot_npc_archer command, this entity will try to rejoin the origin of the map, if a navigation mesh file is present. This is because the command causes the game to spawn the entity to the origin of the map, and then teleports it to where the player is looking (if possible).

 Note:When a BLU player is killed by a headshot from this entity, the kill feed will display an environmental headshot death icon. In the case of a bodyshot, a regular environmental death will be shown.

And Done..

That's It!

But Don't Worry..

I will put more Commands and Explanation on this Tutorial! (if i have free time to put more commands..)

Bye!

Updates:

Version 11 BETA 1 (Minor Update)

  • -Added trigger_ignite_arrows explanation

Version 11 ALPHA 3 (Minor Update)

  • -Added tf_generic_bomb explanation.
  • -Added tf_generic_bomb's Keyvalues, Inputs and Outputs.

Version 11 ALPHA 2 (Minor Update)

  • -Added func_croc explanation.
  • -Added func_croc Keyvalues, Inputs and Outputs.

Version 11 ALPHA 1 (Minor Update)

  • -Added wheel_of_doom Entity explanation.
  • -Added wheel_of_doom's Keyvalues, Inputs and Outputs.

Version 10.4 (Minor Update)

  • -Added new addconds.

Version 10.1 (Medium Update)

  • -Added bot's entities explanation.
  • -Added bot_controller explanation.
  • -Added bot_controller's Inputs and outputs.
  • -Added bot_npc_archer explanation.

Version 9.5 (Minor Update)

  • -Added game's entities explanation.

Version 9.4 (Minor Update)

  • -Added obj_sentrygun's Keyvalues
  • -Added more ent_create commands.

Version 8.9 (Minor Update)

  • -Added impulse explanation and list.

Version 8.1 (Minor Update)

  • -Added light explanation.
Sign up to access this!

Todos

Outputs Explanation

Posts

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Creators
Lukaswbrr avatar
Lukaswbrr username pic Joined 3y ago
Offline
109 points Ranked 29631st
Creator of this tutorial.
Special Thanks
Team Fortress 2 Wiki
For the console commands wiki.
Valve Developer Community
For the inputs, entities, outputs list.

Submitter

Lukaswbrr avatar
Lukaswbrr username pic Joined 3y ago
Offline
109 points Ranked 29631st

Lukaswbrr avatar
Lukaswbrr

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Beginner

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Share on Google+

Stats

  • 5.3k Views
  • 15 Posts
  • 1ySubmitted
  • 7moModified
  • 8moUpdated

Scores

80 bScore
9 Rating

1 voter

Sign up to access this!

More from Submitter

More Other/Misc Tutorials

bcp.crwdcntrl.net tracking pixel