StartNpcAnim: Difference between revisions
Jump to navigation
Jump to search
Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration |
Document upcoming 0.1.9 activity animations: 844 aliases, fishing, player/NPC Lua usage and qualification; not a release |
||
| Line 36: | Line 36: | ||
== 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. | ||
* | * The function was introduced in 0.1.5. Use matching supported client/server versions; new 0.1.9 aliases require that update on both. | ||
* 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. | ||
* Requires living NPC with holstered weapon. Suspends route/goal/wait progress. One-shot ends on its timeline; a loop requires stopNpcAnim. Does not replace the original route. | * Requires living NPC with holstered weapon. Suspends route/goal/wait progress. One-shot ends on its timeline; a loop requires stopNpcAnim. Does not replace the original route. | ||
| Line 43: | Line 43: | ||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:NPC Functions]] | [[Category:NPC Functions]] | ||
<!-- activities019:start --> | |||
== Activity aliases from 0.1.9 == | |||
'''Available from 0.1.9 (upcoming; not yet publicly released).''' Not included in public 0.1.8. Both the server and observing clients need the matching update. | |||
Uses the same expanded catalog as [[startAnim]]: 962 aliases, including 844 additions. Example: <code>startNpcAnim(npcId, "pickrice_loop02", true, 0.15)</code>. Fishing includes the cosmetic rod. Existing resource ownership, living-NPC and holstered-weapon requirements remain. See [[Activity animations]] for examples and [[Activity animation catalog]] for modes and visual-qualification status. | |||
<!-- activities019:end --> | |||
Revision as of 09:18, 19 October 2026
startNpcAnim
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.
Starts a catalog animation on an NPC.
Syntax
startNpcAnim(npcId, alias, looped=false, blendSeconds=0.15)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
int |
yes | Server-assigned NPC ID returned by spawnNpc; not a player ID. |
alias |
string |
yes | Supported alias from Player animation catalog, not an asset path. |
looped |
bool |
no | Optional; default false. |
blendSeconds |
number |
no | Optional blend-out time in seconds, 0..2; default 0.15. |
Returns
Returns true when accepted, false for a rejected request. Acceptance is not proof of a rendered animation, projectile release or hit.
Examples
setNpcWeaponMode(npcId, "none")
startNpcAnim(npcId, "pray", true, 0.15)
Notes
- Server-side only. Mutations require the NPC to belong to the calling resource; getters do not grant control.
- The function was introduced in 0.1.5. Use matching supported client/server versions; new 0.1.9 aliases require that update on both.
- Use matching updated client and server. See NPC scripting for lifecycle, defaults, combat examples and collision limitations.
- Requires living NPC with holstered weapon. Suspends route/goal/wait progress. One-shot ends on its timeline; a loop requires stopNpcAnim. Does not replace the original route.
Activity aliases from 0.1.9
Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Both the server and observing clients need the matching update.
Uses the same expanded catalog as startAnim: 962 aliases, including 844 additions. Example: startNpcAnim(npcId, "pickrice_loop02", true, 0.15). Fishing includes the cosmetic rod. Existing resource ownership, living-NPC and holstered-weapon requirements remain. See Activity animations for examples and Activity animation catalog for modes and visual-qualification status.