SetMonsterNavigationCollisionMode
setMonsterNavigationCollisionMode
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 which static navigation-collision layers a resource-owned monster uses.
Syntax
bool setMonsterNavigationCollisionMode(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 collision source: "combined", "builtin", or "custom".
|
Returns
Returns true when the monster, ownership and mode are valid; otherwise returns false.
Examples
Use only blockers created by this server's Lua resources:
if setMonsterNavigationCollisionMode(monsterId, "custom") then
setMonsterNavigationMode(monsterId, "scripted")
end
Notes
- Available only in server-side resource scripts.
- New monsters start in
"combined"mode."combined"uses the baked MainMap layer plus all enabled custom blockers,"builtin"uses only the baked layer, and"custom"uses only custom blockers. - The setting is independent from
setMonsterNavigationMode: collision mode selects static blocker sources, while navigation mode selects built-in AI decisions or direct scripted goals. - Authoritative player, NPC and monster capsule separation always remains active. No collision mode grants client authority or permits characters to overlap.
- Changing the mode clears cached paths and forces the server to validate movement against the new collision view.
getMonsterDatareturns the current value asnavigationCollisionMode. - Only the resource that created the monster may change this setting.