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

ent_text

From Valve Developer Community
Jump to navigation Jump to search
English (en)Русский (ru)Translate (Translate)

ent_text is a console command available in all Source Source games.

Theent_textconsole command is a debugging tool for examining an entity's internal state. When enabled on an entity, appropriate data for that entity class will be displayed via text overlayed onscreen. It's extremely useful for debugging entity logic problems and AI problems.

Note.pngNote:The game must be in Developer mode for this command to work properly.


Example

Ent_text display for an NPC and a prop_physics in HL2's d1_trainstaion_03.bsp

An example of ent_text in action. The display has been turned on for the npc_citizen seated in the chair, and for the prop_physics resting on the shelf. See below for a breakdown of the information displayed.

Notes

The information displayed for an entity by the ent_text command differs for each entity type. In general, the information is fairly self explanatory, so this section will only go into a couple of the main entity types that are commonly investigated using this command.

  • Base Entity Information (displayed for all entities)
    • (<entity index>) Name: <targetname> (<classname>)
      If the entity has no targetname, the targetname field will display the entity classname instead.
  • Model Information (displayed for all entities that use models)
    • Model: <model name>
    • Sequence: <sequence index> <activity / sequence name>
    • Cycle: <anim cycle> (<anim time>)
  • NPC Information (displayed for all NPCs)
    • Health: <health>
    • Stat: <AI state>
    • Move: <movement method>
    • Behv: <active behavior, if any>
    • Schd: <active schedule name>
    • Task: <activate task name> <task index in active schedule>
    • Actv: <current activity> (<ideal activity>) (<root / untranslated activity>)
    • Vel: <absolute velocity X Y Z> Ang: <angular velocity X Y Z>
      This will only appear if the NPC is moving and/or rotating.
    • Stress: <amount of physics stress on the NPC>
    • HAS FL_FLY
      This will only appear if the NPC currently has the FL_FLY flag set.
    • Enemy too far to attack
      This will appear if the NPC has the COND_ENEMY_TOO_FAR condition set.
    • Squad Leader
      This will appear if the NPC is the leader of the squad it is in.
  • Prop_physics Information
    • Mass: <mass in kgs> kg / <mass in lbs> lb (<real world object of similar mass>)
    • Stress: <amount of physics stress on the NPC>
    • Motion Disabled
      This will appear if the object has had its motion disabled (usually due to the mapmaker setting the appropriate flag)
    • Base PropData: <prop data specified by this prop's model>
    • Breakable Chunks: <number of generic gibs this object breaks into> (Max size <maximum size of generic gibs used>)
    • Health: <health>, collision group <collision group>

Caveats

  • Some entities do not require a physical location to perform their function. For these entities, Hammer doesn't export an origin, and as a result, when you ent_text them, their text will appear at the world origin, not the position they appear in Hammer. In general, these entities have classnames beginning with env_ or logic_.

Usage

Note.pngNote:The targetname/classname parameter supports wildcard but anything after the wildcard is ignored. For example, ent_text zapperpod*_train will toggle the entity text display for any entity whose targetname/classname starts with zapperpod no matter what text follows after wildcard.
  • ent_text
    • This will toggle the entity text display for the entity under your crosshair, if any. Note that this only works for entities that are solid (i.e. can be "hit" by the trace).
  • ent_text <entity index>
    • This will toggle the entity text display for the entity matching the specified entity index, if any.
  • ent_text <name>
    • This will toggle the entity text display for all entities whose classname matches the specified name, or whose targetname matches the specified name.
  • ent_text *
    • This will toggle the entity text display for all entities in the current map.
      Warning.pngWarning:Doing this on maps with high entity count can crash the game!

See also