# Custom crafting class

**URL:** <https://discourse.stonehearth.net/t/custom-crafting-class/38934>\
**Category:** Modding\
**Created:** [December 29, 2018, 3:49pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934 "2018-12-29T15:49:41Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![paulthegreat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/paulthegreat/32/62395_2.png) [@paulthegreat](https://discourse.stonehearth.net/u/paulthegreat)\
**Post date:** [December 29, 2018, 4:55pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/22 "2018-12-29T16:55:03Z")

</div>

Your roles are messed up. They should be `["guildmaster_job", "crafter"]` as Dani suggested, not `["guildmaster", "job crafter"]` as you have.

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 4:55pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/23 "2018-12-29T16:55:54Z")

</div>

Yea I am fixing that now. When he suggested I use an array set up I mis-typed.

---

<div class="post-metadata">

**Author:** ![paulthegreat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/paulthegreat/32/62395_2.png) [@paulthegreat](https://discourse.stonehearth.net/u/paulthegreat)\
**Post date:** [December 29, 2018, 4:56pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/24 "2018-12-29T16:56:42Z")

</div>

Your workshop URIs in your recipes are wrong. You need to use your mod’s namespace, not `stonehearth`.

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 5:01pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/25 "2018-12-29T17:01:27Z")

</div>

I don’t see where you are looking?

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 5:19pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/26 "2018-12-29T17:19:59Z")

</div>

I see it.

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 5:26pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/27 "2018-12-29T17:26:32Z")

</div>

All the changes have been made and the error remains. I feel like it is related to when I open the workshop and it says “undefined crafting orders”.

---

<div class="post-metadata">

**Author:** ![DaniAngione](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/daniangione/32/63425_2.png) [@DaniAngione](https://discourse.stonehearth.net/u/DaniAngione)\
**Post date:** [December 29, 2018, 5:27pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/28 "2018-12-29T17:27:07Z")

</div>

Yes, I’m still looking for it. It’s quite elusive though, so must be something really small, like a typo

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 5:28pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/29 "2018-12-29T17:28:13Z")

</div>

Yea. i just have no idea what workshop equivalents is referring to.

---

<div class="post-metadata">

**Author:** ![DaniAngione](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/daniangione/32/63425_2.png) [@DaniAngione](https://discourse.stonehearth.net/u/DaniAngione)\
**Post date:** [December 29, 2018, 5:31pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/30 "2018-12-29T17:31:43Z")

</div>

Hah!  
Found it

Very elusive indeed. Will write up in a sec.

 ![20181229153055_1](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/e/0/e0f0b2b7e2f893a3ebda024afd9dfebc71858d46.jpeg)

(just checking if my fixes work)

---

<div class="post-metadata">

**Author:** ![DaniAngione](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/daniangione/32/63425_2.png) [@DaniAngione](https://discourse.stonehearth.net/u/DaniAngione)\
**Post date:** [December 29, 2018, 5:47pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/31 "2018-12-29T17:47:17Z")

</div>

Yep! It works.

Okay, so… your `workshop.less` file was broken (in the `skin` folder inside the Guildmaster folder)

Try replacing it entirely with this:

```
#craftWindow.guildmaster {
   background: url('skin.png');

   .item {
      background-image: url('skin.png');
   }

   #craftButton {
      position: absolute;
      right: 10px;
      top: -50px;
      width: 90px;
      height: 151px;
      #craftButtonImage {
         background: url('hammer.png');
      }
   }

   #orderListContainer {
      table{
         background: #21272c;
      }

      .orderListRow {
         background: #21272c;
      }
   }

   #tabContainer {
      #tabs {
         position: absolute;
         top: 743px;
      }
   }
}

```

It should work!

As a general tip, however, I do recommend cleaning your mod a bit as well!  
I understand that you’re on the process of learning (we all always are, really!) but I’ve learned with Bruno that cleaning up earlier spares you a headache later. I used to put all stuff I would mix into something in a single “mixins” folder, for example - and he made me realize that this makes it uncomfortably difficult to browse around/work with that mod, for example.  
So a couple of tips:

- I’d remove all iconic aliases from the manifest, they’re not really necessary. I use SHED too and you can easily access iconics by going to the iconic tab inside the main entity. Not only they are useless but also they can be spawned (since they’re aliases) and when they are spawned they cause errors for not having the entity forms component. Since they do have catalog tags, they could even show up in shops, for example - causing more errors.

- You don’t need to alias some things like the .less files (you actually declare it twice 😛 ) Less files just need the “ui” declaring at the bottom of the manifest, no alias needed! Some things are not necessary (like recipes) but I understand they are useful since you can edit them in SHED. I’d remove them too (personally) but that’s up to you, these ones are harmless.

- There’s a bunch of assets/things not being used that add a lot of weight to your mod. For example, the UI folder has only unused workshop UI things and inside the jobs folder there’s a lot of things that you don’t use or are from the base game (like the common icons). You can make your entities search for these directly by using addresses like `"/stonehearth/jobs/common/images/recipe_unlock_1.png"` instead of having to copy them over to your mod. Additionally, there is also a lot of unused things in the Data folder: all the game’s rigs are there for no reason 🙂 All in all, all those things add 400+ mbs to your mod 😃

- And finally, I’d fix the aliases of the unused workshops. I know they are unused, but either keep them with fixed aliases or just remove them from the manifest entirely. Leaving them in the manifest but pointing to files that don’t exist will only cause errors by accident if you forget to edit some reference, etc.

That’s all! 🙂  
Keeping it tidy and clean helps with performance and makes it more compatible with other mods, so it’s always a good policy 🙂

Good luck and hope to see it soon in the workshop 😃

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 6:02pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/32 "2018-12-29T18:02:56Z")

</div>

Thank you so much, Dani! I will implement the changes you made and spend quite a while cleaning things up!

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 6:06pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/33 "2018-12-29T18:06:03Z")

