Skip to content

logic_npc_counter_obb

Entity I/O / logic_npc_counter_obb

Does calculations based on the number of a specified type of NPC in a specified region.

  • FGD @PointClass in game/core/base.fgd, bases Targetname, logic_npc_counter_aabb.
  • cs_script type: Entity, what FindEntitiesByClass("logic_npc_counter_obb") returns.
  • Native class: CLogicNPCCounterOBB (curated pairing).

CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2

Inputs (18)

NameParameterFromDescription
RunScriptFilestringVScriptLoad and execute a script file
RunScriptCodestringVScriptExecute a fragment of script code
CallScriptFunctionstringVScriptCall a script function
CallPrivateScriptFunctionstringVScriptCalls a script function from this entity's private script scope.
CallGlobalScriptFunctionstringVScriptCalls a script function in the global script scope.
KillGameEntityRemoves this entity from the world.
KillHierarchyGameEntityRemoves this entity and all its children from the world.
KillConstrainedGameEntityRemoves this entity, all its children, and anything constrained to it, from the world.
AddOutputstringGameEntityAdds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care.
FireUser1GameEntityCauses this entity's OnUser1 output to be fired.
FireUser2GameEntityCauses this entity's OnUser2 output to be fired.
FireUser3GameEntityCauses this entity's OnUser3 output to be fired.
FireUser4GameEntityCauses this entity's OnUser4 output to be fired.
EnableAutoSleepingGameEntityEnable automatic sleeping on this entity's physics bodies. When enabled, physics bodies go to sleep when at rest.
DisableAutoSleepingGameEntityDisable automatic sleeping on this entity's physics bodies. Bodies remain awake until explicitly put to sleep.
EnableLogicNPCCounterPointBaseEnable the entity
DisableLogicNPCCounterPointBaseDisable the entity
SetSourceEntitystringLogicNPCCounterPointBaseSet the name of the entity to base this entities location on. This check will follow the entity as it moves.

Outputs (21)

NameParameterFromDescription
OnUser1GameEntityFired in response to FireUser1 input.
OnUser2GameEntityFired in response to FireUser2 input.
OnUser3GameEntityFired in response to FireUser3 input.
OnUser4GameEntityFired in response to FireUser4 input.
OnKilledGameEntityFired when the entity is killed and removed from the game. Parameter is the inflictor.
OnMinCountAllLogicNPCCounterPointBaseFired when the count of all npcs transitions to the min count or less.
OnMaxCountAllLogicNPCCounterPointBaseFired when the count of all npcs transitions to the max count or greater.
OnRangeFactorAllfloatLogicNPCCounterPointBaseOutputs the factor of the count of all npcs.
OnMinPlayerDistAllfloatLogicNPCCounterPointBaseOutputs distance to the NPC, of all NPCs, that is closest to player.
OnMinCount1LogicNPCCounterPointBaseFired when the count of npc 1 transitions to the min count or less.
OnMaxCount1LogicNPCCounterPointBaseFired when the count of npc 1 transitions to the max count or greater.
OnRangeFactor1floatLogicNPCCounterPointBaseOutputs the factor of the count of npc 1.
OnMinPlayerDist1floatLogicNPCCounterPointBaseOutputs distance to the NPC, of NPCs 1, that is closest to player.
OnMinCount2LogicNPCCounterPointBaseFired when the count of npc 2 transitions to the min count or less.
OnMaxCount2LogicNPCCounterPointBaseFired when the count of npc 2 transitions to the max count or greater.
OnRangeFactor2floatLogicNPCCounterPointBaseOutputs the factor of the count of npc 2.
OnMinPlayerDist2floatLogicNPCCounterPointBaseOutputs distance to the NPC, of NPCs 2, that is closest to player.
OnMinCount3LogicNPCCounterPointBaseFired when the count of npc 3 transitions to the min count or less.
OnMaxCount3LogicNPCCounterPointBaseFired when the count of npc 3 transitions to the max count or greater.
OnRangeFactor3floatLogicNPCCounterPointBaseOutputs the factor of the count of npc 3.
OnMinPlayerDist3floatLogicNPCCounterPointBaseOutputs distance to the NPC, of NPCs 3, that is closest to player.

Keyvalues (34)

The names Hammer saves and the KeyValue input and AddOutput take at run time. An entity reads some keys only when it spawns, so changing one later may do nothing. Integer keys such as movetype take engine numbers, not the renumbered cs_script enum values.

