Addon ID

  • salmanshh_platformer_navigationgraph

Info

Statistics

  • Download count14 total downloads
  • Latest download count 5 downloads of latest version
  • Average download count2 downloads per day average

Owners

A list of all Actions, Conditions and Expressions supported in this addon.

Debug

  • Actions

    {my}: Log graph stats to console

    Print navigation graph statistics to the browser console. Useful for debugging: shows node count, connection count, portal count, etc.

  • Conditions

    {my}: Graph node exists at grid ({0}, {1})

    Check if a navigation node exists at the specified grid coordinates. Use this to validate positions before pathfinding or placing objects.

    {my}: Graph node exists at world ({0}, {1})

    Check if a navigation node exists at the specified world coordinates. Use this to validate world positions before pathfinding.

    {my}: Graph node at ({0}, {1}) is a ledge

    True if the node at the given grid coordinates is a ledge node (left or right ledge).

  • Expressions

    CalculatedJumpDistance

    Get the calculated maximum jump distance in pixels. This is the value used to build graph connections. Useful for debugging jump arc detection.

    CalculatedJumpHeight

    Get the calculated maximum jump height in pixels. This is the value used to build graph connections. Useful for debugging jump arc detection.

    GraphNodeAtIndexConnectionCount

    Get the number of outgoing connections from the node at the given index.

    GraphNodeAtIndexGridX

    Get the grid X coordinate of the node at the given index.

    GraphNodeAtIndexGridY

    Get the grid Y coordinate of the node at the given index.

    GraphNodeAtIndexIsLeftLedge

    Returns 1 if the node at the given index is a left ledge, 0 otherwise.

    GraphNodeAtIndexIsRightLedge

    Returns 1 if the node at the given index is a right ledge, 0 otherwise.

    GraphNodeAtIndexIsSlope

    Returns 1 if the node at the given index is a slope node, 0 otherwise.

    GraphNodeAtIndexX

    Get the world X position of the node at the given index.

    GraphNodeAtIndexY

    Get the world Y position of the node at the given index.

    GraphNodeConnectionAction

    Get the action string for a connection from the given grid node (e.g. 'walk', 'jump', 'fall', 'portal').

    GraphNodeConnectionCost

    Get the movement cost for a connection from the given grid node.

    GraphNodeConnectionCount

    Get the number of outgoing connections from the node at the given grid coordinates.

    GraphNodeConnectionTargetX

    Get the world X position of the target node for a connection from the given grid node.

    GraphNodeConnectionTargetY

    Get the world Y position of the target node for a connection from the given grid node.

    GraphNodeCount

    Get the total number of navigation nodes in the generated graph. Returns 0 if no graph exists.

    GraphNodeWorldX

    Get the world X position of a node at the specified grid coordinates. The node position is centred within the tile. Returns 0 if node doesn't exist.

    GraphNodeWorldY

    Get the world Y position of a node at the specified grid coordinates. The node position is centred within the tile. Returns 0 if node doesn't exist.

    IsGraphNodeIsland

    Returns 1 if the node at the given grid coordinates is an island node (no horizontal neighbors), 0 otherwise.

    IsGraphNodeLeftLedge

    Returns 1 if the node at the given grid coordinates is a left ledge, 0 otherwise.

    IsGraphNodeRightLedge

    Returns 1 if the node at the given grid coordinates is a right ledge, 0 otherwise.

    IsTileJumpThru

    Returns 1 if the tile at the given grid coordinates is a jump-through tile, 0 otherwise.

    NearestGraphNodeGridX

    Get the grid X coordinate of the nearest navigation node to a given world position.

    NearestGraphNodeGridY

    Get the grid Y coordinate of the nearest navigation node to a given world position.

    NearestGraphNodeX

    Get the world X position of the nearest navigation node to a given world position.

    NearestGraphNodeY

    Get the world Y position of the nearest navigation node to a given world position.

    PlatformJumpStrength

    Get the platform behavior's jump strength value. Useful for debugging jump parameter detection.

    PlatformMaxSpeed

    Get the platform behavior's max speed value. Useful for debugging jump parameter detection.

