Ent fire: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(→Usage) |
||
Line 19: | Line 19: | ||
***<code>ent_fire npc_barney Ignite</code> | ***<code>ent_fire npc_barney Ignite</code> | ||
***:This would find all entities with a matching classname or targetname and ignite them. | ***:This would find all entities with a matching classname or targetname and ignite them. | ||
***<code>ent_fire player Ignite</code> | |||
***:In a multiplayer game with cheats on, lights all players on fire. | |||
==See also== | ==See also== |
Revision as of 16:04, 15 August 2005
The ent_fire
console command is a debugging tool that fires inputs on entities. It's an essential tool for both programmers and mapmakers, allowing them to easily debug problems in a map's entity logic.
Different entities can handle different inputs. The easiest way to find out what inputs an entity handles is to use ent_fire's
built in autocomplete. Type ent_fire <targetname>
in the console, and the autocomplete system will give you a list of all the inputs known to the entity it found matching the <targetname>. If that doesn't work, the other easy way is to load up Hammer and place an entity of the same type, and look at the help for that entity. Entities will ignore inputs that they don't know how to handle.
Usage
ent_fire <classname or targetname> <input name> <optional parameter> <optional delay>
- This would fire the specified input on all entities with a matching classname or targetname. The input will be contain the overriden parameter if it was specified. The input will be fired immediately, unless the delay was specified, in which case that amount of time will be passed before it is sent.
- Examples:
ent_fire relay_start_assault Trigger
- This would find all entities with classnames or targetnames of "relay_start_assault", and call their "Trigger" input. Assuming that "relay_start_assault" is a logic_relay, this would cause it to trigger and fire all its outputs. Very useful for debugging a part of a large chunk of entity logic in a map.
ent_fire bob_the_soldier SetHealth 5
- This would find all entities with classnames or targetnames of "bob_the_soldier", and call their "SetHealth" input, with a parameter of "5". Basically, the NPC named "bob_the_soldier" would have his health set to 5.
ent_fire !picker Kill
- This would find the entity currently under the crosshair, and call the "Kill" input. The "!picker" targetname is a special targetname that finds the entity under the crosshair. The "Kill" input is known to all entities, and basically tells the entity to immediately remove itself.
ent_fire counter_combat_* Add 1
- This would find all entities with classname or targetname matching the wildcard "counter_combat_*", and fire their "Add" input with a parameter of "1". Assuming all the entities found are math_counters, this will add 1 to their current counter values.
ent_fire npc_barney Ignite
- This would find all entities with a matching classname or targetname and ignite them.
ent_fire player Ignite
- In a multiplayer game with cheats on, lights all players on fire.