NPC Debugging: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 4: Line 4:
= misc =
= misc =
=== npc_height_adjust ===  
=== npc_height_adjust ===  
* {{sv_cheat}}
* <1> Enable test mode for ik height adjustment.
* <1> Enable test mode for ik height adjustment.


Line 13: Line 14:


=== npc_route ===  
=== npc_route ===  
* {{sv_cheat}}
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
* Displays the current route of the given NPC as a line on the screen.  
* Displays the current route of the given NPC as a line on the screen.  
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at. 
* Waypoints along the route are drawn as small cyan rectangles. Line is color coded in the following manner:
* Waypoints along the route are drawn as small cyan rectangles. Line is color coded in the following manner:
{|
{|
Line 26: Line 28:


=== npc_bipass ===  
=== npc_bipass ===  
* {{sv_cheat}}
* {{todo|<1>?}} Displays the local movement attempts by the given NPC(s) (triangulation detours).  
* {{todo|<1>?}} Displays the local movement attempts by the given NPC(s) (triangulation detours).  
* Failed bypass routes are displayed in red, successful bypasses are shown in green.
* Failed bypass routes are displayed in red, successful bypasses are shown in green.


=== npc_nearest ===  
=== npc_nearest ===  
* {{sv_cheat}}
* Draw's a while box around the NPC(s) nearest node.
* Draw's a while box around the NPC(s) nearest node.
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.     
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.     


=== npc_steering ===  
=== npc_steering ===  
* {{sv_cheat}}
* Displays the steering obstructions of the NPC (used to perform local avoidance)
* Displays the steering obstructions of the NPC (used to perform local avoidance)
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   


=== npc_steering_all ===  
=== npc_steering_all ===  
* {{sv_cheat}}
* Displays the steering obstructions of all NPCs (used to perform local avoidance).
* Displays the steering obstructions of all NPCs (used to perform local avoidance).


Line 43: Line 49:


=== npc_focus ===  
=== npc_focus ===  
* {{sv_cheat}}
* Displays red line to NPC's enemy (if has one) and blue line to NPC's target entity (if has one)
* Displays red line to NPC's enemy (if has one) and blue line to NPC's target entity (if has one)
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
Line 48: Line 55:


=== npc_conditions ===  
=== npc_conditions ===  
* {{sv_cheat}}
* Displays all the current AI conditions that an NPC has in the [[overlay text]].
* Displays all the current AI conditions that an NPC has in the [[overlay text]].
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   


=== npc_reset ===  
=== npc_reset ===  
* {{sv_cheat}}
* Reloads schedules for all NPC's from their script files.
* Reloads schedules for all NPC's from their script files.


=== npc_task_text ===  
=== npc_task_text ===  
* {{sv_cheat}}
* Outputs text debugging information to the console about the all the tasks and break conditions of the selected NPC current schedule.
* Outputs text debugging information to the console about the all the tasks and break conditions of the selected NPC current schedule.
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
Line 60: Line 70:


=== npc_tasks ===  
=== npc_tasks ===  
* {{sv_cheat}}
* Displays detailed text debugging information about the all the tasks of the selected NPC current schedule (See Overlay Text)
* Displays detailed text debugging information about the all the tasks of the selected NPC current schedule (See Overlay Text)
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   


=== npc_thinknow ===  
=== npc_thinknow ===  
* {{sv_cheat}}
* Trigger NPC to think.
* Trigger NPC to think.


=== npc_viewcone ===  
=== npc_viewcone ===  
* {{sv_cheat}}
* Displays the viewcone of the NPC (where they are currently looking and what the extents of there vision is)
* Displays the viewcone of the NPC (where they are currently looking and what the extents of there vision is)
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
Line 76: Line 89:


=== npc_combat ===  
=== npc_combat ===  
* {{sv_cheat}}
* Displays text debugging information about the squad and enemy of the selected NPC (See [[Overlay Text]])
* Displays text debugging information about the squad and enemy of the selected NPC (See [[Overlay Text]])
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   


=== npc_enemies ===  
=== npc_enemies ===  
* {{sv_cheat}}
* Shows memory of NPC. Draws an X on top of each memory.
* Shows memory of NPC. Draws an X on top of each memory.
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
Line 117: Line 132:


=== npc_select ===  
=== npc_select ===  
* {{sv_cheat}}
* Selects or deselects the given NPC(s) for later manipulation. Selected NPC's are shown surrounded by a red translucent box
* Selects or deselects the given NPC(s) for later manipulation. Selected NPC's are shown surrounded by a red translucent box
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.   


=== npc_ammo_deplete ===
=== npc_ammo_deplete ===
* {{sv_cheat}}
* Subtracts half of the target's ammo.
* Subtracts half of the target's ammo.


=== npc_create ===  
=== npc_create ===  
* {{sv_cheat}}
* Creates an NPC of the given type where the player is looking (if the given NPC can actually stand at that location). Note that this only works for npc classes that are already in the world. You can not create an entity that doesn't have an instance in the level.
* Creates an NPC of the given type where the player is looking (if the given NPC can actually stand at that location). Note that this only works for npc classes that are already in the world. You can not create an entity that doesn't have an instance in the level.
* Arguments : <npc_class_name>.  
* Arguments : <npc_class_name>.  


=== npc_create_aimed ===  
=== npc_create_aimed ===  
* {{sv_cheat}}
* Creates an NPC aimed away from the player of the given type where the player is looking (if the given NPC can actually stand at that location). Note that this only works for npc classes that are already in the world. You can not create an entity that doesn't have an instance in the level.
* Creates an NPC aimed away from the player of the given type where the player is looking (if the given NPC can actually stand at that location). Note that this only works for npc classes that are already in the world. You can not create an entity that doesn't have an instance in the level.
* Arguments : <npc_class_name>.  
* Arguments : <npc_class_name>.  


=== npc_create_equipment ===  
=== npc_create_equipment ===  
* {{sv_cheat}}
* <1> {{todo|arguments}}
* <1> {{todo|arguments}}


=== npc_destroy ===  
=== npc_destroy ===  
* {{sv_cheat}}
* Removes the given NPC(s) from the universe
* Removes the given NPC(s) from the universe
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.  
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.  


=== npc_destroy_unselected ===  
=== npc_destroy_unselected ===  
* {{sv_cheat}}
* Removes all NPCs from the universe that aren't currently selected.
* Removes all NPCs from the universe that aren't currently selected.


=== npc_freeze ===  
=== npc_freeze ===  
* {{sv_cheat}}
* Selected NPC(s) will freeze in place (or unfreeze).  
* Selected NPC(s) will freeze in place (or unfreeze).  
* If there are no selected NPCs, uses the NPC under the crosshair.
* If there are no selected NPCs, uses the NPC under the crosshair.


=== npc_go ===  
=== npc_go ===  
* {{sv_cheat}}
* Selected NPC(s) will go to the location that the player is looking (shown with a purple box).
* Selected NPC(s) will go to the location that the player is looking (shown with a purple box).


Line 152: Line 176:


=== npc_go_random ===  
=== npc_go_random ===  
* {{sv_cheat}}
* Sends all selected NPC(s) to a random node.
* Sends all selected NPC(s) to a random node.


=== npc_heal ===  
=== npc_heal ===  
* {{sv_cheat}}
* Heals the target back to full health.
* Heals the target back to full health.


=== npc_kill ===  
=== npc_kill ===  
* {{sv_cheat}}
* Kills the given NPC(s)
* Kills the given NPC(s)
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.  
* Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.  

Revision as of 07:26, 8 March 2008

Stub

This article or section is a stub. You can help by expanding it.

misc

npc_height_adjust

  • This command requires sv_cheats set to 1.
  • <1> Enable test mode for ik height adjustment.

npc_vphysics

  • <1>

NPC AI

AI navigation

npc_route

  • This command requires sv_cheats set to 1.
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
  • Displays the current route of the given NPC as a line on the screen.
  • Waypoints along the route are drawn as small cyan rectangles. Line is color coded in the following manner:
  • Blue : Path to a node
  • Cyan : Detour around an object (triangulation)
  • Red : Jump
  • Maroon : Path to final target position

npc_bipass

  • This command requires sv_cheats set to 1.
  • Todo: <1>?
    Displays the local movement attempts by the given NPC(s) (triangulation detours).
  • Failed bypass routes are displayed in red, successful bypasses are shown in green.

npc_nearest

  • This command requires sv_cheats set to 1.
  • Draw's a while box around the NPC(s) nearest node.
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_steering

  • This command requires sv_cheats set to 1.
  • Displays the steering obstructions of the NPC (used to perform local avoidance)
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_steering_all

  • This command requires sv_cheats set to 1.
  • Displays the steering obstructions of all NPCs (used to perform local avoidance).

AI think

npc_focus

  • This command requires sv_cheats set to 1.
  • Displays red line to NPC's enemy (if has one) and blue line to NPC's target entity (if has one)
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
  • Seems not to work when multiple NPCs are selected.

npc_conditions

  • This command requires sv_cheats set to 1.
  • Displays all the current AI conditions that an NPC has in the overlay text.
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_reset

  • This command requires sv_cheats set to 1.
  • Reloads schedules for all NPC's from their script files.

npc_task_text

  • This command requires sv_cheats set to 1.
  • Outputs text debugging information to the console about the all the tasks and break conditions of the selected NPC current schedule.
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
  • This will let you see what that and why your AI schedule/task failed.

npc_tasks

  • This command requires sv_cheats set to 1.
  • Displays detailed text debugging information about the all the tasks of the selected NPC current schedule (See Overlay Text)
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_thinknow

  • This command requires sv_cheats set to 1.
  • Trigger NPC to think.

npc_viewcone

  • This command requires sv_cheats set to 1.
  • Displays the viewcone of the NPC (where they are currently looking and what the extents of there vision is)
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

AI enemies & allies

npc_squads

  • Obsolete. Replaced by npc_combat.

npc_combat

  • This command requires sv_cheats set to 1.
  • Displays text debugging information about the squad and enemy of the selected NPC (See Overlay Text)
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_enemies

  • This command requires sv_cheats set to 1.
  • Shows memory of NPC. Draws an X on top of each memory.
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
Blue Eluded entities (don't know where it went)
Green Unreachable entities (can't get to it)
Red Current enemy
Magenta Current target entity
Pink All other entities drawn


AI responses

npc_sentences

  • <1>

npc_speakall

  • Force the npc to try and speak all their responses.






edit NPC

npc_select

  • This command requires sv_cheats set to 1.
  • Selects or deselects the given NPC(s) for later manipulation. Selected NPC's are shown surrounded by a red translucent box
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_ammo_deplete

  • This command requires sv_cheats set to 1.
  • Subtracts half of the target's ammo.

npc_create

  • This command requires sv_cheats set to 1.
  • Creates an NPC of the given type where the player is looking (if the given NPC can actually stand at that location). Note that this only works for npc classes that are already in the world. You can not create an entity that doesn't have an instance in the level.
  • Arguments : <npc_class_name>.

npc_create_aimed

  • This command requires sv_cheats set to 1.
  • Creates an NPC aimed away from the player of the given type where the player is looking (if the given NPC can actually stand at that location). Note that this only works for npc classes that are already in the world. You can not create an entity that doesn't have an instance in the level.
  • Arguments : <npc_class_name>.

npc_create_equipment

  • This command requires sv_cheats set to 1.
  • <1>
    Todo: arguments

npc_destroy

  • This command requires sv_cheats set to 1.
  • Removes the given NPC(s) from the universe
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.

npc_destroy_unselected

  • This command requires sv_cheats set to 1.
  • Removes all NPCs from the universe that aren't currently selected.

npc_freeze

  • This command requires sv_cheats set to 1.
  • Selected NPC(s) will freeze in place (or unfreeze).
  • If there are no selected NPCs, uses the NPC under the crosshair.

npc_go

  • This command requires sv_cheats set to 1.
  • Selected NPC(s) will go to the location that the player is looking (shown with a purple box).

npc_go_do_run

  • <1> Set whether should run on NPC go.

npc_go_random

  • This command requires sv_cheats set to 1.
  • Sends all selected NPC(s) to a random node.

npc_heal

  • This command requires sv_cheats set to 1.
  • Heals the target back to full health.

npc_kill

  • This command requires sv_cheats set to 1.
  • Kills the given NPC(s)
  • Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.


NPC class specific

Todo: It's probably better to document these ConComs on the relevant npc_class_name entity page? Although the squad-related ones might be better in NPC AI ?


npc_citizen_auto_player_squad

  • <1>

npc_citizen_auto_player_squad_allow_use

  • <0>

npc_citizen_squad_marker

  • <0>

npc_citizen_explosive_resist

  • <0>

npc_citizen_insignia

  • <0>

npc_barnacle_swallow

  • Todo: <0> or <1>
    = Use prototype swallow code.

npc_strider_height_adj

  • <0>

npc_strider_shake_ropes_magnitude

  • <150>

npc_strider_shake_ropes_radius

  • <1200>