Ent fire
Jump to navigation
Jump to search
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 <targetname> <input name> <optional parameter> <optional delay>
- This would fire the <input name> input on all entities matching <targetname>. The input will be contain the <optional parameter> if it was specified. The input will be fired immediately, unless the <optional 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 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 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 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.