GetPlayerAnimationInfo: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document upcoming 0.1.9 activity animations: 844 aliases, fishing, player/NPC Lua usage and qualification; not a release
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits
 
Line 2: Line 2:
'''New server-side function since 0.1.4 BUILD127.''' See [[Update 0.1.4]] for release status.
'''New server-side function since 0.1.4 BUILD127.''' See [[Update 0.1.4]] for release status.


Returns catalog metadata for a named player animation. This is a catalog lookup, not the current animation state of a particular player. The earlier 118-entry catalog has previous in-game confirmation. The 844 additions for upcoming 0.1.9 are not all individually visually confirmed; see [[Activity animations]].
Returns catalog metadata for a named player animation. This is a catalog lookup, not the current animation state of a particular player. The earlier 118-entry catalog has previous in-game confirmation. The 844 additions for 0.1.9 are not all individually visually confirmed; see [[Activity animations]].


== Syntax ==
== Syntax ==
Line 53: Line 53:
<!-- activities019:start -->
<!-- activities019:start -->
== Additional return fields from 0.1.9 ==
== Additional return fields 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.
'''Available from 0.1.9.''' Both the server and observing clients need the matching update.
The function already exists since 0.1.4; only the following fields are new. Earlier servers may return nil for them.
The function already exists since 0.1.4; only the following fields are new. Earlier servers may return nil for them.
{| class="wikitable"
{| class="wikitable"

Latest revision as of 13:27, 20 October 2026

getPlayerAnimationInfo

New server-side function since 0.1.4 BUILD127. See Update 0.1.4 for release status.

Returns catalog metadata for a named player animation. This is a catalog lookup, not the current animation state of a particular player. The earlier 118-entry catalog has previous in-game confirmation. The 844 additions for 0.1.9 are not all individually visually confirmed; see Activity animations.

Syntax

table|false getPlayerAnimationInfo(string animation)

Parameters

Parameter Description
animation A case-insensitive alias from getPlayerAnimationNames or the Player animation catalog. Unknown or invalid aliases return false. Unreal asset paths are not accepted.

Return fields

Field Type Meaning
name string Canonical lowercase alias.
group string work, rest, daily, pose or legacy; from 0.1.9 also gather, craft, fishing, carry and gesture. Existing work/mine belong to work; the other original 25 aliases belong to legacy. See Activity animation catalog for the new group counts. A group describes presentation, not gameplay permissions.
looped boolean Recommended default: true for a hold animation, false for a one-shot. This does not change startAnim's default; pass it explicitly.
entrySeconds number For entries added in 0.1.4 and 0.1.9, duration of the selected introduction. For the original 27, legacy loop-start metadata. Seconds.
durationSeconds number For entries added in 0.1.4 and 0.1.9, duration of the selected introduction, one loop and exit. It is not the lifetime of a held animation. The original 27 return 0 because this duration is not provided by this metadata; it does not mean a zero-length animation.
visualOnly boolean True for the 91 additions from 0.1.4 and the 844 additions from 0.1.9 using controlled visual presentation. False identifies the original legacy playback path, not permission to perform crafting or alter gameplay state.

Example

local info = getPlayerAnimationInfo("lieground")
if info then
    if not startAnim(playerId, info.name, info.looped, 0.15) then
        outputDebugString("Animation request rejected")
    end
end
-- When the activity should end:
-- stopAnim(playerId)

These are visual activities; furniture and workstations must be positioned separately. Querying metadata does not change the player. See Player animation catalog for the complete list and startAnim for the request/return-value contract.

Additional return fields from 0.1.9

Available from 0.1.9. Both the server and observing clients need the matching update. The function already exists since 0.1.4; only the following fields are new. Earlier servers may return nil for them.

Field Type Meaning
catalogIndex number Numeric catalog identifier. Use the alias, not this identifier, in startAnim/startNpcAnim calls.
assetKind string montage or sequence. Descriptive metadata, not an asset-path loading API.
since string 0.1.9 for the 844 new entries; 0.1.4 for the earlier 118 as a catalog baseline. This is not the exact introduction version of every old alias: the original 27 already existed in 0.1.2.
verifiedInGame boolean Catalog qualification flag. Currently true for the earlier 118 and false for the 844 additions. Not a live playback result, a guarantee for every outfit/client, or a flag changed by using the animation.

See Activity animations for examples and the separate local fishing-appearance confirmation. The metadata reports recommended modes; it never changes the default looped argument implicitly.