SetNpcRotation: Difference between revisions
Jump to navigation
Jump to search
Document new NPC/player-mode API and events available from 0.1.5 |
Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration |
||
| Line 31: | Line 31: | ||
== Notes == | == Notes == | ||
* Server-side only. Mutations require the NPC to belong to the calling resource; getters do not grant control. | * Server-side only. Mutations require the NPC to belong to the calling resource; getters do not grant control. | ||
* Since 0.1.5. | * Since 0.1.5. Use the matching 0.1.5 client and server (Protocol 37). | ||
* Use matching updated client and server. See [[NPC scripting]] for lifecycle, defaults, combat examples and collision limitations. | * Use matching updated client and server. See [[NPC scripting]] for lifecycle, defaults, combat examples and collision limitations. | ||
* Preserves route, goal, pause and wait state. Later route/combat movement can update yaw. | * Preserves route, goal, pause and wait state. Later route/combat movement can update yaw. | ||
Latest revision as of 07:34, 26 September 2026
setNpcRotation
AVAILABLE FROM UPDATE 0.1.5
This function is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.
Sets the NPC whole-body yaw once.
Syntax
setNpcRotation(npcId, yaw)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
int |
yes | Server-assigned NPC ID returned by spawnNpc; not a player ID. |
yaw |
number |
yes | Finite yaw in degrees, absolute input at most 1e9; normalized by the server. |
Returns
Returns true when accepted, false for a rejected request. Acceptance is not proof of a rendered animation, projectile release or hit.
Examples
setNpcRotation(npcId, 90)
Notes
- Server-side only. Mutations require the NPC to belong to the calling resource; getters do not grant control.
- Since 0.1.5. Use the matching 0.1.5 client and server (Protocol 37).
- Use matching updated client and server. See NPC scripting for lifecycle, defaults, combat examples and collision limitations.
- Preserves route, goal, pause and wait state. Later route/combat movement can update yaw.