Hazards

  • Actions

    {my}: Add {0} hazard at ({1}, {2}) [Size: {3} x {4}] [Severity: {5}]

    Mark an area as dangerous, centred on a position. Characters prefer routes around it. For objects, use 'Add hazard from object' instead.

    {my}: Add hazard from {0} [Severity: {1}]

    Turn objects into hazards. Every picked instance becomes a hazard matching its collision shape. One that moves covers the whole space it moves through. Removed when the object is destroyed.

    {my}: Clear {0} hazards

    Remove hazards by kind.

    {my}: Remove hazard {0}

    Remove a hazard by its ID. Use this when a danger zone is no longer active. The graph will be regenerated if needed.

    {my}: Remove hazard from {0}

    Remove the hazards of the picked objects without destroying them, for example spikes that retract. 'Add hazard from object' brings them back.

    {my}: Set hazard radius to {0} tiles

    Set how far hazard costs spread around each hazard. The cost fades out over this many tiles.

    {my}: Set tile hazard at ({0}, {1}) to {2}

    Set the hazard severity for a specific tile. Higher values make the AI avoid this tile more strongly. 0 = no hazard. Hazard avoidance is automatically enabled when any hazard is added. Use this to mark dangerous areas like spikes or lava.

  • Conditions

    {my}: Is position ({0}, {1}) hazardous

    Check if a specific world position is within any hazard area (circle, rect, or tile). Returns true if any hazard affects this position.

  • Expressions

    HazardCount

    Get the total number of active hazards (circles and rectangles). Does not include tile hazards.

    HazardRadius

    Get the current hazard radius setting in tiles. This affects how far hazard influence spreads.

    HazardSeverity

    Get the total hazard severity at a world position from all sources (circles, rects, tiles). Higher values = more dangerous.

    LastHazardID

    The ID of the most recently added hazard (circle or rectangle). Read it right after an Add hazard action and store it in a variable to remove or track that hazard later. Returns 0 if no hazard has been added yet.

    PositionIsHazardous

    Check if a world position is hazardous. Returns 1 if hazardous, 0 if safe.

    TileHazardSeverity

    Get the hazard severity of a specific tile. Returns 0 if no hazard. Only checks tile-based hazards, not circles/rects.

    TrackedHazardCount

    The number of active tracked (object-following) hazards.

