Skip to content

Navmesh manipulation

Dreamy Cecil edited this page Feb 11, 2023 · 4 revisions

This document contains commands that can be entered in console in order to manipulate level's navigation mesh.

To read about gameplay commands, see this page.

Navmesh creation

The following commands affect the navmesh in its entirety.

  • MOD_GenerateNavMesh(connect) - simple NavMesh generator for the current world:
  0 - generate points
  1 - connect points (very simplistic, not recommended over manual point connections)
  • MOD_NavMeshSave() - save current NavMesh into Cecil/Navmeshes under the world filename
  • MOD_NavMeshLoad() - load current NavMesh from Cecil/Navmeshes under the world filename
  • MOD_NavMeshClear() - clear the entire NavMesh

Navmesh editing

The following commands are used for basic editing of the navmesh.

  • MOD_iRenderNavMesh - display world NavMesh:
  0 - disabled
  1 - render points
  2 - render connections and range
  3 - display IDs
  4 - display flags
  • MOD_fNavMeshRenderRange - NavMesh point rendering range (0 for infinite)
  • MOD_iNavMeshPoint - currently selected NavMesh point by its ID
  • MOD_NavMeshSelectPoint() - select closest NavMesh point to the player's crosshair position or target already selected point (if MOD_iNavMeshConnecting is not 0)

  • MOD_NavMeshConnectionType() - change NavMesh connection type (see MOD_iNavMeshConnecting)
  • MOD_iNavMeshConnecting - currently selected NavMesh connection type:
  0 - disabled (point selection)
  1 - one-way connection (connect current point to the target / bot can go from this point to another)
  2 - two-way connection (connect points to each other / bot can go from this point to another and back)
  3 - one-way backwards connection (connect target point to the current one / bot can only go from another point to this one)
  • MOD_AddNavMeshPoint(offset, grid size) - create a new NavMesh point at the player position with vertical offset and snapping its position to some grid size
  • MOD_DeleteNavMeshPoint() - delete currently selected NavMesh point
  • MOD_NavMeshPointInfo() - display NavMesh point info
  • MOD_ConnectNavMeshPoint(target ID) - connect NavMesh point to the target point using its ID.
  • MOD_TeleportNavMeshPoint(offset) - move NavMesh point to the player position (with vertical offset)

Navmesh properties

The following commands are used for editing various properties of a selected navmesh point.

  • MOD_NavMeshPointPos(x, y, z) - change NavMesh point position
  • MOD_SnapNavMeshPoint(grid size) - snap NavMesh point position to a some grid
  • MOD_NavMeshPointFlags(mask) - set NavMesh point flags as a base 10 bit mask (e.g. 21 = 16 + 4 + 1)
  Available flags:
   1 "walk"        - don't run from this point
   2 "jump"        - jump from this point
   4 "crouch"      - crouch while going from this point
   8 "override"    - apply point's flags before reaching the point (e.g. jump TO this point)
  16 "unreachable" - cannot be reached directly by foot (only for target points)
  32 "teleport"    - point is at a teleport and has 0 distance to any target point (for calculating shorter path)
  • MOD_NavMeshPointEntity(entity ID) - set NavMesh point entity by its ID (-1 for none)
  • MOD_NavMeshPointRange(range) - change NavMesh point range
  • MOD_NavMeshPointNext(point ID) - next important point to go to after this one

  • MOD_NavMeshPointLock(entity ID) - set some entity as the point's "lock" (meaning that this point will only be accessible when the set entity is at the exact same place as it was when it's been set)
If you see a [pale yellow] line going to a NavMesh point, it means that it's connected to this "lock entity"
If you see any of these lines connected to the set "lock" entity, it means that the NavMesh point is currently inaccessible:
  [Pale green] line indicates the difference between the origin position and the current position of the "lock" entity
  [Pale blue] line indicates origin angle of the "lock" entity
  [Pale red] line indicates the current angle of the "lock" entity