UpdateAiNavigationBlocker

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

updateAiNavigationBlocker

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Atomically replaces the geometry of a resource-owned navigation blocker.

Syntax

bool updateAiNavigationBlocker(string blockerId, table definition)

Parameters

Name Type Required Description
blockerId string yes The opaque decimal identifier returned by createAiNavigationBlocker. Keep it as a string.
definition table yes A validated box, cylinder, or convex polygon definition in metres.

Returns

Returns true when the ID, ownership and complete replacement definition are valid; otherwise returns false and keeps the previous geometry.

Examples

Move and resize an existing blocker:

updateAiNavigationBlocker(blockerId, {
    shape = "cylinder",
    x = 130.0, y = -45.0, z = 2.0,
    radius = 1.5, height = 4.0,
})

Notes

  • Available only in server-side resource scripts.
  • The accepted shape and unit contract is identical to createAiNavigationBlocker.
  • Omitting enabled preserves the current enabled state. Supplying it applies the new geometry and requested state together.
  • A successful material change records a bounded spatial revision. Only affected active paths are revalidated, and relevant removals wake previously blocked paths.
  • Use updates for occasional world-state changes, not per-tick animation. Moving characters are handled by the mandatory dynamic capsule layer.