Movement

  • Actions

    {my}: Jump toward ({0}, {1})

    Jump directly toward a position with full strength, no pathfinding. Works from the floor, or mid-air when double jump is enabled. Triggers 'On jump toward launched' when the jump starts.

    {my}: Set auto-control: {0}

    Toggle auto-movement on/off. When enabled, the behavior automatically controls the Platform behavior to follow paths. When disabled, you control movement yourself using path data expressions.

    {my}: Set {0}

    Enable or disable this behavior. Disabled freezes navigation with all state kept for a seamless resume; Find path is ignored, map setup actions still work.

    {my}: Set ledge restriction: {0}

    Toggle whether the character stops at platform edges instead of casually walking off. Paths that require a jump or fall still leave the platform.

    {my}: Set {0} to {1}

    Change a movement setting. Jump and fall limits override the values read from the Platform behavior and lock in; the navigation graph rebuilds automatically.

    {my}: Set multiplayer mode to {0}

    Choose where this character navigates in a multiplayer game. By default it runs only on the host and pauses itself on peers.

    {my}: Set patrol option {0}: {1}

    Turn one of the automatic patrol behaviors on or off. Both are on by default.

    {my}: Set patrol {0} to {1}

    Tune patrolling. Settings belong to the character and apply to both Start patrol and Start patrol between objects.

    {my}: Set strict jump positioning: {0}

    Toggle whether the character slows down and centers itself before jumps and falls. Does not affect walking off edges (use 'Set ledge restriction' for that).

    {my}: Start patrol (dwell {0} s, edge distance {1} px)

    Patrol the current platform: walk to one end, wait for the dwell time, turn, and repeat. The ends are found automatically from the graph's ledges and walls, slopes included. Any Find path call ends the patrol.

    {my}: Start patrol between {0} ({1}, dwell {2} s)

    Patrol a route: visit the picked instances of an object in order and wait at each, pathing between them with walks, jumps, falls, portals and moving platforms. Starts at the nearest marker. Any Find path call ends the patrol.

    {my}: Stop patrol

    End the current patrol (platform or route). The character simply stands where it is.

  • Conditions

    {my}: Is at island

    Check if the character is standing on a single-tile platform (isolated platform). Use this to detect precarious positions or trigger special behaviors.

    {my}: Is at ledge

    Check if the character is currently standing on a ledge node (edge of a platform). Use this to trigger ledge-specific behaviors or animations.

    {my}: Is enabled

    True while this behavior is enabled (see the Enabled property and the 'Set enabled' action).

    {my}: Is patrolling

    True while a patrol is active (Start patrol or Start patrol between objects).

    {my}: Platform behavior is enabled

    Check if the associated Platform behavior is currently enabled. Returns false if Platform behavior is disabled or not found.

    {my}: On jump toward launched

    Triggered when the 'Jump toward position' action launches the character. Use this to play attack animations, spawn effects, or apply damage. The target position is available via JumpTowardTargetX/Y expressions.

    {my}: On arrived

    Triggered when the AI arrives at the final destination. Use this to trigger arrival animations, next actions, or goal completion logic.

    {my}: On patrol dwell finished

    Triggered when a patrolling character finishes its wait at a patrol end or marker and walks on. PatrolDirection already reports the new walk direction inside this trigger. Not fired when the dwell time is 0; use 'On patrol end reached' there.

    {my}: On patrol dwell started

    Triggered when a patrolling character begins its wait at a patrol end or marker, right after 'On patrol end reached'. Use it to start idle or look-around animations. Not fired when the dwell time is 0.

    {my}: On patrol end reached

    Triggered each time a patrolling character reaches an end of its patrol (or a marker, with 'Start patrol between objects') and is about to turn or move on. Use it for look-around animations during the dwell.

    {my}: On waypoint reached

    Triggered each time the character reaches a waypoint along the path. Use this to play footstep sounds, particle effects, or update animations.

    {my}: On waypoint stuck

    Triggered when the character has been stuck at a waypoint for too long (exceeds Max Waypoint Time). The path is automatically cancelled. Use this to handle stuck situations or repath.

  • Expressions

    CoyoteTime

    Get the current coyote time setting in seconds. This is the window after walking off a ledge where jumps are still allowed.

    CoyoteTimer

    Get the current coyote timer value in seconds. This counts down after leaving the ground. Returns 0 when on ground or timer expired.

    EstimatedVelocityX

    Get the estimated horizontal velocity needed to follow the current path. Returns 0 if no path is active.

    JumpTowardTargetX

    Get the world X position of the jump-at target. Returns 0 if not in jump-at mode.

    JumpTowardTargetY

    Get the world Y position of the jump-at target. Returns 0 if not in jump-at mode.

    LedgeLeniency

    Get the ledge leniency setting in pixels. This is how far past a ledge edge the AI can walk before stopping.

    LedgeRestriction

    Get whether ledge restriction is enabled. Returns 1 if enabled, 0 if disabled.

    PatrolDirection

    The patrol walk direction: -1 walking left, 1 walking right, 0 when not patrolling or dwelling at an end. Useful for mirroring the sprite.

    PatrolPointIndex

    During 'Start patrol between objects': the marker the character is at or heading to, counting from 0 in instance order. -1 when no route patrol is active.

    StoppingDistance

    Get the calculated stopping distance in pixels based on the Platform behavior's current speed. Used for waypoint arrival detection.

    StrictJumpPositioning

    Get whether strict jump positioning is currently active for this character. Returns 1 if enabled, 0 if disabled. Useful for conditional logic, e.g. switching between careful and aggressive pathfinding modes.

