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

npc_route

From Valve Developer Community
Jump to: navigation, search
English (en)
... Icon-Important.png

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

The npc_route console command is a debugging tool for debugging the route that an NPC is using to navigate to a target destination. The route consists of a set of waypoints. Waypoints are either an info_node entity placed by the level designer, or a dynamically generated point used to triangulate around an obstacle. To properly view this debug tool, make sure you are in developer mode.

Example

An npc_zombie's route in HL2's d1_town_01.bsp

An example of npc_route in action. The npc_zombie is attempting to move from the right of the screen to the left (he is operating under the instruction of the npc_go command). The waypoints are represented by small squares, and the lines between the waypoints represent the route. Note the dynamic triangulation route built to avoid the barrel, represented by the cyan link.

Notes

The color of the route lines represent the type of route built from each waypoint to the next. The colors are as follows:

  • Blue
    • Standard path to the next waypoint.
  • Cyan
    • The path to a triangulation waypoint. These are dynamically generated by NPCs when they detect objects in their path, in an attempt to navigate around the obstacle.
  • Red
    • The NPC will perform a jump from this waypoint to the next.
  • Maroon
    • The final path to the destination point.

Usage

  • npc_route
    • This will toggle the route display for the NPC under your crosshair, if any.
  • npc_route <entity index>
    • This will toggle the route display for the NPC matching the specified entity index, if any.
  • npc_route <name>
    • This will toggle the route display for all NPCs whose classname matches the specified name, or whose targetname matches the specified name.

See also