Npc route: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created.)
 
m (Cleanup)
Line 1: Line 1:
{{wrongtitle|title=npc_route}}
{{wrongtitle|title=npc_route}}


The <code>npc_route</code> console command is a debugging tool for debugging the [[route]] that an NPC is choosing when navigating to a point. A route consists of a set of waypoints. Each waypoint is an [[info_node]] entity placed by the level designer, or a dynamically generated point used to triangulate around an obstacle.
The <code>npc_route</code> 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.




==Example==
==Example==
<center>[[Image:npc_route.jpg|550px|An npc_zombie's route in HL2's d1_town_01.bsp]]</center>
<center>[[Image:npc_route.jpg|550px|An npc_zombie's route in HL2's d1_town_01.bsp]]</center>
An example of <code>npc_route</code> 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 shows the route. Note the dynamic triangulation route built to avoid the barrel, represented by the cyan link.
An example of <code>npc_route</code> 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.




Line 17: Line 17:
** 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.
** 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
* Red
** The movement to the next waypoint will be a jump.
** The NPC will perform a jump from this waypoint to the next.
* Maroon
* Maroon
** The final path to the destination point.
** The final path to the destination point.
Line 24: Line 24:
==Usage==
==Usage==
* <code>npc_route</code>
* <code>npc_route</code>
** This will toggle route-displaying for the NPC under your crosshair, if any.
** This will toggle the route display for the NPC under your crosshair, if any.
* <code>npc_route <entity index></code>
* <code>npc_route <entity index></code>
** This will toggle route-displaying for the NPC matching the specified entity index, if any.
** This will toggle the route display for the NPC matching the specified entity index, if any.
* <code>npc_route <name></code>
* <code>npc_route <name></code>
** This will toggle route-displaying for all NPCs whose classname matches the specified name, or whose targetname matches the specified name.
** This will toggle the route display for all NPCs whose classname matches the specified name, or whose targetname matches the specified name.





Revision as of 22:37, 11 July 2005

Template:Wrongtitle

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.


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