Systems

Player Animations

Packs can ship custom animations for the player (casting poses, charge-ups, scripted scenes) as plain JSON. The animation keyframes are injected into the player's real shape at runtime, so no shape files are patched and it works for the vanilla seraph and for custom player models.

The system is part of ArcanumLib (config/playeranimations/*.json from any mod or pack is picked up).


File Format

{
  "animations": [
    {
      "meta": {
        "code": "albase-staffcharge",
        "animation": "albase-staffcharge",
        "blendMode": "Add",
        "easeInSpeed": 5,
        "easeOutSpeed": 6,
        "elementWeight": { "UpperArmR": 100, "LowerArmR": 100 },
        "elementBlendMode": { "UpperArmR": "AddAverage", "LowerArmR": "AddAverage" }
      },
      "animation": {
        "name": "Staff charge",
        "code": "albase-staffcharge",
        "quantityframes": 40,
        "onActivityStopped": "EaseOut",
        "onAnimationEnd": "Repeat",
        "keyframes": [
          { "frame": 0,  "elements": { "UpperArmR": { "rotationX": 6, "rotationY": 0, "rotationZ": -55 } } },
          { "frame": 20, "elements": { "UpperArmR": { "rotationX": 6, "rotationY": 0, "rotationZ": -60 } } }
        ]
      }
    }
  ]
}
PartContents
metaWhat player.json would hold for an animation: code, blendMode, easeInSpeed, easeOutSpeed, elementWeight, elementBlendMode and so on
animationWhat the seraph shape would hold: quantityframes, onAnimationEnd, onActivityStopped and the keyframes with per-bone rotations/offsets

Rules:

  • meta.code is what you reference everywhere. animation.code is forced to equal meta.animation, so a typo cannot silently do nothing.
  • An entry whose code ends with -fp is the first-person variant of the entry without the suffix and is picked automatically.
  • A duplicate meta.code is replaced by the later file (warning in the log).
  • Entries without meta.code or animation are skipped with a warning.
  • Keyframes must be lower than quantityframes; looping clips wrap by themselves.
  • Use Average blending for full-body poses and Add/AddAverage with elementWeight for arm-only layers.

Hooking Animations Up

Items

In config/itemconfig entries for charge/cast items:

FieldDescription
castAnimationAnimation held while casting or charging
releaseAnimationOne-shot animation played when the cast fires
castLoopSoundLooping sound while charging (pitch rises with charge). Empty = the shared default loop

Abilities

Rune/ability definitions (config/abilities/*.json) take castAnimation and releaseAnimation too. Every nearby client animates the caster:

"castAnimation": "albase-runebarrage",
"releaseAnimation": "albase-runebarrage-release"

See quests/albase/assets/albase/config/abilities/void-barrage.json and the clips in quests/albase/assets/albase/config/playeranimations/ (staff-cast.json, rune-cast.json) and alegacyevents/config/playeranimations/guillotine.json.


Multiplayer Sync

The casting client plays the animation immediately and tells the server. The server relays it to other clients, but only for codes that exist in the loaded animation files - a client cannot make others play arbitrary vanilla animations. The server never animates anything itself.

Press ESC to close