# How do I add a new animation to a hearthling?

**URL:** <https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596>\
**Category:** Modding\
**Created:** [November 3, 2017, 5:07pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596 "2017-11-03T17:07:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrunoSupremo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/brunosupremo/32/54819_2.png) [@BrunoSupremo](https://discourse.stonehearth.net/u/BrunoSupremo)\
**Post date:** [November 3, 2017, 5:07pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/1 "2017-11-03T17:07:37Z")

</div>

So, I finish an animation using Blender, and exported the .json as usual.  
My problem is that this animation is not for a new mob, it is for hearthlings.

For new mobs, they usually have their own animation folder that you point to from their skeleton file. And you can simple keep adding stuff at their folders.

But hearthling skeleton file points to their usual animation and effects folder. How am I going to add something there? If it was a json list, I could simple do a mixinto adding a new entry pointing to my animation.

Should I use an overwrite to create the file? Like:

```
"overrides": {
	"stonehearth/data/rigs/entities/humans/animations/fishing.json": "file(data/rigs/entities/humans/animations/fishing.json)"
}

```

**Edit:**  
I think that is the way to go, as seen here:

> [@Help!How to add animations?](https://discourse.stonehearth.net/t/help-how-to-add-animations/14938/8):
>
> 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

**Edit2:**

Didn’t work. I have exactly this at my overrides:

```
	"stonehearth/data/rigs/entities/humans/animations/female/fishing_start.json":"file(data/rigs/entities/humans/animations/female/fishing_start.json)",
	"stonehearth/data/rigs/entities/humans/animations/male/fishing_start.json":"file(data/rigs/entities/humans/animations/male/fishing_start.json)",
	"stonehearth/data/rigs/entities/humans/effects/fishing_start.json":"file(data/rigs/entities/humans/effects/fishing_start.json)",

```

And when calling:  
`:execute('stonehearth:run_effect', { effect = "fishing_start" })`

It throws an error about invalid file path. This:

> **Summary**
>
> ```
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | -- Script Error (native) Begin ------------------------------- 
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | c++ exception: invalid file path '/stonehearth/data/rigs/entities/humans/effects/fishing_start.json'.
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | stack traceback:
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | [C]: in function 'load_json'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/resources.lua:33: in function 'load_json'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:72: in function 'get_effect_json'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/effects/effect_tracks.lua:36: in function '__init'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/common.lua:20: in function 'EffectTracks'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:156: in function '_add_effect'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:137: in function 'start_exact_effect'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:124: in function 'start_effect'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | radiant/modules/effects.lua:13: in function 'run_effect'
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | stonehearth/ai/actions/run_effect_action.lua:67: in function <stonehearth/ai/actions/run_effect_action.lua:46>
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | [C]: ?
> 2017-11-03 17:27:37.158969 | server | 0 | lua.code | ...
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | [C]: in function 'run'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | stonehearth/components/ai/ai_component.lua:607: in function <stonehearth/components/ai/ai_component.lua:591>
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | [C]: in function 'xpcall'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | radiant/modules/common.lua:265: in function 'xpcall'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | stonehearth/components/ai/ai_component.lua:591: in function '_thread_main'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | stonehearth/services/server/threads/thread.lua:273: in function <stonehearth/services/server/threads/thread.lua:270>
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | [C]: in function 'xpcall'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | radiant/modules/common.lua:265: in function 'xpcall'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | stonehearth/services/server/threads/thread.lua:270: in function 'f'
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
> 2017-11-03 17:27:37.159470 | server | 0 | lua.code | -- Lua Error End ------------------------------- 
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | -- Script Error (lua) Begin ------------------------------- 
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | @radiant/modules/effects/effect_manager.lua:76: [(5040 Micah Dorril) fishing_start]: could not find animation named /stonehearth/data/rigs/entities/humans/effects/fishing_start.json
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | stack traceback:
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/common.lua:245: in function 'report_traceback'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/common.lua:492: in function 'verify'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:76: in function 'get_effect_json'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/effects/effect_tracks.lua:36: in function '__init'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/common.lua:20: in function 'EffectTracks'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:156: in function '_add_effect'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:137: in function 'start_exact_effect'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:124: in function 'start_effect'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/effects.lua:13: in function 'run_effect'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | stonehearth/ai/actions/run_effect_action.lua:67: in function <stonehearth/ai/actions/run_effect_action.lua:46>
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | [C]: ?
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | ...
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | [C]: in function 'run'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | stonehearth/components/ai/ai_component.lua:607: in function <stonehearth/components/ai/ai_component.lua:591>
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | [C]: in function 'xpcall'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/common.lua:265: in function 'xpcall'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | stonehearth/components/ai/ai_component.lua:591: in function '_thread_main'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | stonehearth/services/server/threads/thread.lua:273: in function <stonehearth/services/server/threads/thread.lua:270>
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | [C]: in function 'xpcall'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | radiant/modules/common.lua:265: in function 'xpcall'
> 2017-11-03 17:27:37.159970 | server | 0 | lua.code | stonehearth/services/server/threads/thread.lua:270: in function 'f'
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | -- Lua Error End ------------------------------- 
> 2017-11-03 17:27:37.160470 | server | 1 | lua.code | generating traceback...
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | -- Script Error (lua) Begin ------------------------------- 
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | radiant/modules/effects/effect_tracks.lua:40: attempt to index local 'effect' (a nil value)
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | stack traceback:
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | radiant/modules/effects/effect_tracks.lua:40: in function '__init'
> 2017-11-03 17:27:37.160470 | server | 0 | lua.code | radiant/modules/common.lua:20: in function 'EffectTracks'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:156: in function '_add_effect'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:137: in function 'start_exact_effect'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/modules/effects/effect_manager.lua:124: in function 'start_effect'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/modules/effects.lua:13: in function 'run_effect'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | stonehearth/ai/actions/run_effect_action.lua:67: in function <stonehearth/ai/actions/run_effect_action.lua:46>
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: ?
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: ?
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: ?
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: ?
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | ...
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: in function 'run'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | stonehearth/components/ai/ai_component.lua:607: in function <stonehearth/components/ai/ai_component.lua:591>
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: in function 'xpcall'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/modules/common.lua:265: in function 'xpcall'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | stonehearth/components/ai/ai_component.lua:591: in function '_thread_main'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | stonehearth/services/server/threads/thread.lua:273: in function <stonehearth/services/server/threads/thread.lua:270>
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | [C]: in function 'xpcall'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/modules/common.lua:265: in function 'xpcall'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | stonehearth/services/server/threads/thread.lua:270: in function 'f'
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
> 2017-11-03 17:27:37.160970 | server | 0 | lua.code | -- Lua Error End ------------------------------- 
> 
> ```

Full stonehearth.log file here:  
[stonehearth.log](https://discourse.stonehearth.net/uploads/short-url/ke0HjVU2oopey1pyGcjiwQbDoof.log) (126.6 KB)

---

<div class="post-metadata">

**Author:** ![Avairian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/avairian/32/47084_2.png) [@Avairian](https://discourse.stonehearth.net/u/Avairian)\
**Post date:** [November 3, 2017, 7:41pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/2 "2017-11-03T19:41:22Z")

</div>

I was trying to do something similar. The best I could find is that there are idle animations specified in base\_human.json. Might be able to add your own component section for fishing animations and mix it into the fisher on promotion?

---

<div class="post-metadata">

**Author:** ![Relyss](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/relyss/32/41785_2.png) [@Relyss](https://discourse.stonehearth.net/u/Relyss)\
**Post date:** [November 3, 2017, 7:56pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/3 "2017-11-03T19:56:38Z")

</div>

That’s weird. This worked before. Might be a bug on A22 (tried to verify with my crusader mod, which added an animation via melee attack, and also throws this error) 🤔

Thanks for catching that, @BrunoSupremo!

**Edit:** weird. Backtracking, this only worked until A19, it got broken for A20 (did no one try to add hearthling animations via mod in all that time?) 😕  
It’s about the time we added another folder in the path to the rigs.

---

<div class="post-metadata">

**Author:** ![BrunoSupremo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/brunosupremo/32/54819_2.png) [@BrunoSupremo](https://discourse.stonehearth.net/u/BrunoSupremo)\
**Post date:** [November 3, 2017, 8:41pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/4 "2017-11-03T20:41:16Z")

</div>

> [@Relyss](#):
>
> It’s about the time we added another folder in the path to the rigs.

I remember that change. It outdated my cocolings, cause they were using the goblins rigs. Easy fix though, just updated the path.  
But this time I’m at the correct folder…

Oh, and isn’t by using this same method that translations mod works? They “override” a file to include it into the game.

**Edit:**  
Not sure if this info will help you guys.  
I added my files to the stonehearth mod. The game didn’t throw an error, but also it is not overriding the file. The one I added to stonehearth has an cubemitter effect, and trying to change it in my own mod had no effect. I guess the game is just ignoring the overrides?

---

<div class="post-metadata">

**Author:** ![Relyss](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/relyss/32/41785_2.png) [@Relyss](https://discourse.stonehearth.net/u/Relyss)\
**Post date:** [November 3, 2017, 10:27pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/5 "2017-11-03T22:27:07Z")

</div>

But the translation mods are working. I think it’s something related to the effects themselves, but as you can see in the log, the error is thrown from the C++ side.

---

<div class="post-metadata">

**Author:** ![max99x](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/max99x/32/40094_2.png) [@max99x](https://discourse.stonehearth.net/u/max99x)\
**Post date:** [November 4, 2017, 12:14am UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/6 "2017-11-04T00:14:25Z")

</div>

@malley might know.

---

<div class="post-metadata">

**Author:** ![malley](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@malley](https://discourse.stonehearth.net/u/malley)\
**Post date:** [November 4, 2017, 12:39am UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/7 "2017-11-04T00:39:18Z")

</div>

Sadly this isn’t possible, but it is already something I have requested. I’m pretty sure I’ve talked about this on one of the couple streams I did about the stone golem attack animation, I would like to override the goblin’s attack animation with the new animation I made where the golem pounds the ground - which is different, but essentially the same thing you are trying to do.

Basically we are both trying to use one file location of animations, and then add a second file location with either additional or overriding animations. This is a request in our backlog, and I 100% want it, but its not really high on our priorities atm. (Or correct me if you don’t think I’m describing the thing you want.)

Sorry : /. Maybe if a lot of people are requesting this we might be able to raise awareness that its a problem?

---

<div class="post-metadata">

**Author:** ![BrunoSupremo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/brunosupremo/32/54819_2.png) [@BrunoSupremo](https://discourse.stonehearth.net/u/BrunoSupremo)\
**Post date:** [November 4, 2017, 12:47am UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/8 "2017-11-04T00:47:01Z")

</div>

I’m just confused as to why it stopped working. Shouldn’t it be a bug then?  
As stated by Yang:

> 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.

And then by Relyss:

> this only worked until A19.

---

<div class="post-metadata">

**Author:** ![Avairian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/avairian/32/47084_2.png) [@Avairian](https://discourse.stonehearth.net/u/Avairian)\
**Post date:** [November 4, 2017, 3:25pm UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/9 "2017-11-04T15:25:04Z")

</div>

> [@malley](#):
>
> Maybe if a lot of people are requesting this we might be able to raise awareness that its a problem?

Avairian present at the feature request convention ✋

---

<div class="post-metadata">

**Author:** ![malley](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@malley](https://discourse.stonehearth.net/u/malley)\
**Post date:** [November 5, 2017, 12:09am UTC](https://discourse.stonehearth.net/t/how-do-i-add-a-new-animation-to-a-hearthling/32596/10 "2017-11-05T00:09:23Z")

</div>

That’s interesting… I didn’t realize it worked at one point… I’ll check with Relyss on Monday : ).
