NPC Debugging: Difference between revisions
Jump to navigation
Jump to search
Bug:Some NPCs will speak all the scenes in the entire game.
Gameplayer (talk | contribs) (All the commands I've checked in this list do not require sv_cheats to work. Some do not even require developer mode.) |
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 4: | Line 4: | ||
= misc = | = misc = | ||
=== npc_select === | === [[npc_select]] === | ||
* 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. | ||
Line 23: | Line 23: | ||
== AI navigation == | == AI navigation == | ||
=== npc_route === | === [[npc_route]] === | ||
* 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. | ||
* 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. | ||
Line 43: | Line 42: | ||
* Failed bipass routes are displayed in red, successful bipasses are shown in green. | * Failed bipass routes are displayed in red, successful bipasses are shown in green. | ||
=== npc_nearest === | === [[npc_nearest]] === | ||
* 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. | ||
* Draw's a white box around the NPC(s) nearest node. | * Draw's a white box around the NPC(s) nearest node. | ||
Line 65: | Line 63: | ||
=== npc_go_random === | === npc_go_random === | ||
* Sends all [[npc_select|selected]] NPC(s) to a random node. | * Sends all [[npc_select|selected]] NPC(s) to a random node. | ||
Line 74: | Line 71: | ||
* <0> Enables AI again (default). | * <0> Enables AI again (default). | ||
=== npc_focus === | === [[npc_focus]] === | ||
* 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. | ||
* 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) | ||
Line 103: | Line 99: | ||
* Trigger NPC to think. | * Trigger NPC to think. | ||
=== npc_viewcone === | === [[npc_viewcone]] === | ||
* 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. | ||
* 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) | ||
Line 110: | Line 105: | ||
== AI enemies & allies == | == AI enemies & allies == | ||
=== npc_squads === | === [[npc_combat]] / [[npc_squads]]=== | ||
* 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. | ||
* Displays the specified NPC's current Health, Squad, Enemy and Slot in a HUD overlay. | * Displays the specified NPC's current Health, Squad, Enemy and Slot in a HUD overlay. | ||
=== npc_enemies === | === [[npc_enemies]] === | ||
* 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. | ||
* Shows entities in the specified NPC's memory by drawing a colour-coded X over the entity and adding a HUD label: | * Shows entities in the specified NPC's memory by drawing a colour-coded X over the entity and adding a HUD label: | ||
Line 144: | Line 134: | ||
=== npc_speakall === | === npc_speakall === | ||
* Force the [[npc_select|selected]] NPC to try and speak all their responses. | * Force the [[npc_select|selected]] NPC to try and speak all their responses. | ||
{{bug|Some NPCs will speak all the scenes in the entire game.}} | {{bug|hidetested=1|Some NPCs will speak all the scenes in the entire game.}} | ||
= Edit NPC = | = Edit NPC = | ||
Line 160: | Line 150: | ||
* Arguments : <npc_class_name>. | * Arguments : <npc_class_name>. | ||
=== npc_destroy === | === [[npc_destroy]] === | ||
* 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. | ||
* Removes the specified NPC(s) from the universe ''silently'', so outputs such as "OnDamaged" and "OnDeath" are not fired, nor are ragdolls created. Destroyed NPCs carrying weapons will drop the weapon before removing themselves. This command flags NPCs with a note to destroy themselves, so if AI is not running (due to the [[ai_disable]] command), the command will be ignored. | * Removes the specified NPC(s) from the universe ''silently'', so outputs such as "OnDamaged" and "OnDeath" are not fired, nor are ragdolls created. Destroyed NPCs carrying weapons will drop the weapon before removing themselves. This command flags NPCs with a note to destroy themselves, so if AI is not running (due to the [[ai_disable]] command), the command will be ignored. | ||
=== npc_destroy_unselected === | === [[npc_destroy_unselected]] === | ||
* Removes all currently ''not-''[[npc_select|selected]] NPCs from the universe. | * Removes all currently ''not-''[[npc_select|selected]] NPCs from the universe. | ||
=== npc_kill === | === [[npc_kill]] === | ||
* 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. | ||
* Kills the specified NPC(s) by dealing enough damage to kill them, so "OnDamaged" and "OnDeath" outputs will be fired. This command flags the NPC with a note to kill itself, so if AI is not running (due to the [[ai_disable]] command), the command will be ignored. | * Kills the specified NPC(s) by dealing enough damage to kill them, so "OnDamaged" and "OnDeath" outputs will be fired. This command flags the NPC with a note to kill itself, so if AI is not running (due to the [[ai_disable]] command), the command will be ignored. | ||
Line 182: | Line 169: | ||
= NPC class specific = | = NPC class specific = | ||
=== npc_citizen_auto_player_squad=== | === [[Npc_citizen#Dedicated_Console_Variables|npc_citizen_auto_player_squad]]=== | ||
* <1> | * <1> | ||
=== npc_citizen_auto_player_squad_allow_use === | === [[Npc_citizen#Dedicated_Console_Variables|npc_citizen_auto_player_squad_allow_use]] === | ||
* <0> | * <0> | ||
=== npc_citizen_squad_marker === | === [[Npc_citizen#Dedicated_Console_Variables|npc_citizen_squad_marker]] === | ||
* <0> | * <0> | ||
=== npc_citizen_explosive_resist === | === [[Npc_citizen#Dedicated_Console_Variables|npc_citizen_explosive_resist]] === | ||
* <0> | * <0> | ||
=== npc_citizen_insignia === | === [[Npc_citizen#Dedicated_Console_Variables|npc_citizen_insignia]] === | ||
* <0> | * <0> | ||
=== [[ | === [[Npc_barnacle#Dedicated_Console_Variables|npc_barnacle_swallow]] === | ||
* {{TODO|<0> or <1>}} = Use prototype swallow code. | * {{TODO|<0> or <1>}} = Use prototype swallow code. | ||
=== [[npc_strider]] | === [[npc_strider#Dedicated Console Variables|npc_strider_height_adj]] === | ||
* <0> | * <0> | ||
=== [[npc_strider]] | === [[npc_strider#Dedicated Console Variables|npc_strider_shake_ropes_magnitude]] === | ||
* <150> | * <150> | ||
=== [[npc_strider]] | === [[npc_strider#Dedicated Console Variables|npc_strider_shake_ropes_radius]] === | ||
* <1200> | * <1200> |
Latest revision as of 07:13, 20 May 2025
misc
npc_select
- 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_freeze
- Selected NPC(s) will freeze in place (or unfreeze). If there are no selected NPCs, it freezes the NPC under the crosshair.
- Todo: verify test: unable to unfreeze selected NPC, unable to freeze without selecting NPC. --Beeswax 11:00, 8 Mar 2008 (PST)
npc_height_adjust
- This command requires
sv_cheats
set to1
. - <1> Enables test mode for ik height adjustment.
npc_vphysics
- <1> Todo: requires explanation/description of use
NPC AI
npc_route
- 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:
|
npc_bipass
- This Console command requires sv_cheats set to
1
and then developer set to1
. - Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Displays the local movement attempts by the given NPC(s) (triangulation detours).
- Failed bipass routes are displayed in red, successful bipasses are shown in green.
npc_nearest
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Draw's a white box around the NPC(s) nearest node.
npc_steering
- This command requires
sv_cheats
set to1
. - Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Displays the steering obstructions of the specified NPC (used to perform local avoidance)
npc_steering_all
- This command requires
sv_cheats
set to1
. - Displays the steering obstructions of all NPCs (used to perform local avoidance).
npc_go
- Selected NPC(s) will go to the location that the player is looking (shown with a purple box).
npc_go_do_run
- <1> NPC should run on npc_go.
- <0> NPC should walk on npc_go.
npc_go_random
- Sends all selected NPC(s) to a random node.
AI think
ai_disable
- <1> Disables the AI of all NPCs in the game. Disabled NPCs won't "think", but the rest of the game code continues to run.
- <0> Enables AI again (default).
npc_focus
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Displays red line to NPC's enemy (if has one) and blue line to NPC's target entity (if has one)
npc_conditions
- This command requires
sv_cheats
set to1
.Todo: how to activate ? - Displays all the current AI conditions that an NPC has as HUD overlay text.
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
npc_reset
- This command requires
sv_cheats
set to1
.Todo: how to activate ? - Reloads schedules for all NPC's from their script files.
npc_task_text
- This Console command requires sv_cheats set to
1
and then developer set to1
. - Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Outputs text debugging information to the console about the all the tasks and break conditions of the selected NPC's current schedule.
- This will let you see what that and why your AI schedule/task failed.
npc_tasks
- This command requires
sv_cheats
set to1
.Todo: how to activate ? - Displays detailed text debugging information about the all the tasks of the selected NPC's 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 to1
.Todo: how to activate ? - Trigger NPC to think.
npc_viewcone
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Displays the viewcone of the NPC (where they are currently looking and what the extents of there vision is)
AI enemies & allies
npc_combat / npc_squads
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Displays the specified NPC's current Health, Squad, Enemy and Slot in a HUD overlay.
npc_enemies
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Shows entities in the specified NPC's memory by drawing a colour-coded X over the entity and adding a HUD label:
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> Logs each NPC sentence in console as it is spoken.
- <2> Logs each NPC sentence in console as it is spoken in a more detailed description.
npc_speakall
- Force the selected NPC to try and speak all their responses.

Edit NPC
npc_create_equipment
- Arguments : <weapon_type> (see Category:Weapons)
- Allows you to specify a weapon that will be given to an NPC when npc_create is used. You need to specify the weapon before you create the NPC.
npc_create
- Arguments : <npc_class_name>.
- Creates an NPC of the specified 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.
npc_create_aimed
- Creates an NPC aimed away from the player of the specified 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_destroy
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Removes the specified NPC(s) from the universe silently, so outputs such as "OnDamaged" and "OnDeath" are not fired, nor are ragdolls created. Destroyed NPCs carrying weapons will drop the weapon before removing themselves. This command flags NPCs with a note to destroy themselves, so if AI is not running (due to the ai_disable command), the command will be ignored.
npc_destroy_unselected
- Removes all currently not-selected NPCs from the universe.
npc_kill
- Arguments : <npc_name> / <npc_class_name> / no argument picks what player is looking at.
- Kills the specified NPC(s) by dealing enough damage to kill them, so "OnDamaged" and "OnDeath" outputs will be fired. This command flags the NPC with a note to kill itself, so if AI is not running (due to the ai_disable command), the command will be ignored.
npc_ammo_deplete
- Subtracts half of the target's ammo.
npc_heal
- Heals the selected NPC back to full health. If there are no selected NPCs, it heals the NPC under the crosshair.
- Dead NPCs cannot be healed/resurrected.
NPC class specific
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>