KeyTypeDefaultFromDescription
vscripts
Entity Scripts
scriptlistVScriptName(s) of script files that are executed after all entities have spawned.
targetname
Name
target_sourceTargetnameThe name that other entities refer to this entity by.
startDisabled
Start Disabled
bool0LogicNPCCounterPointBase
sourceEntityName
Source Entity Name
target_destinationLogicNPCCounterPointBaseName of the entity to check distance from
minCount
On Min Count All
int-1LogicNPCCounterPointBaseThe minimum count threshold of all npcs
maxCount
On Max Count All
int-1LogicNPCCounterPointBaseThe maximum count threshold of all npcs
minFactor
Min Factor All
int0LogicNPCCounterPointBaseThe minimum count of all npcs for factor calculations
maxFactor
Max Factor All
int0LogicNPCCounterPointBaseThe maximum count of all npcs for factor calculations
NPCType1
Class name of NPC 1 to count
npcclassLogicNPCCounterPointBase
NPCState1
NPC State 1
intchoices-1LogicNPCCounterPointBaseOnly match NPCs in this state
  • -1 Any
  • 0 None
  • 1 Idle
  • 2 Alert
  • 3 Combat
  • 4 Script
  • 5 Playdead
  • 6 Prone
  • 7 Dead
invertState1
Invert State
bool0LogicNPCCounterPointBase
minCount1
On Min Count 1
int-1LogicNPCCounterPointBaseThe minimum count threshold of npc 1
maxCount1
On Max Count 1
int-1LogicNPCCounterPointBaseThe maximum count threshold of npc 1
minFactor1
Min Factor 1
int0LogicNPCCounterPointBaseThe minimum count of npc 1 for factor calculations
maxFactor1
Max Factor 1
int0LogicNPCCounterPointBaseThe maximum count of npc 1 for factor calculations
defaultDist1
Default Dist 1
float0LogicNPCCounterPointBaseThe default minimum player distance of npc 1
NPCType2
Class name of NPC 2 to count
npcclassLogicNPCCounterPointBase
NPCState2
NPC State 2
intchoices-1LogicNPCCounterPointBaseOnly match NPCs in this state
  • -1 Any
  • 0 None
  • 1 Idle
  • 2 Alert
  • 3 Combat
  • 4 Script
  • 5 Playdead
  • 6 Prone
  • 7 Dead
invertState2
Invert State
bool0LogicNPCCounterPointBase
minCount2
On Min Count 2
int-1LogicNPCCounterPointBaseThe minimum count threshold of npc 2
maxCount2
On Max Count 2
int-1LogicNPCCounterPointBaseThe maximum count threshold of npc 2
minFactor2
Min Factor 2
int0LogicNPCCounterPointBaseThe minimum count of npc 2 for factor calculations
maxFactor2
Max Factor 2
int0LogicNPCCounterPointBaseThe maximum count of npc 2 for factor calculations
defaultDist2
Default Dist 2
float0LogicNPCCounterPointBaseThe default minimum player distance of npc 2
NPCType3
Class name of NPC 3 to count
npcclassLogicNPCCounterPointBase
NPCState3
NPC State 3
intchoices-1LogicNPCCounterPointBaseOnly match NPCs in this state
  • -1 Any
  • 0 None
  • 1 Idle
  • 2 Alert
  • 3 Combat
  • 4 Script
  • 5 Playdead
  • 6 Prone
  • 7 Dead
invertState3
Invert State
bool0LogicNPCCounterPointBase
minCount3
On Min Count 3
int-1LogicNPCCounterPointBaseThe minimum count threshold of npc 3
maxCount3
On Max Count 3
int-1LogicNPCCounterPointBaseThe maximum count threshold of npc 3
minFactor3
Min Factor 3
int0LogicNPCCounterPointBaseThe minimum count of npc 3 for factor calculations
maxFactor3
Max Factor 3
int0LogicNPCCounterPointBaseThe maximum count of npc 3 for factor calculations
defaultDist3
Default Dist 3
float0LogicNPCCounterPointBaseThe default minimum player distance of npc 3
box_outer_mins
Box Outer Mins
vector-64 -64 -64logic_npc_counter_aabb
box_outer_maxs
Box Outer Maxs
vector64 64 64logic_npc_counter_aabb