WalkMonsterTo: Difference between revisions
Jump to navigation
Jump to search
Document Lua functions planned for G1R:MP update 0.1.2 |
Document Lua APIs available or improved from G1R:MP 0.1.2 |
||
| Line 1: | Line 1: | ||
= walkMonsterTo = | = walkMonsterTo = | ||
<div style="background:# | <div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;"> | ||
<div style="color:# | <div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE FROM UPDATE 0.1.2</div> | ||
<div style="color:# | <div style="color:#111111; margin-top:0.25rem;">This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.</div> | ||
</div> | </div> | ||
Latest revision as of 18:40, 3 September 2026
walkMonsterTo
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.
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
setMonsterPositiononly for an explicit authoritative teleport. - The command clears the current player target. When a nonzero target is cleared, the existing
onMonsterTargetChangeevent 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.