WalkMonsterTo

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 17:32, 2 September 2026 by QCherry (talk | contribs) (Document Lua functions planned for G1R:MP update 0.1.2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

walkMonsterTo

COMING IN UPDATE 0.1.2
This function is documented in advance and is not yet available in the current public release.

Commands a living server-owned monster to walk to a world position.

Syntax

bool walkMonsterTo(string monsterId, number x, number y, number z)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.
x number yes Destination X coordinate in metres.
y number yes Destination Y coordinate in metres.
z number yes Destination Z coordinate in metres.

Returns

Returns true when the movement command and its server-side route are accepted; otherwise returns false.

Examples

Send a guard creature to a waypoint:

if not walkMonsterTo(monsterId, 25.0, 12.0, 3.0) then
    outputDebugString("Monster destination is unreachable", 1)
end

Notes

  • Available only in server-side resource scripts.
  • This is movement over time, not a teleport. Use setMonsterPosition only for an explicit authoritative teleport.
  • The command clears the current player target. When a nonzero target is cleared, the existing onMonsterTargetChange event is emitted.
  • Ground-following monsters use the conservative server navigation-blocker layer baked only from explicitly authored unwalkable, NavArea_Null and nav-mesh exclusion geometry. Ordinary terrain and NavArea_Avoid are not guessed to be hard blockers. If no valid path exists, the function returns false and never falls back to a straight segment through a blocker.
  • Dynamic character-capsule spacing prevents monsters, NPCs and players from occupying the same space. Additional pursuers select spaced flank positions instead of stacking on the active attacker.
  • Flying catalog types use their airborne movement model with three-dimensional clearance checks.