Obstacles

  • Actions

    {my}: Build obstacle map [{0}×{1} px]

    Create a fresh, empty obstacle map grid of the given size, discarding the previous tiles and slopes. Follow with the Scan actions to fill it. The navigation graph rebuilds automatically. To simply rescan everything, use Regenerate obstacle map.

    {my}: Clear all slope markings

    Remove all slope markings from the obstacle map. Slopes will be treated as regular solid tiles. Also forgets slope tiles registered with the Map and Auto-detect slope actions.

    {my}: Clear obstacle map

    Remove the obstacle map and all associated data. Use this when switching levels or resetting the navigation system.

    {my}: Create custom obstacle map [Width: {0} tiles] [Height: {1} tiles]

    Create a custom obstacle map with the specified dimensions in tiles. All tiles are initialized to 'clear' state. Use this for fully manual tile setup.

    {my}: Load obstacle map from JSON: {0}

    Load a previously saved obstacle map from JSON string. Use this to restore saved maps or load pre-built level data.

    {my}: Map slopes from {0}: left={1} right={2} gentle-left={3} gentle-right={4}

    Scan a Tilemap and mark tiles matching the given tile IDs as slopes. Pass tile IDs as comma-separated strings (e.g. '5,6,7'). Pass empty string to skip a slope type. Remembered and re-applied whenever the obstacle map is rebuilt.

    {my}: Mark slope from ({0},{1}) to ({2},{3}) as {4}

    Mark a diagonal region of tiles as slope. Specify the start and end grid corners. All tiles along the diagonal will be marked as slope with the given direction.

    {my}: Regenerate obstacle map

    Rescan every object with the Solid or Jump-thru behavior where it is now, including slopes, then rebuild the navigation graph. Use after moving, adding or removing obstacles. Fires 'On navigation graph generated' when done.

    {my}: Regenerate region ({0}, {1}) to ({2}, {3})

    Rescan the obstacles inside a rectangle and update only the nearby part of the navigation graph. Much cheaper than Regenerate obstacle map for local changes. Spread across frames; a Find path in the same tick waits for it.

    {my}: Regenerate region by {0}

    Rescan the area covered by the picked instances of an object and update only the nearby part of the navigation graph. Use after changing an obstacle without moving it, such as enabling or disabling its Solid behavior.

    {my}: Scan {0} (jump-thru) into obstacle map

    Add one-way platform objects to the obstacle map as jump-thru cells, at their current positions. Requires an obstacle map (Build obstacle map from layout first). The navigation graph rebuilds automatically. Objects must have the Jump-thru behavior enabled.

    {my}: Scan {0} (solid) into obstacle map

    Add solid objects to the obstacle map at their current positions, using their collision polygons. Requires an obstacle map (Build obstacle map from layout first). The navigation graph rebuilds automatically. Scans only add cells; after obstacles move, use Regenerate obstacle map.

    {my}: Set navigation area ({0}, {1}) to ({2}, {3})

    Limit the navigation map to a rectangle, for streamed and endless worlds: keep it around the action and memory stays flat. Calling it again moves the window: only newly covered cells are scanned and cells left behind are dropped. Characters outside the area cannot find paths. Use the same value for both corners to go back to covering everything automatically.

    {my}: Set tile at ({0}, {1}) to {2}

    Set the state of a tile at the specified grid coordinates. Use this to mark tiles as solid obstacles, clear space, jump-thru platforms, areas to avoid, or slopes.

    {my}: Set tile at world ({0}, {1}) to {2}

    Set the state of a tile at the specified world coordinates. The world position is automatically converted to grid coordinates.

  • Conditions

    {my}: On obstacle map created

    Triggered when a custom obstacle map is successfully created. Use this to start configuring tiles after map creation.

    {my}: On obstacle map removed

    Triggered when the obstacle map is cleared or removed. Use this to clean up related data or reset systems.

    {my}: Tile at ({0}, {1}) has state {2}

    Check if a tile at the given grid position has the specified state. Use this to query tile properties before actions.

    {my}: Tile at world ({0}, {1}) has state {2}

    Check if a tile at the given world position has the specified state. World coordinates are automatically converted to grid coordinates.

  • Expressions

    GridHeight

    Get the height of the obstacle map in tiles. Returns 0 if no map exists.

    GridOriginX

    The world X co-ordinate of grid tile 0, in pixels. 0 unless the obstacle map covers content left of the layout or grew to include it. World X = GridOriginX + tile X * GridTileSize.

    GridOriginY

    The world Y co-ordinate of grid tile 0, in pixels. 0 unless the obstacle map covers content above the layout or grew to include it. World Y = GridOriginY + tile Y * GridTileSize.

    GridTileSize

    Get the tile size in pixels. Returns 0 if no map exists.

    GridWidth

    Get the width of the obstacle map in tiles. Returns 0 if no map exists.

    MapTag

    The map tag this instance navigates with (from the Map Tag property). Instances with the same tag on a layout share one navigation map. Returns an empty string for the default shared map.

    ObstacleMapJSON

    Get the current obstacle map as a JSON string. Use this to save the map to local storage or export to files.

    ObstacleMapSource

    Get the source of the current obstacle map. Returns 'collision', 'custom', or 'none'.

    SlopeDirection

    Get the slope direction of a tile at the specified grid coordinates. Returns 'left', 'right', or empty string if not a slope.

    TileState

    Get the state of a tile at the specified grid coordinates. Returns 'solid', 'clear', 'jump-thru', 'avoid', 'slope-left', 'slope-right', or empty string if out of bounds.

    WorldToGridX

    Convert a world X position to grid X coordinate. Returns the grid tile number at the given pixel position.

    WorldToGridY

    Convert a world Y position to grid Y coordinate. Returns the grid tile number at the given pixel position.

