Inconsistent "Parent Level requirement" node in class JSON's

I’m rearranging the class tree and I noticed some classes have a parent_level_requirement node that requires the number in quotes, ( “parent_level_requirement” : “1”, ) such as the Carpenter or Weaver, while some require without quotes ( “parent_level_requirement” : 1, ) such as the potter or herbalist. In the case of no-quotes, you’ll receive an assert error at runtime.

I tested both node types and they parent_level_requirement node works for all of the classes.

Hi Wharp,
I’m looking at all the json files for the word “parent_level_requirement” and then all seem to have the flat number like:
“parent_level_requirement” : 2

I don’t see a “parent_level_requirement” field in the carpenter and weaver jsons …
Thanks
-Yang

Yeah, they’re not there, but when you declare “parent_level_requirement” : “1”, in say the carpenter’s JSON, it adds that requirement to the class tree

So I guess the issue is if the stonehearth json for a class is missing the node, you have to add the node with the number in quotes, whereas, like with the herbalist, if they level from the worker, they could just have a requirement of level 0.

@Wharp
So are you trying to make a mod where you add a job that promotes to a carpenter?
I’m confused about why one would add a requirement to the carpenter and what the actual bug is?
Thank you
-Yang

1 Like

Yes, Im making a mod where the base class is a Mason, and the carpenter levels from there, because thematically its more appropriate.

The issue I’m finding is with the “parent_level_requirement” node for classes. Some classes (carpenter, weaver) do not have this node, and if they do not, then you can enter either:
"parent_level_requirement" : "4",
or
"parent_level_requirement" : 4,
both will work fine.

However, some classes (herbalist, potter) have
"parent_level_requirement" : 4,
in their vanilla json, and when you try to use:
"parent_level_requirement" : "4", in a mod’s json,
it will throw an assert error on runtime.

@Wharp
Can you copy and paste the assert you see in runtime?
I think you should use “parent_level_requirement” : 4 without the quotes because that means it will be read as a number instead of a string. I don’t know why the string works sometimes.
Thanks
-Yang

