CFuncNavBlocker

From Source Entities
Jump to navigation Jump to search

Code classes:

CFuncNavBlocker is a code class in all Source games except Dods.pngHl2.pngP1.png.

Classnames:

  • func_nav_blocker - A brush entity that can block navmesh areas touching it so that bots will not attempt to go somewhere.

Important: The entity will not start to block automatically; it must first be activated with the BlockNav input.

Bug: In L4d2-small.png, when you make the func_nav_blocker block the navigation squares touching it, you must send UnblockNav along with BlockNav, if the blocker resides on the same navigation square(s) as a prop_door_rotating or func_physbox and perhaps other entities. Failure to do so will create the console error Area ### already blocked by a different team id. May produce flow bugs (and flow bugs do happen). The navigation square numbers can be seen in-game by pointing at the nav square with z_debug 1 and nav_edit 1.

Bug: Seems to not work in Tf2.png.

Note: L4d2-small.pngfunc_nav_blockers that are compiled into entity groups are converted to the entity script_nav_blocker.

Keyvalues[edit | edit source]

Team(s) to block (teamToBlock) <choices>
Which teams to block. Note: Css.pngCsgo-small.pngAlways affects both teams.
Value L4d.pngL4d2-small.png
-1 Everyone
2 Survivors
3 Infected
Affects Flow? (affectsFlow) <boolean> (only available in L4d2-small.png)
Set this if the blocker affects the general route of players through the entire map. Valve sets this for blockers on objects that change the player's path on a large scale, like the randomly-created fences in c5m3_cemetery.

Inputs[edit | edit source]

BlockNav
Starts blocking nav areas.
UnblockNav
Stops blocking nav areas.

See Also[edit | edit source]