(probably caused by mods) Recipe is not showing the required class for the item

So I made a new item, and it requires a specific role that only one (modded) class has it. When trying to craft the item, while hovering the requirements, only the level is registered, not the class. It is missing the class name and icon. The item works as expected though (only that class wears it)


Assuming the modded class was enabled when you took the screenshot, does this item show the class icon in the unit frame when you select it as iconic?

I tried to repro for the fisher job but the icon was shown :woman_shrugging:
Does anything appear if you try to inspect it with CEF?

The class was enabled and there was someone promoted to that. In the unit frame it is the same problem.

Checking in CEF and (at least for me) it didn’t helped much, no console errors and the DOM was like this:

It must be because it’s for the workers. I was able to show the icon for equipment for the fisher without problems.

I wonder if it’s related to the way the job is set up. I remember Wouter_Sikkema also having issues when inheriting jobs from the base ones (I don’t like how hardcoded is the worker job, but it doesn’t seem trivial to fix :disappointed_relieved:).

Can’t think of an easy workaround for this, perhaps you can mention that they’re for the goblin workers in the recipe description or something in the meantime.

It is not for workers, it is a common combat class. :thinking:

The roles for the fern helmet is only the goblin_worker_job.

In fact I just checked, adding the role worker_job to it makes the icon appear. It is some issue with the stonehearth worker being so hardcoded.

yeah i had to overwrite multiple places to get it -sort of- in a state of playabillity XD you guys pput some odd, odd locks on the worker. :stuck_out_tongue:

Any update on this? I really can’t find anything wrong in the game or in the mod…
For example, when the item has the footman role, it works fine:
screenshot%202018_10_08__22_39_58 screenshot%202018_10_08__22_44_22

When I use the combat role, it shows all combat classes, except mine (even my class also having combat as a role):
screenshot%202018_10_08__22_54_10 screenshot%202018_10_08__22_58_49

But if I add the job to the default job index. It works…
But I can’t do that, the kingdom has its own job index, and it can’t add the job to the default index, as it is not supposed to appear to asc, rayya or na.

I think I found the place where it retrieves the jobs. It’s in jobs service, there’s a hardcoded ‘stonehearth:jobs:index’. The js files seem to compare roles against the jobs taken from there.

Not sure how to fix this… Probably reading the job index from the current population? :disappointed_relieved:

What if the recipe is for a job from a different, not enabled mod? If we restrict it to only 1 job index the icon/description will still be missing.

bruno, does your class replace one of the existing ones? as in, by design, not yet by code?
or is it a case of “they have all the basic ones, AND this one?”

Wouter, it is a completely new job index (no carpenter, mason, footman, etc…), only the worker is a replacement, just to change the outfit and a few other details.

@Relyss Thanks. I completely missed that. I think I can do a quick conditional patch for it.

In that case why don’t you high jack the old classes and just replace - everything–inside?
That way you can still load in the original index and thus have this stuff work?

Because it risks someone adding another class to the list and ending up in my kingdom, or removing one class that I’m using and erasing it from my kingdom. It also risks someone modding those I’m using and affecting mine.
Also, why do that if the game offers a way for your kingdom to have your own index. :slight_smile:
The problem is solved now. In case it wasn’t, I would simple mod the crafting menu and hardcode it into that (I have to customize it anyway). The ui is client side so it would not affect other kingdoms.

1 Like