SetMonsterNavigationMode
Jump to navigation
Jump to search
setMonsterNavigationMode
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.
Selects built-in or resource-scripted movement for a resource-owned monster.
Syntax
bool setMonsterNavigationMode(string monsterId, string mode)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
mode |
string |
yes | Case-sensitive movement mode: "builtin" or "scripted".
|
Returns
Returns true when the requested mode is valid and accepted; otherwise returns false.
Examples
Give a resource direct movement control over a ground monster:
if setMonsterNavigationMode(monsterId, "scripted") then
setMonsterMoveGoal(monsterId, 25.0, 12.0, 3.0)
end
Notes
- Available only in server-side resource scripts.
- Only the resource that created the monster may change its navigation mode.
- New monsters start in
"builtin"mode. Built-in mode keeps the normal server pathing, avoidance, pursuit, return-home and formation movement. - In
"scripted"mode, direct resource goals replace those built-in movement decisions. The server still owns collision, targeting, attacks, damage, health and death; this function never makes movement or combat client-authoritative. - Changing between modes stops the monster and clears both its current direct move goal and any built-in movement command. Repeating the current mode is a successful no-op.
- Scripted navigation is ground-only and is rejected for flying monster types. It does not provide flying, arbitrary vertical control or moving-platform attachment.