[Question] EXP override potter

Hello, I have followed this game for a while and I have only came into finding out there was mods for it and I looked at others and found them very interesting so I wanted to try and make a mod myself but only basic so that I can learn to make more complex ones in my free time.

When I load up the game it is seen by the game and loaded when I play but when I want to craft the item in the game it is not showing up the the carpenters workbench.

here is a link to my github where the code is stored for people to help me out with it.

Hello! Welcome to the forums, and welcome to modding Stonehearth!

It looks like there were only a few small changes you needed to make.

Inside of your wood recipe, the reference to your wood was incorrect in produces, so change it from:

“item” : “craftmod:wood:wood”

to:

“item” : “craftmod:wood”

So that it properly references the alias you made.

Next, for your manifest it looks like you duplicated file by accident in your mixintos and miscalled the folder (professions should be jobs), so you’ll need to change it to:

"mixintos": {
		"/stonehearth/jobs/carpenter/recipes/recipes.json": "file(jobs/carpenter/recipes/recipes.json)"
	},

Also, this will not change the functionality, but you can shorten your recipes.json from:

		"ordinal": 5,
		"name": "i18n(stonehearth:jobs.carpenter.recipes.furniture_name)",
		"recipes": {
			"wood": {
				"recipe": "file(wood.json)"
			}
		}

to:

		"recipes": {
			"wood": {
				"recipe": "file(wood.json)"
			}
		}

as the ordinal and name are already specified (unless you wanted to change the ordinal/name).

I hope this helps you!

Thanks @GreatColtini for that as it worked perfectly.

My other Question I have is how to make multiple of the same item so for an example I made a recipe for a food item but wanted a set of ingredients to produce multiple servings (multiple items)
I thought it was add “count”: 2 underneath it but that failed to work?

thanks for all the people help me as I am learning a lot and I want to get a base of ideas working before planning the actual mod itself.

You’re quite welcome!

Okay, I believe the method you do here is just repeating the item in the produces section as I have below:

   "produces": [
      {
         "item": "stonehearth_expanded:decoration:orc_head_on_stick"
      },
	  {
         "item": "stonehearth_expanded:decoration:orc_head_on_stick"
      }
   ]

I tested this with my mod and it functions as expected – two orc heads are created.

worked like a treat :slight_smile: thanks again @GreatColtini.

Now I am trying to work out how to have multiple profession crafting so like I am testing with wood and now stone for the mason.

Okay, for your stone to work you simply need to add it into your manifest the same way you did with the wood!

	"mixintos": {
		"/stonehearth/jobs/carpenter/recipes/recipes.json": "file(jobs/carpenter/recipes/recipes.json)"
	},
	"aliases": {
		"wood": "file(entities/wood)"
	}

You need to add the recipes file and the alias for your stone:

	"mixintos": {
		"/stonehearth/jobs/carpenter/recipes/recipes.json": "file(jobs/carpenter/recipes/recipes.json)",
            "/stonehearth/jobs/mason/recipes/recipes.json" : "file(jobs/mason/recipes/recipes.json)"
	},
	"aliases": {
		"wood": "file(entities/wood)",
            "stone" : "file(entities/stone)"
	}

However, one additional note. Your current recipes don’t produce your custom alias items, if you change your stone recipe from:

	"produces": [
	{
	"item": "stonehearth:resources:stone:hunk_of_stone"
	},
	{
	"item": "stonehearth:resources:stone:hunk_of_stone"
	}
]

into:

	"produces": [
		{
		"item": "craftmod:stone"
		},
		{
		"item": "craftmod:stone"
		}
	]

This will make it produce your custom stone. I will leave changing the wood recipe to yourself.

yeah I know but just as a test first.
like I said just want to get the basic knowledge in first and then start properly on making the mod I want to make.
if I know a resource is in the game I can test if it works or not and then plan ahead for my actual item.

When I tested to see if it would craft and it came up with this error?

[details=Summary]> release-687 (x64)[M]

smart_crafter/lib/util.lua:5: stack overflow
stack traceback:
[C]: in function 'type’
smart_crafter/lib/util.lua:5: in function 'deep_compare’
smart_crafter/lib/util.lua:17: in function 'deep_compare’
smart_crafter/lib/util.lua:17: in function 'deep_compare’
smart_crafter/lib/util.lua:17: in function ‘deep_compare’
…_crafter/services/server/crafter_info/recipe_map.lua:63: in function ‘contains’
…_crafter/services/server/crafter_info/recipe_map.lua:41: in function ‘intersecting_values’
…ices/server/crafter_info/crafter_info_controller.lua:122: in function 'get_possible_recipes’
smart_crafter/smart_craft_order_list.lua:183: in function '_sc_get_recipe_info_from_ingredient’
smart_crafter/smart_craft_order_list.lua:67: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function ‘add_order’

smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
smart_crafter/smart_craft_order_list.lua:84: in function 'add_order’
stonehearth/components/workshop/craft_order_list.lua:74: in function <stonehearth/components/workshop/craft_order_list.lua:68>[/details]

5 minutes later… it was the smart crafter mod but only on the mason not the carpenter?
Is there a fix for that?

