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)
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 ).
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.
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:
When I use the combat role, it shows all combat classes, except mine (even my class also having combat as a role):
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?
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.
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.