This article's documentation is for Source 2. Click here for more information.

logic_npc_counter_radius

From Valve Developer Community
Jump to: navigation, search

logic_npc_counter_radius is a point entity available in all Source 2 Source 2 games. It does calculations based on the number of a specified type of NPC in a specified region.

Keyvalues

Name (targetname) <string>
The targetname that other entities refer to this entity by.
Maximum Distance (distanceMax) <float>
Maximum distance to test for NPC
Start Disabled (startDisabled) <boolean>
Whether or not the entitiy should stay dormant until activated (with the Enable input).
Source Entity Name (sourceEntityName) <targetname>
Name of the entity to check distance from
On Min Count All (minCount) <integer>
The minimum count threshold of all npcs
On Max Count All (maxCount) <integer>
The maximum count threshold of all npcs
Min Factor All (minFactor) <integer>
The minimum count of all npcs for factor calculations
Max Factor All (maxFactor) <integer>
The maximum count of all npcs for factor calculations
Class name of NPC 1 to count (NPCType1) to Class name of NPC 1/2/3 to count (NPCType3) <npcclass>
NPC State 1 (NPCState1) to NPC State 3 (NPCState3) <choices>
Only match NPCs in this state
Value Description
-1 Any
0 None
1 Idle
2 Alert
3 Combaat
4 Script
5 Playdead
6 Prone
7 Dead
Invert State (invertState1) to {{{to}}} (invertState3) <boolean>
On Min Count 1 (minCount1) to On Min Count 3 (minCount3) <integer>
The minimum count threshold of npc 1/2/3
On Max Count 1 (maxCount1) to On Max Count 3 (maxCount3) <integer>
The maximum count threshold of npc 1/2/3
Min Factor 1 (minFactor1) to Min Factor 3 (minFactor3) <integer>
The minimum count of npc 1/2/3 for factor calculations
Max Factor 1 (maxFactor1) to Max Factor 3 (maxFactor3) <integer>
The maximum count of npc 1/2/3 for factor calculations
Default Dist 1 (defaultDist1) to Default Dist 3 (defaultDist3) <float>
The default minimum player distance of npc 1/2/3

Inputs

Enable
Enable the entity
Disable
Disable the entity
SetSourceEntity
Set the name of the entity to base this entities location on. This check will follow the entity as it moves.

Base:

RunScriptFile
Load and execute a script file.
RunScriptCode
Execute a fragment of script code.
CallScriptFunction
Call a script function.
CallPrivateScriptFunction
Calls a script function from this entity's private script scope.
CallGlobalScriptFunction
Calls a script function in the global script scope.
Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput
Adds an entity I/O connection to this entity. Parameter format: OutputName→TargetName→InputName→Parameter→Delay→MaxRefires
FireUser1 to FireUser4
Fires the respectiveOnUseroutputs; see User Inputs and Outputs.

Outputs

OnMinCountAll
Fired when the count of all npcs transitions to the min count or less.
OnMaxCountAll
Fired when the count of all npcs transitions to the max count or greater.
OnRangeFactorAll
Outputs the factor of the count of all npcs.
OnMinPlayerDistAll
Outputs distance to the NPC, of all NPCs, that is closest to player.
OnMinCount1 to OnMinCount3
Fired when the count of npc 1/2/3 transitions to the min count or less.
OnMaxCount1 to OnMaxCount3
Fired when the count of npc 1/2/3 transitions to the max count or greater.
OnRangeFactor1 to OnRangeFactor3
Outputs the factor of the count of npc 1/2/3.
OnMinPlayerDist1 to OnMinPlayerDist3
Outputs distance to the NPC, of NPCs 1, that is closest to player.

Base:

OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled
This output fires when the entity is killed and removed from the game. Parameter is the inflictor.