Mod bugging in the 0.21.0.3378 version (not a problem anymore, found the error)

I’m having a problem with my mod in the latest version.

When launching the game, an error pop up (right at the start menu) with this (copied from the stonehearth.log)

2017-03-30 23:02:05.344491 | server |  0 |                         lua.code | -- Script Error (native) Begin ------------------------------- 
2017-03-30 23:02:05.344491 | server |  0 |                         lua.code |    c++ exception: invalid resource 'archipelago_biome/entities/monsters/cocoling/cocoling.json'. File has a mixin to that is not formatted correctly!.
2017-03-30 23:02:05.344491 | server |  0 |                         lua.code |    stack traceback:
2017-03-30 23:02:05.344491 | server |  0 |                         lua.code |    	[C]: in function 'load_json'
2017-03-30 23:02:05.344491 | server |  0 |                         lua.code |    	radiant/modules/resources.lua:33: in function 'load_json'
2017-03-30 23:02:05.344491 | server |  0 |                         lua.code |    	...nehearth/services/server/catalog/catalog_service.lua:129: in function '_load_json'
2017-03-30 23:02:05.344491 | server |  0 |                         lua.code |    	...nehearth/services/server/catalog/catalog_service.lua:135: in function '_load_entity_json'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	...nehearth/services/server/catalog/catalog_service.lua:110: in function '_load_catalog'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	...nehearth/services/server/catalog/catalog_service.lua:36: in function 'initialize'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	stonehearth/stonehearth_server.lua:73: in function 'create_service'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	stonehearth/stonehearth_server.lua:127: in function 'instance'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	[C]: in function 'xpcall'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	radiant/modules/common.lua:257: in function 'xpcall'
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code |    	radiant/modules/events.lua:285: in function <radiant/modules/events.lua:251>
2017-03-30 23:02:05.344989 | server |  0 |                         lua.code | -- Lua Error End   ------------------------------- 

A bit of background: I have a mob (the cocoling) and in its file it has a mixin pointing to the stonehearth monster mixin, so it inherits the basic monster behaviors. It worked last version.

Now, the message is clear about having a bad mixin. But I can’t see why…

"mixins": "stonehearth:mixins:monster",

So… I have no idea what to do here. What is wrong? The mixin is fine, it is from the game itself and is used in other places too. Removing the mixin makes the game not give any errors on launch, but obviously it will when the mob is created in the world without it.

omg i though id never see the day of you not knowing something, guess theres a first time for everything

Lol, I know barely nothing.

Anyway. Changing the mixin to other mixin, like the critter or tree mixin still gives an error, even though I’m using those two in other places in my mod…

Edit:
Fixed. It required chaning the line
"stonehearth:posture": [],
to
"stonehearth:posture": {},

Discovered the diference while checking the goblin file. Was this syntax changed? Or I just got it wrong since last version and it happened to fail just now?

1 Like

No, you’re right. I believe it was changed in this last version. Another thing to note for modders on A21 (although it’s always the same: revising the stonehearth code and making sure you have the correct fields :confused: ).

3 Likes

Oh, thanks.
I just got a little lost there as the message error was misleading… It makes it sounds as the error was in the mixin file, not the one importing it, which made me waste a lot of time debugging the wrong things.

In the end, I noticed that line is not even needed anymore in my mob. It was a left over from previous code that I had (those mobs would be like little helpers at first, not just attacking monsters)

2 Likes