1 Like
2016-Jan-15 13:53:40.476697 | server |  1 |                              app | Stonehearth Version 0.13.0.2786 (x64)
2016-Jan-15 13:53:40.476697 | server |  1 |                      core.config | user id is    d3bf7152-60d4-11e5-8251-00ffbb497e0a
2016-Jan-15 13:53:40.476697 | server |  1 |                      core.config | session id is d1fa2efc-bbda-11e5-8bc8-bcee7b2f761a
2016-Jan-15 13:53:40.476697 | server |  0 |                      core.system | Initializing crash reporter
2016-Jan-15 13:53:41.001546 | server |  0 |                         lua.data | lua jit is disabled
2016-Jan-15 13:53:41.001546 | server |  1 |                        resources | Module rayyas_children_ui version 1 is deferred load)
2016-Jan-15 13:53:41.001546 | server |  1 |                        resources | Modules have been modified by the user!
2016-Jan-15 13:53:41.017121 | server |  1 |                              app | Running Stonehearth server on port 29895
2016-Jan-15 13:53:41.017121 | client |  1 |                renderer.renderer | Initializing OpenGL
2016-Jan-15 13:53:41.017121 | server |  0 |                  physics.navgrid | subspace pathfinder is enabled
2016-Jan-15 13:53:41.032746 | client |  1 |                renderer.renderer | Determining window placement
2016-Jan-15 13:53:41.032746 | client |  1 |                renderer.renderer | Selecting monitor at 8, 62
2016-Jan-15 13:53:41.032746 | client |  1 |                renderer.renderer | Creating OpenGL Window
2016-Jan-15 13:53:41.157762 | server |  0 |                              app | Assertion Failed: new_node.name() == "mixins" || new_node.type() == mixin_node.type()(C:\rb\ihome\root\SH-OB-BUILD\stonehearth\source\resources\res_manager.cpp:627)
2016-Jan-15 13:53:41.379977 | client |  1 |                renderer.renderer | Creating OpenGL Context
2016-Jan-15 13:53:41.380977 | client |  1 |                renderer.renderer | Finished OpenGL Initialization
2016-Jan-15 13:53:41.380977 | client |  1 |                    horde.general | Initializing GL2 backend using OpenGL driver '4.5.0 NVIDIA 359.00' by 'NVIDIA Corporation' on 'GeForce GT 750M/PCIe/SSE2'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code | -- Script Error (lua) Begin ------------------------------- 
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    Unknown C++ exception
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    stack traceback:
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	radiant/modules/events.lua:185: in function <radiant/modules/events.lua:181>
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	[C]: in function 'load_json'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	radiant/modules/resources.lua:33: in function 'load_json'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	stonehearth/services/server/shop/shop_service.lua:108: in function '_get_sellable_entity_description'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	stonehearth/services/server/shop/shop_service.lua:61: in function '_init_sellable_items'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	stonehearth/services/server/shop/shop_service.lua:15: in function 'initialize'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	stonehearth/stonehearth_server.lua:71: in function 'create_service'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	stonehearth/stonehearth_server.lua:165: in function 'instance'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	radiant/modules/events.lua:226: in function <radiant/modules/events.lua:220>
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	[C]: in function 'xpcall'
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code |    	radiant/modules/events.lua:220: in function <radiant/modules/events.lua:190>
2016-Jan-15 13:53:44.602506 | server |  0 |                         lua.code | -- Lua Error End   ------------------------------- 
2016-Jan-15 13:53:44.650320 | server |  0 |                             mod stonehearth | ai slow start is enabled
2016-Jan-15 13:53:44.650320 | server |  0 |                             mod ai | cpp ai is enabled.
2016-Jan-15 13:53:44.853434 | server |  2 |                          network | server allocating new send buffer (total: 0)
2016-Jan-15 13:53:44.869059 | client |  1 |                          browser | cef started.
2016-Jan-15 13:53:44.869059 | client |  2 |                          browser | Navigate called without an existing browser!
2016-Jan-15 13:53:44.869059 | thread2108 |  2 |                          browser | Doing a buffered navigation....
2016-Jan-15 13:53:44.869059 | client |  0 |                  physics.navgrid | subspace pathfinder is enabled
2016-Jan-15 13:53:44.900310 | client |  2 |                          network | client allocating new send buffer (total: 0)
2016-Jan-15 13:53:44.947186 | client |  1 |                      client.core | user feedback is on
2016-Jan-15 13:53:45.384690 | server |  1 |         simulation.remote_client | started buffering client updates. (seq:10 ack:0)
2016-Jan-15 13:53:45.399702 | client |  0 |                renderer.renderer | window closed.  exiting process

I realize it’s a frivolous thing, and I will definitely only use a value from now on, but I encountered the error because I began by using strings like I saw in one of the jsons, and it took me a while to figure out. Sorry if this cause any frustration to you

Also, the assert error didn’t make it very clear to me what change had caused it :frowning:

I think that error is saying that one of your json files is invalid json.
I changed my potter level requirement to “4” and my game still runs. I don’t know if the potter will promote properly, but there’s no crash or assert
Thanks
-Yang

Weird, I double-checked and it happens in my mod, perhaps it has to do with the fact that I started Rayyas Children mod as a base.

@Wharp
rayya’s children should never be set to main mod in user settings because it is not programmed to do so XD

-Yang

if it is an invalid json i would suggest using JSONLint to verify your .json files and see which one is causing the problem.

hope thats of some help.

2 Likes

Haha! Yes I know, I haven’t set it as the main mod, I mean that I took RC and modded off of that, I still have stonehearth and radiant mods as well

@8BitCrab Wow, thanks! thats really helpful

2 Likes

@Wharp Oooh I see. I misunderstood.

Well if you still run into issues, maybe you can upload your mod and I’ll try installing it to see what happens XD
-Yang

2 Likes

I hope to soon :slight_smile: Btw, do you happen to know if there’s any place else in the code that I need to change the starting talisman other than the *_population json ?

I think your population file is it. Unless it’s not working somehow?
-Yang

It’s working, but I didn’t test it thoroughly at all. :smiley: Thanks a lot! I love the streams.

1 Like