Pathfinding

  • Actions

    {my}: Find {1} {0} on same platform

    Search the object's picked instances for the nearest or furthest one reachable by walking alone, no jumps or falls. Read the result with PlatformObjectUID and pick it with the System 'Pick by unique ID' condition (-1 = none).

    {my}: Find path to ({0}, {1}) [Ground correction: {2}] [Mode: {3}] [Jump positioning: {4}]

    Calculate a path to the target coordinates with full control over ground correction, path mode, and jump positioning. For the common case, the simpler 'Find path' or 'Find path to object' actions are recommended.

    {my}: Find path to ({0}, {1})

    Calculate a path to a position with sensible defaults: positions snap to walkable ground, and an unreachable target paths as close as possible. Use 'Find path to position (advanced)' for full control.

    {my}: Find path to nearest ledge ({0}) at distance {1}

    Calculate a path to the nearest platform edge in the given direction, stopping the given distance back from it. Triggers 'On failed to find path' if no ledge exists that way.

    {my}: Find path to {0}

    Calculate a path to another object's position with sensible defaults: positions snap to walkable ground, and an unreachable target paths as close as possible. Uses the first picked instance.

    {my}: Find path to {1} side of {0} at distance {2}

    Calculate a path to a position beside another object instead of on top of it, keeping the given distance (both widths are always cleared). 'Any' picks the nearer side, falling back if it has no ground. Uses the first picked instance.

    {my}: Set {0}: {1}

    Enable or disable one of the features that help groups of characters share a map.

    {my}: Set max paths per tick to {0}

    Set how many pathfinding requests can be processed per game tick. Higher values reduce latency but increase CPU cost per frame. Default is 1.

    {my}: Set max traversal drop to {0} px

    Limit how far down this character will ever descend by air: jumps and falls with a larger net drop are excluded from its paths, so it descends via slopes and portals instead. For heavy units and fall damage.

    {my}: Set path strategy to {0}

    Change how routes are picked. Balanced: distance and difficulty weighed equally. Shortest Distance: fastest route, momentum jumps included. Safest Route: short hops and drops over long leaps. Ground-Hugging: walk whenever possible. No Falling: never descend by air; slopes and portals only. Walk Only: never jump or fall at all; stay on the platform.

    {my}: Set re-path cooldown to {0} seconds

    Set the minimum time in seconds between automatic re-path attempts. Lower values = more responsive re-pathing but more CPU usage. Default is 0.5 seconds.

    {my}: Set re-path threshold to {0} tiles

    Set how many tiles the character can drift from the path before automatic re-pathing triggers. Higher values = more tolerance for deviation.

    {my}: Set separation {0} to {1}

    Change an idle separation setting: Distance (personal space in pixels, 0 = off), Cooldown (rest after giving up, in seconds, 0 = never rest), or Give-up time (trying time before resting, in seconds).

    {my}: Stop

    Stop the character immediately and clear the current path. Use when you want to cancel AI navigation and regain manual control.

  • Conditions

    {my}: Is moving along path

    Check if the character currently has an active pathfinding path. Returns true while navigating, false when idle or path is complete. Matches the built-in Pathfinding behavior's 'Is moving along path'.

    {my}: {0} is enabled

    True if the chosen crowd feature is currently enabled.

    {my}: Is on same platform as {0}

    True when the character can walk to the object without jumping or falling: both stand on the same connected stretch of ground, slopes included. Useful for picking a target to path to, or choosing between walking and lunging. Uses the first picked instance of the object.

    {my}: Is calculating path

    True when a pathfinding request has been submitted but not yet resolved (queued behind the per-tick path budget). Use to show a 'thinking' state or delay actions until the path arrives.

    {my}: On navigation graph generated

    Triggered when the navigation graph has been successfully generated. Use this to start pathfinding operations after map setup.

    {my}: On side of object reached

    Triggered when a 'Find path to side of object' arrival lands with the character beside the target at the requested distance. A stopped-short arrival fires only 'On arrived'. Read the side with ReachedObjectSide.

    {my}: On failed to find path

    Triggered when pathfinding fails to find a valid path to the target. Use this to handle unreachable destinations or implement fallback behaviors.

    {my}: On path found

    Triggered when a path has been successfully calculated. Use this to start custom actions when pathfinding succeeds.

    {my}: On re-path triggered

    Triggered when automatic re-pathing occurs due to the character drifting too far from the path. Use this to monitor navigation accuracy.

  • Expressions

    AngleToWaypoint

    Get the angle in degrees from the character to the current waypoint. Returns 0 if no path is active.

    CurrentPathAction

    Get the action name for a waypoint by index (e.g., 'walk', 'jump', 'fall', 'portal'). Returns empty string if index is out of bounds.

    CurrentWaypoint

    Get the index of the current waypoint the character is moving toward. Returns -1 if no path is active.

    CurrentWaypointX

    Get the world X position of the current waypoint. Returns 0 if no path is active.

    CurrentWaypointY

    Get the world Y position of the current waypoint. Returns 0 if no path is active.

    DistanceToWaypoint

    Get the distance in pixels from the character to the current waypoint. Returns 0 if no path is active.

    IdleSeparation

    The idle separation distance in pixels (0 = off).

    MaxPathsPerTick

    Get the current maximum paths per tick setting.

    MaxTraversalDrop

    The maximum downward drop this character will traverse by air, in pixels. -1 means no limit.

    NearbyAgentCount

    Get the number of nearby agents sharing the same navigation map.

    NearestLedgeLeftX

    The X co-ordinate of the nearest ledge to the left of the character, in pixels. Returns 0 if none exists.

    NearestLedgeLeftY

    The Y co-ordinate of the nearest ledge to the left of the character, in pixels. Returns 0 if none exists.

    NearestLedgeRightX

    The X co-ordinate of the nearest ledge to the right of the character, in pixels. Returns 0 if none exists.

    NearestLedgeRightY

    The Y co-ordinate of the nearest ledge to the right of the character, in pixels. Returns 0 if none exists.

    OnSamePlatform

    1 if the position is on the same walkable platform as the character (reachable by walking only, no jumps or falls), else 0.

    PathCost

    Get the total calculated cost of the current path. Returns 0 if no path is active.

    PathEndX

    The world X of the calculated path's final position: the last waypoint, where the character will actually end up. In Nearest mode this can differ from the requested target (the path stops at the closest reachable spot). Returns 0 if no path has been calculated.

    PathEndY

    The world Y of the calculated path's final position: the last waypoint, where the character will actually end up. In Nearest mode this can differ from the requested target (the path stops at the closest reachable spot). Returns 0 if no path has been calculated.

    PathFailReason

    Get the reason the last pathfinding attempt failed. Returns: 'no_start_node', 'no_goal_node', 'max_nodes_reached', 'no_path', or empty string if path succeeded.

    PathQueueSize

    Get the number of pathfinding requests currently waiting in the queue.

    PathStrategy

    Get the current path strategy preset (balanced, shortest, safest, simplest, no_drop, walk_only). Note: 'simplest' is the Ground-Hugging strategy and 'no_drop' is No Falling; keys keep their internal names for save compatibility.

    PlatformObjectUID

    The UID of the instance found by 'Find object on same platform', for the System 'Pick by unique ID' condition. -1 if none was on the platform.

    ReachedObjectSide

    Which side of the target the character reached: -1 left, 1 right. Valid after 'On side of object reached' fires, 0 otherwise.

    RePathCooldown

    Get the current re-path cooldown in seconds. This is the minimum time between automatic re-path attempts.

    RePathThreshold

    Get the current re-path threshold in tiles. This is how far the character can drift before automatic re-pathing triggers.

    SeparationCooldown

    The separation cooldown in seconds (rest time after giving up on idle separation; 0 = never rest).

    SeparationGiveUpTime

    How long a character keeps trying to separate before giving up and resting, in seconds.

    TargetGridX

    The grid X coordinate of the requested path target (after ground correction snaps it to walkable ground).

    TargetGridY

    The grid Y coordinate of the requested path target (after ground correction snaps it to walkable ground).

    TargetX

    The world X of the requested path target, as passed to the last Find path action. For where the calculated path actually ends, use PathEndX.

    TargetY

    The world Y of the requested path target, as passed to the last Find path action. For where the calculated path actually ends, use PathEndY.

    WaypointCount

    Get the total number of waypoints in the current path. Returns 0 if no path is active.

    WaypointGridX

    Get the grid X coordinate of a waypoint by index. Returns -1 if index is out of bounds.

    WaypointGridY

    Get the grid Y coordinate of a waypoint by index. Returns -1 if index is out of bounds.

    WaypointX

    Get the world X position of a waypoint by index. The waypoint position is centred within the tile. Returns 0 if index is out of bounds.

    WaypointY

    Get the world Y position of a waypoint by index. The waypoint position is centred within the tile. Returns 0 if index is out of bounds.