</div>

If it is ok, when I finish cleaning up I would like to send it to you again to see if I can streamline it any further.  
Thanks again!!!

---

<div class="post-metadata">

**Author:** ![DaniAngione](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/daniangione/32/63425_2.png) [@DaniAngione](https://discourse.stonehearth.net/u/DaniAngione)\
**Post date:** [December 29, 2018, 6:11pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/34 "2018-12-29T18:11:04Z")

</div>

No problem! Always glad to be able to help :merry:

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 6:15pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/35 "2018-12-29T18:15:30Z")

</div>

Another quick question…  
If I remove the recipe aliases from my manifest, is there an easy way to edit them in SHED?  
(Like the way you suggested using the iconic tab of an entity).  
Writing the en.json is my worst!

---

<div class="post-metadata">

**Author:** ![DaniAngione](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/daniangione/32/63425_2.png) [@DaniAngione](https://discourse.stonehearth.net/u/DaniAngione)\
**Post date:** [December 29, 2018, 6:19pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/36 "2018-12-29T18:19:01Z")

</div>

Only if their crafter is a declared job in the manifest. For example, your Guildmaster recipes will always show on shed as sub-items of your Guildmaster job, even if you remove them from the manifest.

Recipes that were added to other professions, however, won’t. Editing things in SHED is really easier, so just remove the Guildmaster recipes (which should make up most of the mod recipes anyway) since they’ll remain in SHED nonetheless and only leave the recipes that belongs to other professions, so it is easy to edit 🙂

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 29, 2018, 9:17pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/37 "2018-12-29T21:17:18Z")

</div>

Here’s the updated .smod . Still no new models.

[weapons\_plus.smod](https://discourse.stonehearth.net/uploads/short-url/z8Es2f1f5eDSboX4VDd4rfjezfc.smod) (1.1 MB)

But… I don’t need drop box anymore!  
Thanks to your suggestion the unzipped mod went from 406 mb to 3.14 mb after cleaning!  
Now a few days of design and modelling to fill up the recipes!

On a completely related subject, you know how when you get a buff your stats turn green? Can you do that with the description of an item? (for example **Speed +20** in green (Like some other games use .)) To emphasize that it is a “magical” item?

Thank you for all your help today!  
-TacocaT

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 30, 2018, 5:41pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/38 "2018-12-30T17:41:57Z")

</div>

So i have made a couple of weapons and am trying to make some dual wield weapons now. The problem I am having is when I put

```auto
"slot": "mainhand",
"slot": "offhand"

```

They still have a shield also, which is not the effect I was going for.  
So I looked at the shield.json and saw it is

```auto
"slot": "leftArm"

```

So I added that into my weapon.json. Now they drop the shield but attach the weapon to the left arm and not the left hand.  
My question is how to tell it NOT to pick up a shield but also NOT attach a sword to your left forearm?

---

<div class="post-metadata">

**Author:** ![BrunoSupremo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/brunosupremo/32/54819_2.png) [@BrunoSupremo](https://discourse.stonehearth.net/u/BrunoSupremo)\
**Post date:** [December 30, 2018, 5:44pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/39 "2018-12-30T17:44:02Z")

</div>

Each slot can only have 1 item in it.  
When the game is reading your file, it will read only one of the “slot” fields. You can’t have two fields with the same name in a json file because the lua reading it only sees one.

---

<div class="post-metadata">

**Author:** ![tacocat](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/tacocat/32/64697_2.png) [@tacocat](https://discourse.stonehearth.net/u/tacocat)\
**Post date:** [December 30, 2018, 5:46pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/40 "2018-12-30T17:46:25Z")

</div>

So if I want them to carry 2 daggers I need to make a recipe/entity for dagger.json and dagger\_offhand.json (for example, and with all the dependant files) then declare dagger.json “mainhand” and dagger\_offhand.json “offhand”?

---

<div class="post-metadata">

**Author:** ![DaniAngione](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/daniangione/32/63425_2.png) [@DaniAngione](https://discourse.stonehearth.net/u/DaniAngione)\
**Post date:** [December 30, 2018, 5:47pm UTC](https://discourse.stonehearth.net/t/custom-crafting-class/38934/41 "2018-12-30T17:47:24Z")

</div>

Yes, this is something we dealed with in ACE by standarizing all offhand items to the offhand slot. We made it in a way that is retro-compatible with shields from other mods, but if you want to make an off-hand weapon that is compatible with SH shield system without having to come up with a lot of new things, make your off-hand weapon “offhand” slot but also add to it the “added equipment” for the offhand placeholder like shields and two handed weapons do, like this:

```
"stonehearth:equipment_piece": {
         "slot": "offhand",
         "additional_equipment": {
            "stonehearth:armor:offhand_placeholder": true
         }

```

That way the weapon will be equipped in the offhand and no shield will be able to be equipped with it 🙂  
The only issue is that without altering the equipment preferences, footmen will be crazy equipping shields and then offhand weapons back and forth since they’re two different slots.

So you need to add proper support for offhand weapons by making units choose either shields or them - or just use ACE’s support 🙂

[Previous page](https://discourse.stonehearth.net/t/custom-crafting-class/38934.md?page=1)

[Next page](https://discourse.stonehearth.net/t/custom-crafting-class/38934.md?page=3)
