Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

SS14 Graphics AnimationPlayer

БесплатноБез исполняемых скриптовНе проверен

A deep practical guide to entity animations using the AnimationPlayerSystem in SS14: lifecycle, API, track types, keyframes/interpolation/easing, completion…

makura-gamesот makura-games★ 74 звезды на GitHub

Об этом скилле

Animations via AnimationPlayer in SS14

This skill only covers entity animations via AnimationPlayerSystem :) UI animations (Control.PlayAnimation) and shader/overlay effects are handled in separate skills.

When to use

Choose AnimationPlayerSystem when needed:

  • smoothly change the properties of components over time (SpriteComponent, TransformComponent, PointLightComponent, etc.);
  • run flick animations of RSI states by layers;
  • synchronize visual and sound in one timeline;
  • handle completion/interruption of animation through events.

Don't use it for static visual states without time: this is the normal SpriteSystem/GenericVisualizer zone.

Mental model

  1. You create Animation (Length + list AnimationTracks).
  2. You play it through AnimationPlayerSystem.Play(...) under the unique key.
  3. The system moves the playback every frame and applies the track values.
  4. Upon completion, AnimationCompletedEvent (Finished = true) arrives.
  5. When manually stopping Stop(...) also comes AnimationCompletedEvent, but Finished = false.

Idea: animation is a local timeline of the effect, not network business logic :)

Important client/server boundary

  • AnimationPlayerComponent — client entity of the visual.
  • On the server, this component is ignored by the component factory.
  • The server reports the state, the client decides when and how to visually animate.

API parsing AnimationPlayerSystem

Launch

  • Play(EntityUid uid, Animation animation, string key)
  • Play(Entity<AnimationPlayerComponent> ent, Animation animation, string key)

Practice:

  • use stable key constants;
  • before Play check HasRunningAnimation if the key may be repeated.

Checking running

  • HasRunningAnimation(EntityUid uid, string key)
  • HasRunningAnimation(EntityUid uid, AnimationPlayerComponent? component, string key)
  • HasRunningAnimation(AnimationPlayerComponent component, string key)

Stop

  • Stop(Entity<AnimationPlayerComponent?> entity, string key)
  • Stop(EntityUid uid, AnimationPlayerComponent? component, string key)

The stop triggers a completion event with Finished = false.

Events

  • AnimationStartedEvent
  • AnimationCompletedEvent
    • Key
    • Finished (natural termination or forced)

Structure Animation

  • Length: total playback length.
  • AnimationTracks: several tracks run synchronously.

Rule: Length must cover all the necessary key phases of the tracks.

Types of tracks and when to take which one

AnimationTrackComponentProperty

Changes the component property by keyframes.

Required fields:

  • ComponentType = typeof(...)
  • Property = nameof(...)
  • KeyFrames
  • optional InterpolationMode

Use for:

  • SpriteComponent.Scale/Offset/Color/Rotation;
  • TransformComponent.LocalPosition;
  • PointLightComponent.AnimatedRadius/AnimatedEnable/Rotation, etc.

AnimationTrackSpriteFlick

Controls the RSI-state of the layer over time.

Required fields:

  • LayerKey (usually layer enum);
  • KeyFrames with StateId.

Use it when you need to play the state animation of the layer.

AnimationTrackPlaySound

Plays sound on the given keyframes.

Use for precise synchronization of “visual + sound” in one timeline.

KeyFrame and interpolation

AnimationTrackProperty.KeyFrame(value, keyTime, easing?):

  • keyTime is a delta from the previous keyframe, not an absolute time.
  • easing applies to the transition between the previous and current frame.

AnimationInterpolationMode:

  • Linear
  • Cubic
  • Nearest
  • Previous

For unsupported types, interpolation actually behaves like a discrete step (previous value).

Practical examples

Example 1: secure launch by key

private const string AnimKey = "rotating_light";

private void TryPlayRotation(EntityUid uid, AnimationPlayerComponent player, Animation anim)
{
    // We do not allow key conflicts in PlayingAnimations.
    if (_anim.HasRunningAnimation(uid, player, AnimKey))
        return;

    _anim.Play((uid, player), anim, AnimKey);
}

Example 2: correct stop + cleanup

private void StopFallAnimation(EntityUid uid, AnimationPlayerComponent player, SpriteComponent sprite, Vector2 originalScale)
{
    // First, we return the visual parameters to their basic state.
    _sprite.SetScale((uid, sprite), originalScale);

    // Then we stop the animation by key.
    _anim.Stop((uid, player), "chasm_fall");
}

Example 3: property-track with easing

private static Animation BuildPickupAnim(Vector2 from, Vector2 to, Color startColor)
{
    return new Animation
    {
        Length = TimeSpan.FromMilliseconds(175),
        AnimationTracks =
        {
            new AnimationTrackComponentProperty
            {
                ComponentType = typeof(TransformComponent),
                Property = nameof(TransformComponent.LocalPosition),
                InterpolationMode = AnimationInterpolationMode.Linear,
Полный SKILL.md на GitHub

Установить SS14 Graphics AnimationPlayer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл SS14 Graphics AnimationPlayer?

A deep practical guide to entity animations using the AnimationPlayerSystem in SS14: lifecycle, API, track types, keyframes/interpolation/easing, completion events, patterns and anti-patterns for production code.

Как установить скилл SS14 Graphics AnimationPlayer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл SS14 Graphics AnimationPlayer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить SS14 Graphics AnimationPlayer с