Promotion error with Custom Job

I am attempting to create my own custom job to familiarize myself with the modding basics. I have already played around with items and recipes (which I have used to make a talisman for the new Job).

I have not managed to trace back the below errors. I suspect that they all stem from a single root cause, but cannot figure out what that might be.
Error 1 and 2 are thrown on game load (loading the world, not game start), and Error 3 is thrown only when attempting to promote to my custom job.

As a new user I cannot upload an attachment, so I have attached a drive link to the log:

So here is my question: Where are these errors coming from? and if you are able to explain, how did you come to this conclusion?
Thank you all in advance!!!

Error 1:
2022-12-07 15:40:57.155988 | server | 1 | lua.code | generating traceback…
2022-12-07 15:40:57.155988 | server | 0 | lua.code | – Script Error (lua) Begin -------------------------------
2022-12-07 15:40:57.155988 | server | 0 | lua.code | …nehearth/services/server/job/job_info_controller.lua:368: attempt to index a nil value
2022-12-07 15:40:57.155988 | server | 0 | lua.code | stack traceback:
2022-12-07 15:40:57.155988 | server | 0 | lua.code | [C]: ?
2022-12-07 15:40:57.155988 | server | 0 | lua.code | …nehearth/services/server/job/job_info_controller.lua:368: in function ‘_ace_old__evaluate_highest_level’
2022-12-07 15:40:57.155988 | server | 0 | lua.code | …earth_ace/monkey_patches/ace_job_info_controller.lua:263: in function ‘_evaluate_highest_level’
2022-12-07 15:40:57.155988 | server | 0 | lua.code | …nehearth/services/server/job/job_info_controller.lua:125: in function <…nehearth/services/server/job/job_info_controller.lua:77>
2022-12-07 15:40:57.155988 | server | 0 | lua.code | – Lua Error End -------------------------------

Error 2:
2022-12-07 15:40:57.155988 | server | 0 | lua.code | – Lua Error End -------------------------------
2022-12-07 15:40:57.155988 | server | 1 | lua.code | generating traceback…
2022-12-07 15:40:57.155988 | server | 0 | lua.code | – Script Error (native) Begin -------------------------------
2022-12-07 15:40:57.155988 | server | 0 | lua.code | c++ exception: lua runtime error
2022-12-07 15:40:57.155988 | server | 0 | lua.code | stack traceback:
2022-12-07 15:40:57.155988 | server | 0 | lua.code | – Lua Error End -------------------------------

Error 3:
2022-12-07 15:45:11.123226 | server | 1 | lua.code | generating traceback…
2022-12-07 15:45:11.123226 | server | 0 | lua.code | – Script Error (native) Begin -------------------------------
2022-12-07 15:45:11.123226 | server | 0 | lua.code | c++ exception: Error in CompileScript calling “hearth_adept/jobs/hearth_adept/hearth_adept.lua”: radiant/lib/util.lua:476: bad argument #1 to ‘pairs’ (table expected, got nil)
2022-12-07 15:45:11.123226 | server | 0 | lua.code | stack traceback:
2022-12-07 15:45:11.123226 | server | 0 | lua.code | – Lua Error End -------------------------------

Looks like your job might be missing a controller (.lua file), have you created a controller for it?

I’ve even double checked to make sure my manifest is pointing to the right one.
At the moment it’s just a cleric.lua file that I’ve copied and renamed a few variables in…
But if that’s not the issue, then yes. I have a file, and the manifest is pointing to it:

“controllers” : {
“class:hearth_adept”: “file(jobs/hearth_adept/hearth_adept.lua)”
}

did you just copy it without any changes other than the name of the class?

If so, you gotta change something, this line in the beginning:
local CombatJob = require 'jobs.combat_job'

to

local CombatJob = require 'stonehearth.jobs.combat_job'

since it’s not in the stonehearth mod itself anymore, it needs to reference the whole path

1 Like

I had in fact not done this, but errors 1 and 2 remain the same, with error 3 now reading slightly different:

2022-12-08 10:44:11.824175 | server | 0 | lua.code | – Script Error (native) Begin -------------------------------
2022-12-08 10:44:11.824175 | server | 0 | lua.code | c++ exception: Error in CompileScript calling “hearth_adept/jobs/hearth_adept/hearth_adept.lua”: std::logic_error: ‘Error in CompileScript calling “hearth_adept/stonehearth/jobs/combat_job.lua”: radiant/lib/util.lua:476: bad argument #1 to ‘pairs’ (table expected, got nil)’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | stack traceback:
2022-12-08 10:44:11.824175 | server | 0 | lua.code | [C]: in function ‘create_controller’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/modules/commons.lua:280: in function ‘create_controller’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | stonehearth_ace/monkey_patches/ace_job_component.lua:279: in function ‘promote_to’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | …_ace/ai/actions/change_job_using_talisman_action.lua:71: in function ‘_trigger_cb’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/modules/effects/effect_tracks.lua:112: in function <radiant/modules/effects/effect_tracks.lua:107>
2022-12-08 10:44:11.824175 | server | 0 | lua.code | [C]: in function ‘fire’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/controllers/time_tracker_controller.lua:91: in function <radiant/controllers/time_tracker_controller.lua:91>
2022-12-08 10:44:11.824175 | server | 0 | lua.code | [C]: in function ‘xpcall’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/modules/commons.lua:67: in function ‘xpcall’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/controllers/time_tracker_controller.lua:91: in function ‘set_now’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/modules/gamestate.lua:11: in function ‘set_now’
2022-12-08 10:44:11.824175 | server | 0 | lua.code | radiant/server.lua:66: in function <radiant/server.lua:64>
2022-12-08 10:44:11.824175 | server | 0 | lua.code | – Lua Error End -------------------------------

Hmmm… it would be hard to diagnose without being able to see some of the files. If you’re willing, you could send them through a DM and I can take a look for you!

1 Like

Of course, I’ll send you a link to anything I think may be of use.

Thank you so much for your effort and knowledge!