GetAiNavigationBlockerData: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document G1R:MP 0.1.2 navigation collision API
 
Document new NPC/player-mode API and events available from 0.1.5
 
Line 40: Line 40:
[[Category:World Functions]]
[[Category:World Functions]]
[[Category:Navigation Functions]]
[[Category:Navigation Functions]]
<!-- npc015:start -->
== Additional field since 0.1.5 ==
The existing table additionally includes blocksSight (boolean). See [[setAiNavigationBlockerBlocksSight]].
<!-- npc015:end -->

Latest revision as of 17:14, 25 September 2026

getAiNavigationBlockerData

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.

Returns the canonical geometry and state of one blocker owned by the calling resource.

Syntax

table|false getAiNavigationBlockerData(string blockerId)

Parameters

Name Type Required Description
blockerId string yes The opaque decimal identifier returned by createAiNavigationBlocker. Keep it as a string.

Returns

Returns id, ownerResource, enabled, shape="polygon", points, minZ, and maxZ, or false for an unknown, invalid or foreign ID.

Examples

Inspect a blocker's canonical footprint:

local data = getAiNavigationBlockerData(blockerId)
if data then
    outputDebugString("vertices=" .. tostring(#data.points))
end

Notes

  • Available only in server-side resource scripts.
  • Box and cylinder inputs are returned as their conservative canonical convex polygon, so the returned shape is always "polygon".
  • Coordinates are converted back to metres. A resource cannot inspect another resource's blockers through this function.

Additional field since 0.1.5

The existing table additionally includes blocksSight (boolean). See setAiNavigationBlockerBlocksSight.