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

Func nav blocker: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added tf2 to available games list)
 
(42 intermediate revisions by 14 users not shown)
Line 1: Line 1:
Available in {{l4d}} {{l4d2}} {{csgo}} {{tf2}}. It is a brush entity that can block [[NAV|nav]] areas touching its AABB used to restrict NPCs from crossing over nav areas.
{{LanguageBar}}{{ent not in fgd}}
{{CD|CFuncNavBlocker|file1=nav_entities.cpp}}
[[File:Toolstrigger.gif|left]]
{{this is a|brush entity|name=func_nav_blocker|since=Left 4 Dead}} It is also in {{hl2dm|4}}, {{css|4}}, {{tf2|4}}, and {{bms|4}}. It blocks [[Navigation Meshes|nav areas]] touching its [[Bounding volume|AABB]] to restrict NPCs / Bots from crossing over it.
{{note|In {{l4ds}} doesn't block nav areas automatically on spawn.}}
{{AABBwarning}}
__NOTOC__


{{todo|Any other games?}}
== Keyvalues ==
{{KV Targetname}}
{{KV NavBlocker}}
{{KV|Start Disabled|not={{l4ds}}|intn=StartDisabled|bool|If set to false nav areas will be blocked right after spawning.|nofgd=1}}


{{todo|Use templates to display which games include this entity.}}
== Inputs ==
{{note|The entity will NOT start to block automatically: it must first be activated with the <code>BlockNav</code> input.}}
{{I NavBlocker}}
{{I|Kill|Will unblock nav areas before [[kill]]ing the nav blocker}}


{{bug| For {{l4d2}}, When you make the func_nav_blocker block the navigation squares touching it, you must send UnblockNav (Yes not intuitive) along with BlockNav  if the func_nav_blocker resides on the same navigation square(s) as a [[prop_door_rotating|prop_door_rotating]] or [[func_physbox|func_physbox]] and perhaps others entities. Failure to do so will create the console error "Area navsquare# already blocked by a different team  id. May produce [[L4D_Level_Design/Nav_Flow|flow]] bugs" ( Which is does). The navigation square numbers can be seen in-game by pointing at the nav square with z_debug 1 and nav_edit 1. }}
== FGD Code ==


{{expand|title={{hl2dm|2}}|1=<source lang=cpp>
@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."


== Keyvalues ==
teamToBlock(choices) : "Team(s) to block" : -1 : "Block the nav for bots on this team" =
{{KV|Team(s) to block|choices|Team(s) this entity should block}}
[
:* -1 : Everyone
-1 : "Everyone"
:* 2 : {{l4d}}{{l4d2}} Survivors, {{csgo}} Terrorists
2 : "Combine"
:* 3 : {{l4d}}{{l4d2}} Infected, {{csgo}} Counter-Terrorists
3 : "Rebels"
{{KV|Affects Flow?|boolean|Does this func_nav_blocker block flow in the level? Only func_nav_blockers with this enabled will cause flow recomputation on blocking/unblocking.}}
]
{{KV Targetname}}
{{KV EnableDisable}}
]</source>}}
{{note|This KeyValue is not available in Smart Edit and must be added manually.}}
{{warning|Enabled/disabled state does ''not'' block or unblock NAV areas. Use <code>BlockNav</code>/<code>UnblockNav</code>}}


{{KV|Recheck Breakables|Boolean|Appears to respond to any changes to breakables even though a BlockNav/UnblockNav input is fire anyway from the breakable prop anyway.}}
{{expand|title={{css|2}}|1=<source lang=cpp>
{{note|This KeyValue is not available in Smart Edit and must be added manually.}}
@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."


== Inputs ==
teamToBlock(choices) : "Team(s) to block" : -1 : "Block the nav for bots on this team" =
{{IO|BlockNav|Starts blocking nav areas.|param=string}}
[
{{IO|UnblockNav|Stops blocking nav areas.}}
-1 : "Everyone"
{{I Targetname}}
2 : "Terrorists"
{{I EnableDisable}}
3 : "Counter-terrorists"
{{warning|Enabled/disabled state does ''not'' block or unblock NAV areas.}}
]
]</source>}}


== Outputs ==
== See also ==
{{O Targetname}}
* {{l4d2}} {{ent|script_nav_blocker}} - VScript catered version of func_nav_blocker.

Latest revision as of 11:16, 4 April 2025

English (en)中文 (zh)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the Counter-Strike: SourceHalf-Life 2: DeathmatchAlien SwarmPortal 2 FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CFuncNavBlocker
CBaseEntity
C++ nav_entities.cpp
Toolstrigger.gif

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.

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>[ Edit ]
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 for everyone either edit FGD and use value -2 or turn off smart edit and set that, -1 is not valid and the nav blocker will not work
  • 2 : Red Team Fortress 2, Survivors Left 4 Dead seriesLeft 4 Dead series, Terrorists Counter-Strike: Source Counter-Strike: Global Offensive
  • 3 : Blue Team Fortress 2, Infected Left 4 Dead seriesLeft 4 Dead series, Counter-Terrorists Counter-Strike: Source Counter-Strike: Global Offensive
Note.pngNote:Counter-Strike: Global Offensive teamToBlock non-functional, always blocks either for both teams or for 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:When this is true don't block the only path to the level's goal with it or 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