GeneralAnimationPlugin

版本 v1.1.0·更新於 2021-06-06

Dependency plugin for using a set of common animation files with many compatible skeleton characters/minis. Includes converter for quick creation of animation files.

模組介紹 作者原文

General Animation Plugin

This unofficial TaleSpire plugin is for adding general animations to TaleSpire

which can then be applied to any character that has a compatible skeleton.

Now comes with a BVH to TS JSON converter for quick animation creation (see end of this document)

Change Log

1.1.0: Added BVH Converter

1.0.0: Initial Release

Install

Install using R2ModMan or similar and place animation files in

\Steam\steamapps\common\TaleSpire\TaleSpire_CustomData\Animations\

(The LoadAnimation can actually load animation files from any location but this is the recommended location)

Usage

The General Animation Plugin is intended to be a dependency plugin used by other plugins to implement animations.

It does not currently have any triggers for triggering animations on it own. However, it does have the complete

animation engine for processing animations when they are applied.

There are two types of animation possible: scripted animation and manual animation. However, both animation style

(described below) require a common initial step. This step involves getting a reference to the rigged Game Object

and registering its bone structure.

CreatureBoardAsset asset;

CreaturePresenter.TryGetAsset(LocalClient.SelectedCreatureId, out asset);

GameObject go = GameObject.Find("CustomContent:" + asset.Creature.CreatureId);

AddCharacter(go);

The above code assumes the character has been added using Custom Mini Plugin in which case the Rigged Object has a

name that starts with "CustomContent" and ends with the corresponding creature id. If animations are to be applied

to content that was not imported with Custom Mini Plugin then change the above code to determine the correct GameObject

Object in some other way. The last line of AddCharacter(go) registers the character bones which needs to be done

prior to any animation.

The process for scripted animation and manual animation is described below.

Scriped Animation

Scripted animation is a two step process. First a AnimationSequence is loaded from a JSON file which contain a single

animation or a pose (see additional comments about poses below). The second step is to apply the AnimationSequence to

a specific character. Note that a character's bones have had to have been registered in order for this animation process

to work. To load an AnimationSequence we can use code similar to:

AnimationSequence animSequence = LoadAnimation(dir + "Animations/CanCan.json");

To apply the animation to an actual character, we can use code similar to:

animGuid = ApplyAnimation(animSequence, "CustomContent:" + asset.Creature.CreatureId);

Once again the above code assumes the mini content was loaded using Custom Mini Plugin. If that is not the case then

the second parameter needs to be modified to the name of the game object that is to be animated. This parameter should

match the name of a character that was registered using the AddCharacter() method (see above).

Once the animation completes, it will be automatically removed from the animator. If the animation needs to be stopped

before it has been completed, the following code can be used:

StopAnimation(animGuid);

Manual Animation

The plugin provides two methods for manual animation: Bend() and Shift()

The Bend method is used to bend (rotate) a character's bone.

Bend(characterName, boneName, angles, delta)

The characterName parameter is the character that is to be animated and must match the name of a character whose bones

have been registered. The boneName parameter is the name of the bone that is to be animated. The angles parameter is

a Vector3 parameter indicating the x, y and z angles. The delta parameter indicates if the angles are absolute values

or delta values. If delta is false (default) then the method will set the bone angles to the provided values. If the

delta parameter is true then the method will change the current bone angles by the amount specified in the angles property.

Note that this method is not a transition. It sets the value of t

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

bbepisTaleSpire-BepInExPackbrcoding-SetInjectionFlagPlugin

檔案與校驗

檔案名稱
GeneralAnimationPlugin-1.1.0.zip
檔案大小
973.0 KiB