func_nav_blocker

From Valve Developer Community
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
Icon-callout-not-in-fgd.png
This entity is not in the FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CFuncNavBlocker
↳CBaseEntity
C++ nav_entities.cpp

func_nav_blocker is a brush entity available in all Source Source games since Left 4 Dead Left 4 Dead. It is also in Half-Life 2: Deathmatch Half-Life 2: Deathmatch, Counter-Strike: Source Counter-Strike: Source, Team Fortress 2 Team Fortress 2, and Black Mesa Black Mesa.

It blocks nav areas touching its AABB to restrict NPCs / Bots from crossing over it. func_door does something similar but allows dynamic changes without needing to recalculate the Navigation Mesh.

Note.pngNote: In Left 4 Dead seriesLeft 4 Dead series doesn't block nav areas automatically on spawn.
Warning.pngWarning: This entity applies its effect based on its AABB instead of its brush model. [ Edit ]

Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also: Generic Keyvalues, Inputs and Outputs available to all entities
Team(s) to block (teamToBlock) <choices>
Team this entity should block.
  • -1 : Everyone
    Warning.pngWarning: Team Fortress 2 The value -1 is not valid and the Nav Blocker will not work. The value -2 must be used to block everyone. Fix the FGD by opening common/Team Fortress 2/bin/tf.fgd, finding "func_nav_blocker" and replacing -1 with -2, or turn off SmartEdit and set teamToBlock to -2 directly.
  • 2 : Team Fortress 2 Red, Left 4 Dead seriesLeft 4 Dead series Survivors, Counter-Strike: Source Terrorists, Half-Life 2: Deathmatch Combine
  • 3 : Team Fortress 2 Blue, Left 4 Dead seriesLeft 4 Dead series Infected, Counter-Strike: Source Counter-Terrorists, Half-Life 2: Deathmatch Rebels
Note.pngNote: Counter-Strike: Global Offensive teamToBlock is non-functional. The entity always blocks either both teams or no team.
Affects Flow? (affectsFlow) <boolean> (only in Left 4 Dead 2)
Does this Nav Blocker block flow in the level? Only Nav Blocker with this enabled will cause flow recomputation on blocking/unblocking.
Icon-Important.pngImportant: If this is true, don't block the only path to the level's goal with it, otherwise the flow won't be computed properly.
Start Disabled (StartDisabled) <boolean> (not in Left 4 Dead seriesLeft 4 Dead series) !FGD
If set to false nav areas will be blocked right after spawning.

Inputs

BlockNav
Starts blocking nav areas.
UnblockNav
Stops blocking nav areas.
Kill
Will unblock nav areas before killing the nav blocker

FGD Code

Half-Life 2: Deathmatch Half-Life 2: Deathmatch
@SolidClass base(Targetname) = func_nav_blocker : "A brush entity that can block nav areas touching its AABB." 
[
	input BlockNav(void) : "Starts blocking nav areas."
	input UnblockNav(void) : "Stops blocking nav areas."

	teamToBlock(choices) : "Team(s) to block" : -1 : "Block the nav for bots on this team" =
	[
		-1 : "Everyone"
		2 : "Combine"
		3 : "Rebels"
	]
	
]
Counter-Strike: Source Counter-Strike: Source
@SolidClass base(Targetname) = func_nav_blocker : "A brush entity that can block nav areas touching its AABB." 
[
	input BlockNav(void) : "Starts blocking nav areas."
	input UnblockNav(void) : "Stops blocking nav areas."

	teamToBlock(choices) : "Team(s) to block" : -1 : "Block the nav for bots on this team" =
	[
		-1 : "Everyone"
		2 : "Terrorists"
		3 : "Counter-terrorists"
	]
	
]

See also

  • func_nav_prefer will influences bots to prefer this region by decreasing the pathfinding cost within it.
  • func_nav_avoid will influences bots to avoid this region by increasing the pathfinding cost within it.
  • func_nav_prerequisite will instruct bots to do a task when walking within it.