StartAnim: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document 0.1.4 expanded animation catalog and Lua metadata APIs; confirmed in-game
Document upcoming 0.1.9 activity animations: 844 aliases, fishing, player/NPC Lua usage and qualification; not a release
Line 38: Line 38:
== Notes ==
== Notes ==
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* The [[Player animation catalog]] lists 27 original aliases and, since 0.1.4 BUILD127, 91 additions (118 total), confirmed working in-game. The additions require the updated client and server. Use [[getPlayerAnimationNames]] and [[getPlayerAnimationInfo]] (new server functions since 0.1.4) to enumerate them and obtain recommended modes. New entries follow the selected introduction/loop/exit sections; the Lua signature and default looped=false are unchanged.
* [[Player animation catalog]] documents the earlier 118 aliases. From upcoming 0.1.9, [[Activity animation catalog]] adds 844 entries (962 total), including route/gesture variants; these additions are not all individually visually confirmed. Use [[getPlayerAnimationNames]] and [[getPlayerAnimationInfo]] to enumerate the running server catalog and recommended modes. Selected introduction/loop/exit playback retains the existing signature and default looped=false.
* The optional <code>looped</code> argument explicitly controls the request. Omitting it always requests a one-shot animation; the catalog mode is an authored recommendation, not an implicit override.
* The optional <code>looped</code> argument explicitly controls the request. Omitting it always requests a one-shot animation; the catalog mode is an authored recommendation, not an implicit override.
* Starting another scripted animation replaces the player's current scripted animation. Normal replicated gameplay actions retain their own presentation rules.
* Starting another scripted animation replaces the player's current scripted animation. Normal replicated gameplay actions retain their own presentation rules.
Line 47: Line 47:
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Animation Functions]]
[[Category:Animation 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.
Use the existing call, for example <code>startAnim(playerId, "fishing", true, 0.15)</code> or <code>startAnim(playerId, "pickcrouch", false, 0.15)</code>. See [[Activity animations]] and the full [[Activity animation catalog]]. Animation-owned rods/tools are cosmetic, not inventory grants; rewards and interaction validation belong to your server script. Acceptance is not a visual acknowledgement.
<!-- activities019:end -->

Revision as of 09:18, 19 October 2026

startAnim

IMPROVED FROM UPDATE 0.1.2
This function is available in earlier releases and has corrected or expanded behavior in G1R:MP 0.1.2 and later. The contract below describes the updated behavior.

Starts an allowlisted scripted visual animation for a connected player and synchronizes it with relevant clients.

Syntax

bool startAnim(int playerId, string animation [, bool looped = false, number blendSeconds = 0.15])

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
animation string yes A case-insensitive alias from the Player animation catalog. Raw Unreal asset paths are not accepted.
looped bool no Whether to hold and replay the animation from its catalog loop point. The compatible default remains false, even for aliases whose authored mode is hold.
blendSeconds number no Requested owning-player native montage transition/stop duration from 0 to 2 seconds; defaults to 0.15. When this request replaces an existing scripted animation, it controls that outgoing montage and is then retained for a later stop of the new animation.

Returns

Returns true when the server validates the request, records the authoritative animation state, and attempts reliable delivery. This is not a client playback or transport acknowledgement. Returns false for an invalid player, alias, argument, or inactive player session.

Examples

Hold the allowlisted prayer animation until it is stopped:

if not startAnim(playerId, "pray", true, 0.2) then
    outputDebugString("Prayer animation request was rejected")
end

Notes

  • Available only in server-side resource scripts.
  • Player animation catalog documents the earlier 118 aliases. From upcoming 0.1.9, Activity animation catalog adds 844 entries (962 total), including route/gesture variants; these additions are not all individually visually confirmed. Use getPlayerAnimationNames and getPlayerAnimationInfo to enumerate the running server catalog and recommended modes. Selected introduction/loop/exit playback retains the existing signature and default looped=false.
  • The optional looped argument explicitly controls the request. Omitting it always requests a one-shot animation; the catalog mode is an authored recommendation, not an implicit override.
  • Starting another scripted animation replaces the player's current scripted animation. Normal replicated gameplay actions retain their own presentation rules.
  • Use stopAnim to end the tracked scripted animation. Clients use bounded loading and presentation retries for the newest accepted revision; a terminal miss is written to the animation diagnostic log instead of retrying forever.
  • The requested blend is applied to the owning player's exact native montage. Remote proxy handoff is immediate and does not guarantee an interpolated blend.

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. Use the existing call, for example startAnim(playerId, "fishing", true, 0.15) or startAnim(playerId, "pickcrouch", false, 0.15). See Activity animations and the full Activity animation catalog. Animation-owned rods/tools are cosmetic, not inventory grants; rewards and interaction validation belong to your server script. Acceptance is not a visual acknowledgement.