Coding bug eradication needed. aka help ;)

Hello, first time moder ere.

Ran into a bump in my mod and I have flat lined in ideas of how to fix it. My mod consist of two items, both require crafting by the blacksmith.

release-663 (x64)[M]
Uncaught TypeError: Cannot read property 'level_requirement' of undefined
TypeError: Cannot read property 'level_requirement' of undefined
    at http://radiant/stonehearth/ui/game/modes/build_mode/building_designer_2/place_floor_deco_tool.js:138:35
    at Object.<anonymous> (http://radiant/radiant/js/radiant/object.js:295:19)
    at Function.x.extend.each (http://radiant/stonehearth/ui/root/js/libs/jquery-1.10.2.min.js:4:5401)
    at Object.radiant.each (http://radiant/radiant/js/radiant/object.js:293:15)
    at http://radiant/stonehearth/ui/game/modes/build_mode/building_designer_2/place_floor_deco_tool.js:136:30
    at Object.<anonymous> (http://radiant/radiant/js/radiant/object.js:295:19)
    at Function.x.extend.each (http://radiant/stonehearth/ui/root/js/libs/jquery-1.10.2.min.js:4:5401)
    at Object.radiant.each (http://radiant/radiant/js/radiant/object.js:293:15)
    at http://radiant/stonehearth/ui/game/modes/build_mode/building_designer_2/place_floor_deco_tool.js:135:27
    at null.<anonymous> (http://radiant/radiant/js/radiant/object.js:295:19)

This is the bump.

Now there are two places where ‘level_requirements’ comes up in the code (Four if you put into account the two items). One is types as the error message an the other is “required_job_level”

#1 - Diff
Item 1
{
“type”: “recipe”,

	"work_units": 2,
	"recipe_name": "Tumult Long Sword",
	"description": "Protection, Hospitality, tribulation.",
	"flavor": "My fate is chosen",
	"portrait": "/Tempest_Order/entities/Long_Redsword/long_Redsword.png",
	"workshop": "stonehearth:blacksmith:workbench",
	"required_job_level": 1,

	"ingredients": [{
		"uri": "stonehearth:entities:refined:silver_ingot",
		"count": 2
	}],
	"produces": [{
		"item": "Tempest_Order:Long_Redsword"
	}]
}

Item 2

    {
    	"type": "recipe",
    	
    	"work_units": 2,
    	"recipe_name": "Tempest Helm",
    	"description": "Starter kit for all Tempest.",
    	"flavor": "My fate is chosen",
    	"portrait": "/Tempest_Order/entities/Silver_RedHelmet/silver_Redhelmet.png",
    	"workshop": "stonehearth:blacksmith:workbench",
    	"required_job_level": 2,
    	
    	"ingredients": [{
    		"uri": "stonehearth:entities:refined:silver_ingot",
    		"count": 2
    	}],
    	"produces": [{
    		"item": "Tempest_Order:Silver_RedHelmet"
    	}]
    }

#2 - The same

Item 1
{
“type”: “entity”,
“mixins”: “file(long_Redsword_ghost.json)”,

	"components": {
		"model_variants": {
			"default": {
				"models": [
					"file(long_Redsword_equipped.qb)"
				]
			}
		},
		"stonehearth:entity_forms": {
			"iconic_form": "file(long_Redsword_iconic.json)"
		},
		"stonehearth:equipment_piece": {
			"slot": "mainhand",
			"render_type": "attach_to_bone",
			"postures": [
				"stonehearth:combat",
				"stonehearth:patrol"
			],
			"ilevel": 18,
			"roles": "knight_job",
			**"level_requirement": 3,**
			"equip_effect": "stonehearth:effects:weapon_level_up"
		}
	},
	"entity_data": {
		"stonehearth:combat:weapon_data": {
			"base_damage": 64,
			"reach": 1.8
		},
		"stonehearth:combat:melee_attacks": [{
			"name": "combat_1h_backhand",
			"effect": "combat_1h_backhand",
			"active_frame": 17,
			"cooldown": 0,
			"priority": 0,
			"aggro_multiplier": 3.0
		}, {
			"name": "combat_1h_forehand",
			"effect": "combat_1h_forehand",
			"active_frame": 16,
			"cooldown": 0,
			"priority": 0,
			"aggro_multiplier": 3.0
		}],
		"stonehearth:combat:melee_defenses": [{
			"name": "combat_1h_parry",
			"effect": "combat_1h_parry",
			"active_frame": 4,
			"cooldown": 6000,
			"priority": 0,
			"chance_of_success": 0.75
		}],
		"stonehearth:net_worth": {
			"value_in_gold": 700,
			"rarity": "common",
			"shop_info": {
				"buyable": false,
				"sellable": true,
				"shopkeeper_level": 4,
				"shopkeeper_type": "caravan"
			}
		}
	}
}

Item 2

{
	"type": "entity",
	"mixins": "file(silver_Redhelmet_ghost.json)",

	"components": {
		"model_variants": {
			"default": {
				"layer": "hat",
				"transparent": "false",
				"models": [
					"file(silver_Redhelmet.qb)"
				]
			},
			"female": {
				"layer": "hat",
				"transparent": "false",
				"models": [
					"file(silver_Redhelmet_female.qb)"
				]
			}
		},
		"stonehearth:entity_forms": {
			"iconic_form": "file(silver_Redhelmet_iconic.json)"
		},
		"stonehearth:equipment_piece": {
			"render_type": "merge_with_model",
			"slot": "helmet",
			"ilevel": 6,
			"roles": "plate_wearer",
			**"level_requirement": 3,**
			"equip_effect": "stonehearth:effects:weapon_level_up"
		}
	},
	"entity_data": {
		"stonehearth:combat:armor_data": {
			"base_damage_reduction": 20
		},
		"stonehearth:net_worth": {
			"value_in_gold": 510,
			"rarity": "common",
			"shop_info": {
				"buyable": false,
				"sellable": true,
				"shopkeeper_level": 4,
				"shopkeeper_type": "caravan"
			}
		}
	}
}

Now I’ve tried switching all of them to the same, two of them diff and the other the same. mitch matching here and there that has been my past 2+ hours.

I also think I could of got my mixintos manifest wrong, plop

{
	"info": {
		"name": "Tempest_Order",
		"version": 3
	},
	"aliases": {
		"Long_Redsword": "file(entities/Long_Redsword/long_Redsword.json)",
		"Silver_RedHelmet": "file(entities/Silver_RedHelmet/silver_Redhelmet.json)"
	},
	"mixintos": {
		"/stonehearth/jobs/blacksmith/recipes/recipes.json": ["file(mixins/long_Redsword_recipes.json)"],
		"/stonehearth/jobs/blacksmith/recipes/recipes.json": ["file(mixins/Silver_RedHelmet_recipes.json)"]
	}
}

Apart from that idk what to do, I need help. Thankyou and have a nice day.

Here are the resources I have been using to get to where I am.

I know its waaaay behind but its the one I found… so that might be my mistake too~

Your manifest is wrong.

aliases should look something like

   "aliases": {
   	"buffs:assassin:dmg_1": "file(jobs/assassin/assassin_buffs/damage_1_buff.json)",
   	"buffs:assassin:dmg_2": "file(jobs/assassin/assassin_buffs/damage_2_buff.json)",
   	"buffs:assassin:speed_1": "file(jobs/assassin/assassin_buffs/speed_1_buff.json)",
   	"buffs:assassin:speed_2": "file(jobs/assassin/assassin_buffs/speed_2_buff.json)",
   	"buffs:assassin:slow": "file(jobs/assassin/assassin_buffs/assassin_slow_buff.json)",
   	"buffs:assassin:burn": "file(jobs/assassin/assassin_buffs/assassin_burn_buff.json)",
   	"assassin:talisman": "file(entities/weapons/scimitar/scimitar_talisman.json)",
   	"assassin:manual_of_slow_stab": "file(jobs/assassin/assassin_abilities/assassin_slow_stab_manual.json)",
   	"assassin:manual_of_burning_slash": "file(jobs/assassin/assassin_abilities/assassin_burning_slash_manual.json)",
   	"jobs:assassin": "file(jobs/assassin/assassin_description.json)",
   	"weapons:dagger": "file(entities/weapons/dagger)",
   	"weapons:scimitar": "file(entities/weapons/scimitar)"
   },

Notice the weapons:dagger format? that’s how weapons should be aliased.

I will look more into what’s wrong but that’s a starter.

1 Like

Hey there @Nar5ial, any chance you could upload your mod? I’m trying to look through everything but it is really hard with all the scrolling, and I can’t see the folder structure.

Tempest_Order.zip (30.1 KB)

Here ya go!

1 Like

Did you run all your json’s through http://jsonlint.com/ before posting?

Usually a nice double check.

Will check for anything like formatting and a stray wandering commas


EDIT: as a precaution, you should get into a habit of naming all your json’s/qb’s with the same naming convention…

I prefer the one used by Team Radiant themselves. So for example Silver Red Helmet would be named silverRedHelmet.

Pretty common naming convention, first world lowercase, each word after uppercase first letter.

I do, though half way through using it I realized that it only showed you the problem… so maybe one or two .json files have gone amiss…

Another problem.

Your recipes are named long_Redsword_recipe_r and Silver_RedHelmet_recipe_r

but in the manifest you refer to them as long_Redsword_recipes.json without the _r


EDIT: nvm

OK, here’s what I’ve got. I went through and made a number of changes:

  1. Everything lowercase!!! While capitals should work, you’re setting yourself up for trouble as everything is case sensitive. You’ll make your life much easier if you use lowercase and underscores instead.
  2. Combined mixin recipe files. You only need one recipe.json to mixinto the blacksmith recipe.json.
  3. Moved minin recipe.json. The code file(...) looks in the current folder. Since your mixin and recipes were in different folders, I moved them into the same one.

Let me know if this is working for you know, and if my changes make sense. Also, something is off with the recipe ingredients, I didn’t look into it yet, but I’m getting a blank image for ingredients OK, issue with ingredients is invalid name. Silver ingots are stonehearth:refined:silver_ingot, so if you change that in both recipe files they should work.

tempest_order_jomaxro.zip (29.7 KB)

1 Like

Thanks you @jomaxro & @Aviex for your help, I get on it right away, be back in a min.

@jomaxro, It Worked! Thanks!!!

1 Like

@jomaxro Um… well it worked in the way that the item is in the game, but once I tried to craft it

Here is the log. Says its an assertion fail. Seeked around the fourms and came across the failure due to outdated video cards, but mine are up to date. I also thought it might be the colour palette I used for the mod, is this a know problem? I don’t know why it would be, but if its a simple “change the colour of the voxels on the items” then yea… (Have not tried to craft the helm yet.)

2016-10-20 03:03:31.532772 | server |  0 |                  simulation.core | took 247 ms to update game state
2016-10-20 03:03:31.532772 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:33.675544 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:34.284121 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:35.849321 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:36.390389 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:37.834573 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:38.531661 | server |  0 |                  simulation.core | took 105 ms to process job list
2016-10-20 03:03:39.608802 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:40.212375 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:40.397398 | server |  1 |         simulation.remote_client | started buffering client updates. (seq:3133 ack:3123)
2016-10-20 03:03:40.459412 | server |  1 |         simulation.remote_client | stopped buffering client updates. (seq:3133 ack:3130)
2016-10-20 03:03:41.398531 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:41.744069 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:44.149880 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:44.642438 | server |  0 |                  simulation.core | took 124 ms to update game state
2016-10-20 03:03:44.642438 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:44.905972 | server |  1 |         simulation.remote_client | started buffering client updates. (seq:3207 ack:3197)
2016-10-20 03:03:45.002484 | server |  1 |         simulation.remote_client | stopped buffering client updates. (seq:3207 ack:3200)
2016-10-20 03:03:45.118502 | server |  1 |         simulation.remote_client | started buffering client updates. (seq:3210 ack:3200)
2016-10-20 03:03:45.234013 | server |  1 |         simulation.remote_client | stopped buffering client updates. (seq:3210 ack:3207)
2016-10-20 03:03:46.799216 | server |  2 |      simulation.pathfinder.astar | [astar tid:4621 (2490094 Sanin Nonac) bfs @ (9.00, 40.00, 308.00) (bfs)] open set is empty!  returning
2016-10-20 03:03:49.286029 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:49.356048 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:49.727085 | server |  0 |                  simulation.core | took 105 ms to process job list
2016-10-20 03:03:51.471306 | server |  2 |      simulation.pathfinder.astar | [astar tid:4967 (17254884 Vio Vondess) bfs @ (11.00, 40.00, 306.00) (bfs)] open set is empty!  returning
2016-10-20 03:03:52.536941 | server |  1 |                       lua.memory | lua shared heap size: 638.671 MB.
2016-10-20 03:03:52.537442 | server |  1 |                       lua.memory | o: outstanding allocs
2016-10-20 03:03:52.537442 | server |  1 |                       lua.memory |       96 bytes (o:2014472) : ########################################
2016-10-20 03:03:52.537442 | server |  1 |                       lua.memory |       64 bytes (o:1492998) : #############################
2016-10-20 03:03:52.537442 | server |  1 |                       lua.memory |       40 bytes (o:1488030) : #############################
2016-10-20 03:03:52.537442 | server |  1 |                       lua.memory |      320 bytes (o: 241444) : ####
2016-10-20 03:03:52.537442 | server |  1 |                       lua.memory |     ... remaining allocs are each < 5% of the count
2016-10-20 03:03:53.094516 | server |  0 |                  simulation.core | took 181 ms to update game state
2016-10-20 03:03:53.095012 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:53.276035 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:54.479194 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:54.706217 | server |  0 |                  simulation.core | took 212 ms to update game state
2016-10-20 03:03:54.706217 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:54.914743 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:56.161902 | server |  2 |      simulation.pathfinder.astar | [astar tid:5280 (33105276 Caleb Papp) bfs @ (-85.00, 53.00, 272.00) (bfs)] open set is empty!  returning
2016-10-20 03:03:56.543451 | server |  0 |                  simulation.core | took 163 ms to update game state
2016-10-20 03:03:56.543451 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:58.182664 | server |  2 |      simulation.pathfinder.astar | [astar tid:5364 (16390393 Yui Prestin) bfs @ (-85.00, 54.00, 270.00) (bfs)] open set is empty!  returning
2016-10-20 03:03:58.184664 | server |  2 |      simulation.pathfinder.astar | [astar tid:5374 (22965113 Lia Fenton) bfs @ (-85.00, 54.00, 270.00) (bfs)] open set is empty!  returning
2016-10-20 03:03:58.764733 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:59.147782 | server |  0 |                  simulation.core | took 252 ms to update game state
2016-10-20 03:03:59.147782 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:59.246298 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:03:59.318809 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:00.112904 | server |  0 |                  simulation.core | took 138 ms to update game state
2016-10-20 03:04:00.112904 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:00.348935 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:00.534457 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:00.652477 | server |  0 |                  simulation.core | took 106 ms to update game state
2016-10-20 03:04:00.652477 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:02.192191 | server |  2 |      simulation.pathfinder.astar | [astar tid:5496 (22965113 Lia Fenton) bfs @ (-84.00, 52.00, 268.00) (bfs)] open set is empty!  returning
2016-10-20 03:04:02.690254 | server |  0 |                  simulation.core | took 238 ms to update game state
2016-10-20 03:04:02.690254 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:02.855769 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:03.131808 | server |  0 |                  simulation.core | took 146 ms to update game state
2016-10-20 03:04:03.131808 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:03.210320 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:03.537360 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:04.781020 | server |  0 |                  simulation.core | took 123 ms to update game state
2016-10-20 03:04:04.781020 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:04.961037 | server |  0 |                  simulation.core | took 167 ms to update game state
2016-10-20 03:04:04.961037 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:06.173192 | server |  2 |      simulation.pathfinder.astar | [astar tid:5710 (2312906 Arwyn Killian) bfs @ (-85.00, 52.00, 268.00) (bfs)] open set is empty!  returning
2016-10-20 03:04:06.367717 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:10.347221 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:13.216591 | server |  0 |                  simulation.core | took 132 ms to update game state
2016-10-20 03:04:13.216591 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:13.404610 | server |  0 |                  simulation.core | took 115 ms to update game state
2016-10-20 03:04:13.404610 | server |  2 |                  simulation.core | game loop exhausted before any jobs processed!
2016-10-20 03:04:13.712158 | client |  0 |                              app | Assertion Failed: header.compression == COMPRESSION_NONE(C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\voxel\qubicle_file.cpp:67)

#Edit not the colour palette.

The way I read it, you’ve got your voxel editor set to create compressed .qb files. Stonehearth requires uncompressed .qb files.

Here is a guide for Qubicle on the settings you need for Stonehearth. If you aren’t using Qubicle, then you should be able to apply those settings to whichever voxel editor you are using.

4 Likes

Thank you very much!

1 Like

His manifest wasn’t wrong, @Aviex. You can use whatever format you want for your aliases, including just a word (though we don’t recommend the uppercases, as @jomaxro has mentioned, and the only accepted symbols are “_” and “:” I think). As long as the json file is in the path that you specified in the manifest, and you reference your aliases correspondingly in your other files, it should work fine.

3 Likes