Let’s ask @Drotten if he knows what’s going on.

1 Like

So, it seems that your mod has stumbled upon one of the big problems with my smart crafter mod.

What’s happening here is that the recipe requires a wood resource to be able to craft, well, a wooden log. And, if there is no wood resource available in the inventory, the mod will look for any recipe that can craft wood resource, and since that same recipe can craft that, the mod will then promptly attempt to add that recipe (again) to the crafting list. But, that recipe also requires a wood resource to be made, so it will again look at all the recipes to find that recipe again, and it will go on and on like that, until it runs out of memory and crashes.

There a few different things you could do about this:

  • make sure you have at least one wood resource available (and a stone resource when testing out the other recipe),
  • change so that the recipe produces something else than an oak log, or
  • don’t load the Smart Crafter mod while you’re testing your own mod (either through settings or by moving it from the mods folder).

@Drotten Okay, I only had smart crafter about 6 days before wanting to make a code testing mod then gets moved into a actual mod.

That’s understandable. The suggestions I gave above were for while you are testing out some stuff for your own mod. I mean, the errors you got were from my Smart Crafter mod, so you shouldn’t have to concern about that for your own mods.

another error that I can’t quite understand and there is two errors?

[details=On load up]> release-687 (x64)[M]

@stonehearth/services/server/job/job_info_controller.lua:251: Crafter job stonehearth:jobs:carpenter has a recipe named “storage:fur” that produces an item not in the manifest stonehearth:resources:pelt:wolf_pelt
stack traceback:
radiant/modules/common.lua:237: in function 'report_traceback’
radiant/modules/common.lua:456: in function ‘verify’
…nehearth/services/server/job/job_info_controller.lua:251: in function ‘_initialize_recipe_data’
…nehearth/services/server/job/job_info_controller.lua:234: in function ‘_build_craftable_recipe_list’
…nehearth/services/server/job/job_info_controller.lua:102: in function <…nehearth/services/server/job/job_info_controller.lua:63>[/details]

[details=Select to craft]> release-687 (x64)[M]

Uncaught TypeError: Cannot read property ‘entity_data’ of undefined
TypeError: Cannot read property ‘entity_data’ of undefined
at App.StonehearthTeamCrafterView.App.View.extend.preview (http://radiant/stonehearth/ui/game/show_workshop/show_team_workshop.js:726:51)
at App.StonehearthTeamCrafterView.App.View.extend.actions.select (http://radiant/stonehearth/ui/game/show_workshop/show_team_workshop.js:376:21)
at o.create.send (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:8:10765)
at http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:5:30796
at Object.a.run (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:1:2810)
at u (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:5:17688)
at Object._.registeredActions.(anonymous function).handler (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:5:30761)
at HTMLDivElement. (http://radiant/stonehearth/ui/root/js/libs/ember-1.8.1.min.js:10:7200)
at HTMLBodyElement.x.event.dispatch (http://radiant/stonehearth/ui/root/js/libs/jquery-1.10.2.min.js:5:14129)
at HTMLBodyElement.v.handle (http://radiant/stonehearth/ui/root/js/libs/jquery-1.10.2.min.js:5:10873)[/details]

I have fixed the problem and I added in something by accident but took it out and it fixed all problems.

Can anyone help me out on how to change the EXP rates on certain crafting recipes for jobs?

In job description, the xp rewards are given based on level. This is an example excerpt from the carpenter_description.json:

   "xp_rewards": {
      "craft_level_0": 15,
      "craft_level_1": 17,
      "craft_level_2": 19,
      "craft_level_3": 21,
      "craft_level_4": 23,
      "craft_level_5": 25,
      "craft_level_6": 27
   },

@GreatColtini Okay so how would I add that to a mod for existing jobs?

If you want to overwrite the existing xp rewards with your own, you will need to make your own file, and mix into the existing carpenter_description.

The method I will use as an example follows as such:

My file to overwrite experience is:

{
   "xp_rewards": {
      "craft_level_0": 30,
      "craft_level_1": 17,
      "craft_level_2": 500,
      "craft_level_3": 21,
      "craft_level_4": 23,
      "craft_level_5": 25,
      "craft_level_6": 27
   },
}

and it will be named carpenter_new_exp.json.

Now, add in to your manifest.json:

	"mixintos" : {
		"/stonehearth/jobs/carpenter/carpenter_description.json" : "file(carpenter_new_exp.json)"
         }

@GreatColtini not noticed anything different in the exp and I have the override in the jobs folder of my mod and I have added to the manifest so I don’t know why it is not working?

I tested it out and it worked for me. In my manifest, the mixintos looks like this:

 "mixintos" : {
  		"/stonehearth/jobs/carpenter/carpenter_description.json" : "file(jobs/carpenter/carpenter_description.json)"
 	}

My modded carpenter_description file is located in:

mymod/jobs/carpenter/carpenter_description.json

And the file itself looks like this:

   {  
  "xp_rewards": {
      "craft_level_0": 100,
      "craft_level_1": 2000,
      "craft_level_2": 300,
      "craft_level_3": 400,
      "craft_level_4": 23,
      "craft_level_5": 25,
      "craft_level_6": 27
   }
}

Does this help?