Func nav blocker: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (clean up, replaced: {{ModernWarning| → {{warning|, See Also → See also, {{ModernNote| → {{note|)
Line 5: Line 5:
{{ModernBug|In {{l4d2}}, If{{ent|prop_door_rotating}}, {{ent|func_physbox}}, {{ent|func_door}}, etc resides on the same areas, send an<code>UnblockNav</code>input along a<code>BlockNav</code>input. Else the console reports "Area navsquare#[ID] already blocked by a different team ID." Confirm edit: Bug is real, however fix appears to be ineffective}}
{{ModernBug|In {{l4d2}}, If{{ent|prop_door_rotating}}, {{ent|func_physbox}}, {{ent|func_door}}, etc resides on the same areas, send an<code>UnblockNav</code>input along a<code>BlockNav</code>input. Else the console reports "Area navsquare#[ID] already blocked by a different team ID." Confirm edit: Bug is real, however fix appears to be ineffective}}
{{ModernBug|In {{tf2}}, this entity appears to be broken{{ref|1}}, however the other <code>func_nav_*</code> entities appear to work in MvM at the very least.}}
{{ModernBug|In {{tf2}}, this entity appears to be broken{{ref|1}}, however the other <code>func_nav_*</code> entities appear to work in MvM at the very least.}}
{{ModernNote|The entity won't block nav areas automatically on spawn (except in {{csgo}}). It is best practice to have either<code>BlockNav</code>or<code>UnblockNav</code>inputs sent with<code>[[logic auto|OnMapSpawn]]</code>.}}
{{note|The entity won't block nav areas automatically on spawn (except in {{csgo}}). It is best practice to have either<code>BlockNav</code>or<code>UnblockNav</code>inputs sent with<code>[[logic auto|OnMapSpawn]]</code>.}}
{{ModernWarning|Entity's [[AABB]] is used for blocking nav areas, so clipping or rotating brushes does not change a brush's size as one expects.<br>
{{warning|Entity's [[AABB]] is used for blocking nav areas, so clipping or rotating brushes does not change a brush's size as one expects.<br>
Diagonal walls will always be ignored, as it will take the furthest out corners of the diagonal walls and create one huge box around all of it. ''That'' box will be your brush entity.<br>
Diagonal walls will always be ignored, as it will take the furthest out corners of the diagonal walls and create one huge box around all of it. ''That'' box will be your brush entity.<br>
If you need a large diagonal brush, you must create multiple small square entities aligned diagonally.}}
If you need a large diagonal brush, you must create multiple small square entities aligned diagonally.}}
Line 16: Line 16:
{{I NavBlocker}}
{{I NavBlocker}}


== See Also ==
== See also ==
* {{l4d2}} [[script_nav_blocker]] - VScript catered version of func_nav_blocker.
* {{l4d2}} [[script_nav_blocker]] - VScript catered version of func_nav_blocker.


== References ==
== References ==
# https://github.com/ValveSoftware/Source-1-Games/issues/5269
# https://github.com/ValveSoftware/Source-1-Games/issues/5269

Revision as of 00:40, 4 January 2024

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CFuncNavBlocker
CBaseEntity
C++ nav_entities.cpp
Toolstrigger.gif

Template:Entity and also in Team Fortress 2. It blocks nav areas touching its AABB to restrict NPCs / Bots from crossing over it. Template:ModernBug Template:ModernBug

Note.pngNote:The entity won't block nav areas automatically on spawn (except in Counter-Strike: Global Offensive). It is best practice to have eitherBlockNavorUnblockNavinputs sent withOnMapSpawn.
Warning.pngWarning:Entity's AABB is used for blocking nav areas, so clipping or rotating brushes does not change a brush's size as one expects.

Diagonal walls will always be ignored, as it will take the furthest out corners of the diagonal walls and create one huge box around all of it. That box will be your brush entity.

If you need a large diagonal brush, you must create multiple small square entities aligned diagonally.

Keyvalues

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)
If set to false nav areas will be blocked right after spawning.

Inputs

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

See also

References

  1. https://github.com/ValveSoftware/Source-1-Games/issues/5269