Gameplay content

Qualifications

Certificates, licences and courses a person holds, declared by mods and recognised by any job or mod.

When your mod teaches or certifies something, declare it as a qualification: then any job, course or other mod can ask whether a person holds it, instead of each mod reading another's private variables.

Declaring them

Qualifications/*.ulqual in your mod returns a list:

lua-- ynl_Nightlife/Qualifications/nightlife.ulqual
return {
    { id = "door_licence", name = "Door supervisor licence", issuer = "City licensing office", level = "1" },
    { id = "senior_door", name = "Senior door supervisor", issuer = "City licensing office", level = "2",
      requires = { "door_licence" } },                -- another mod's: "ul_Education/certificate_1"
}

The full id is your mod's folder name and the id: "ynl_Nightlife/door_licence". Ids in requires without a / are yours.

Awarding and checking

lualocal r = Qualifications:award("ynl_Nightlife", "door_licence")          -- the player
Qualifications:award("ynl_Nightlife", "door_licence", bouncer)             -- or anyone known

if Qualifications:has("ynl_Nightlife/door_licence") then ... end
local why = Qualifications:eligible("ynl_Nightlife/senior_door")            -- nil, or "Requires Door supervisor licence."
  • Only your mod awards its own qualifications; awarding one twice returns repeated = true and changes nothing.
  • An award grants nothing else: give the skill points and record the life-history line yourself, once, where the person passes.
  • What a person holds is saved, with the date, the issuer and the level. It stays held if your mod is turned off.
  • University enrolment, majors and tuition (moveSchools, setMajor) are separate and unchanged.
  • Events:on(mod, "qualificationGained", function(id, personId) end) runs when one is awarded.
  • A qualification can be a node of the knowledge tree: a node with "qualification": "<mod>/<id>" scores 100 while the qualification is held and 0 otherwise, so jobs and actions can ask for it there.

Moving your own flags in

If an earlier version kept certificates in variables, award each once with migrate = true (the fifth argument): it is marked as migrated, prerequisites are not checked again, and no event fires. See ul_Education's E.migrate.

Call Does
Qualifications:award(mod, id [, person [, level [, migrate]]]) Awards; { ok, repeated, reason }.
Qualifications:has(id [, person]) { id, name, acquired, issuer, level, migrated } or nil.
Qualifications:of([person]) Everything they hold.
Qualifications:eligible(id [, person]) nil, or what is missing.
Qualifications:get(id), Qualifications:catalogue() Definitions from the enabled mods.
Qualifications:version() The API version, 1.