How do I add a new animation to a hearthling?

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:

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 (126.6 KB)

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?

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) :thinking:

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?) :confused:
It’s about the time we added another folder in the path to the rigs.

1 Like

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?

1 Like

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.

1 Like

@malley might know.

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?

1 Like

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.

Avairian present at the feature request convention :raised_hand:

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

1 Like