Portals

  • Actions

    {my}: Add elevator stop to group {0} at ({1}, {2}) [Speed: {3}] [Tag: {4}]

    Add a stop to an elevator group: two-way gradual portals to every other stop in the group are created automatically, with cost from distance and speed. Use a unique group name per elevator.

    {my}: Add elevator stop to group {0} at {1} [Speed: {2}] [Tag: {3}]

    Add an elevator stop using an object as the floor marker. Same as 'Add elevator stop', but the stop follows the object if it moves.

    {my}: Add {0} {1} portal from ({2}, {3}) to ({4}, {5}) [Cost: {6}] [Speed: {7}] [Tag: {8}]

    Add a portal between two positions. Characters path through it like any other route. Use 'On portal entry' with 'Pause at portal' to play animations first.

    {my}: Add {0} {1} portal from {2} to {3} [Cost: {4}] [Speed: {5}] [Tag: {6}]

    Add a portal between two objects. The portal follows the objects as they move and is removed if either object is destroyed.

    {my}: Complete portal

    Finish a paused portal without its built-in movement, when your events moved the character themselves. Also works mid-traverse to cut a gradual portal short.

    {my}: Pause at portal

    Hold the character at the portal entry. Only valid inside 'On portal entry'. Call 'Resume portal' to run the built-in movement, or 'Complete portal' if your events moved the character.

    {my}: Remove portal with ID {0}

    Remove a portal by its ID. The portal connection is removed from the navigation graph immediately.

    {my}: Remove portal at {0}

    Remove the portal closest to this object. Works with both entry and exit positions; for two-way portals, either endpoint object can be used.

    {my}: Remove all portals tagged {0}

    Remove every portal whose tag matches the given string, or ALL portals when the tag is empty. Graph connections are removed immediately.

    {my}: Resume portal

    Continue portal execution after pausing with 'Pause at portal'. For instant portals: teleports the character to the exit. For gradual portals: begins moving the character toward the exit. Use this when you want the portal's built-in movement to handle the transition.

    {my}: Set portal {0} cost to {1}

    Change how 'expensive' a portal is for the AI to use. Lower cost = preferred, higher cost = avoided.

    {my}: Set portal {0} ignore hazards: {1}

    Set whether a portal ignores nearby hazards when calculating its pathfinding cost.

    {my}: Move portal {0} to entry ({1}, {2}) exit ({3}, {4})

    Move a portal's entry and exit in place, keeping its ID, type, cost, speed, and tags; graph connections re-wire immediately. A character mid-traversal keeps its original destination. A portal that was following objects stops following them.

    {my}: Move portal {0} to {1} -> {2}

    Attach an existing portal to two objects (first picked instances), preserving its ID, type, cost, speed, and tags. The portal then follows those objects as they move.

    {my}: Set portal {0} speed to {1}

    Change the movement speed of a gradual portal (pixels per second). Has no effect on instant portals.

    {my}: Set portal {0} tag to {1}

    Assign a string tag to a portal. Tags are used to group portals so they can be removed together with 'Remove portals by tag'. A portal can only have one tag at a time; calling this again replaces the previous tag.

    {my}: Teleport to ({0}, {1})

    Instantly move the character to the given position. Suppresses drift re-pathing for one tick so the current path is not abandoned.

  • Conditions

    {my}: Is at portal

    True when the AI is paused at a portal entry (after 'Pause at portal' was called but before 'Resume portal' or 'Complete portal'). Use to check if the character is waiting at a portal.

    {my}: Is traversing portal

    True when the AI is currently moving through a gradual portal (elevator, ladder, etc.). Platform behavior is disabled during traversal.

    {my}: On portal complete

    Triggered when portal execution finishes: after an instant teleport completes, a gradual movement reaches the exit, or 'Complete portal' is called. Use this for post-portal effects like opening doors at the exit, playing arrival animations, etc.

    {my}: On portal entry

    Triggered when the character arrives at a portal entry, before the portal executes. Call 'Pause at portal' here to run your own events first. CurrentPortalID identifies the portal.

  • Expressions

    CurrentPortalID

    Returns the portal ID during OnPortalEntry/OnPortalComplete triggers. Use to identify which portal was reached.

    FurthestPortalID

    Returns the ID of the portal whose entry point is furthest from the given (X, Y) position. If Tag is non-empty, only portals with that tag are considered. Returns -1 if no matching portals exist.

    LastPortalID

    Returns the ID of the most recently added portal. Use right after adding a portal to save the ID for later configuration or removal.

    NearestPortalID

    Returns the ID of the portal whose entry point is nearest to the given (X, Y) position. If Tag is non-empty, only portals with that tag are considered. Returns -1 if no matching portals exist.

    PortalCount

    Get the total number of portals.

    PortalCountByTag

    Returns the number of portals that contain the given tag token (checked within each portal's comma-separated tag string).

    PortalExitX

    Get the exit X position of the current portal. Valid inside OnPortalEntry/OnPortalComplete triggers.

    PortalExitY

    Get the exit Y position of the current portal. Valid inside OnPortalEntry/OnPortalComplete triggers.

    PortalIDByTag

    Returns the portal ID at the given index within the set of portals that contain the given tag. Returns -1 if the index is out of range. Use PortalCountByTag to get the total count.

    PortalProgress

    Get the 0-1 traversal progress for gradual portals. Returns 0 if not traversing.

    PortalTag

    Get the tag of a portal by its ID. Returns an empty string if the portal has no tag or doesn't exist.

    PortalType

    Returns 'instant' or 'gradual' for the given portal ID.