Help!How to add animations?

Like this:

1.I add a new effects, like name combat_spear.json
Build a new weapon like bronze_pike
bronze_pike.json:

    "stonehearth:combat:melee_attacks" : [
     {
        "name" : "/mymod/data/rigs/humans/effects/combat_spear.json",
        "active_frame" : 21,
        "cooldown" : 0,
        "priority" : 2
     }      
  ],

2.combat_spear.json:

  "animation": {
     "type": "animation_effect",
     "start_time": 0,
     "animation": "combat_spear.json",
     "loop": false
  },

This file combat_spear.json should in ā€œstonehearth\data\rigs\humans\animationsā€,
If I add the file in that everything is ok
But I want it in mymod like ā€œmymod\data\rigs\humans\animationsā€

3.I have a try Like this:

  "animation": {
     "type": "animation_effect",
     "start_time": 0,
     "animation": "file(/data/rigs/humans/animations/combat_spear.json)",
     "loop": false
  },

or

  "animation": {
     "type": "animation_effect",
     "start_time": 0,
     "animation": "file(mymod/data/rigs/humans/animations/combat_spear.json)",
     "loop": false
  },

But it show this:
or

I donā€™t know how to do :confounded:

Help~~~ :sob:

Your paths are horribly wrong in serial 3. That will never work as youā€™re starting your folder navigation from where the file ā€˜combat_spearā€™.json is located.

"stonehearth:combat:melee_attacks" : [
 {
    "name" : "mymod/data/rigs/humans/effects/combat_spear.json",
    "active_frame" : 21,
    "cooldown" : 0,
    "priority" : 2
 }      
],

Assuming the file combat_spear.json is actually located in mod_directory/data/rigs/humans/effects/

Not sure if you cut some of it off but:

 {
   "type" : "effect",
   "tracks": {
      "animation": {
          "type": "animation_effect",
          "start_time": 0,
          "animation": "combat_spear.json",
          "loop": false
       }
   }
}

Assuming you have a file called combat_spear.json in:

mod_directory/data/rigs/humans/animations/male/

Saying that, Iā€™ve never tried to create a new animation for a radiant human. It might not be possilble

Edit:

Thinking about it a little more ā€œanimation_rootā€ : ā€œfile(ā€¦/animations/male)ā€ in the male skeleton is going to be problematic. Iā€™m pretty sure that will always point to stonehearthā€¦

If Radiant were to add some placeholder files, such as:

custom_animation_1
custom_animation_2
ā€¦
custom_animation_10

in \stonehearth\stonehearth\data\rigs\humans\effects and in \stonehearth\stonehearth\data\rigs\humans\animations\male (+female) we could override them with our custom animations.

Your bronze_pike could then use

"stonehearth:combat:melee_attacks" : [
 {
    "name" : "custom_animation_1",

But this would break compatibility between multiple mods. Itā€™s not a bad cheap/30KB solution in the meanwhile @Albert @sdee would this work?

Yes, you canā€™t add animations currently to existing stonehearth entities, Iā€™ve complained about it here:

You might copy all the humans animations to your mod folder and do some overrides but it isnā€™t the right way to do it. I hope they donā€™t wait too many alphas to implement a fix for thisā€¦

1 Like

O~k~ :smile: Anyway thank you!

1 Like

Hi,
I know this is an old thread, but wanted to update that this is now possible to do after a13.
You have to put the animation in the overrides section of your modā€™s manifest
This will act like you added a file to stonehearthā€™s human animation directory.

ā€œstonehearth/data/rigs/humans/animations/combat_spear.jsonā€: ā€œfile(mymod/data/rigs/humans/animations/combat_spear.json)ā€,

Thanks
-Yang

3 Likes