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

Npc select: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Categorised)
(added that category to Template:devreq)
 
(16 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{this is a|console command|name=npc_select}}
The <code>npc_select</code> command is a debugging tool that allows you to select an NPC, or group of NPCs, for a variety of purposes.  
The <code>npc_select</code> command is a debugging tool that allows you to select an NPC, or group of NPCs, for a variety of purposes.  
{{devreq}}




==Usage==
==Usage==
* <code>npc_select</code>
{{wildcardnote|npc_select npc*zombie|select|NPC|npc}}
* {{code|npc_select}}
** This will toggle selection of the NPC under your crosshair, if any.
** This will toggle selection of the NPC under your crosshair, if any.
* <code>npc_select <entity index></code>
* {{code|npc_select <entity index>}}
** This will toggle selection of the NPC matching the specified entity index, if any.
** This will toggle selection of the NPC matching the specified entity index, if any.
* <code>npc_select <name></code>
* {{code|npc_select <name>}}
** This will toggle selection of all NPCs who's classname matches the specified name, or who's targetname matches the specified name.
** This will toggle selection of all NPCs who's classname matches the specified name, or whose targetname matches the specified name.
* {{code|npc_select *}}
** This will select all NPCs in the current map.




Line 35: Line 41:


[[Category:Debugging]]
[[Category:Debugging]]
[[Category:AI Commands]]
[[Category:AI]]

Latest revision as of 09:07, 17 September 2024

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

The npc_select command is a debugging tool that allows you to select an NPC, or group of NPCs, for a variety of purposes.

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


Usage

Note.pngNote:The targetname/classname parameter supports wildcard but anything after the wildcard is ignored. For example, npc_select npc*zombie will select any NPC whose targetname/classname starts with npc no matter what text follows after wildcard.
  • npc_select
    • This will toggle selection of the NPC under your crosshair, if any.
  • npc_select <entity index>
    • This will toggle selection of the NPC matching the specified entity index, if any.
  • npc_select <name>
    • This will toggle selection of all NPCs who's classname matches the specified name, or whose targetname matches the specified name.
  • npc_select *
    • This will select all NPCs in the current map.


Many debugging systems display debug for currently selected NPCs only. Common uses of selected NPCs via console commands are:

  • npc_go
    • Tell all selected NPCs to move to the position you are currently looking at.
  • npc_destroy_unselected
    • Remove all NPCs that aren't currently selected.


See also

General AI

Navigation

Node debugging