Skip to content

Configuration

Every option of Cuxial Diseases explained: config, the disease catalog, how to add a disease and pregnancy.

Everything you can adjust lives in three files: shared/config.lua for behaviour, data/diseases.lua for the disease catalog and data/pregnancy.lua for pregnancy. Restart the resource after any change.

Stage, treatment, vaccine and immunity times are real hours and keep counting while the player is offline. Symptom intervals are minutes of play: they only count while the player is connected.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints traces to the console. Also enabled by setting the convar cuxial_diseases_debug to 1.

Proximity contagion · proximity ​

Only affects diseases that have contagion.proximity in the catalog.

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue lets sick players infect whoever is near. false disables proximity contagion completely.
tickSecondsnumber30Seconds between contagion checks.
maskItemstring | nil'face_mask'Item that protects whoever carries it in the inventory. nil = nothing protects.
maskProtectionnumber85Percentage of the risk removed by the mask, from 0 to 100.
indoorMultipliernumber1.5Multiplier of the risk when the exposed player is inside an interior.

Symptoms · symptoms ​

OptionTypeDefaultWhat it does
enabledbooleantruetrue makes players feel the symptoms. false keeps diseases, stages and treatments, with no effect in game, health loss included.
skipWhenDeadbooleantruetrue pauses symptoms while the player is dead or unconscious. false keeps them going.
soundsbooleantruetrue plays a voice groan with cough and vomiting. false = silent.

Collapse · collapse ​

OptionTypeDefaultWhat it does
graceMinutesnumber15Minutes of margin given to a player who logs in with a collapse already overdue, so they can look for medical care first.

Schedules · cron ​

Cron format: minute, hour, day, month, day of the week.

OptionTypeDefaultWhat it does
progressionstring'*/5 * * * *'Stage changes, treatments running out and broken dose routines.
pregnancystring'*/5 * * * *'Pregnancy months, start of labour and automatic birth.
onboardingstring'*/5 * * * *'Expired vaccination deadlines and the last reminder.
cleanupstring'0 4 * * *'Deletes old cured cases, expired immunities and old log entries.

Retention · retention ​

OptionTypeDefaultWhat it does
curedCasesDaysnumber90Days that cured cases and their log are kept.

Immunity · immunity ​

OptionTypeDefaultWhat it does
defaultHoursnumber24Hours of immunity after being cured, for diseases that do not set cure.immunityHours. 0 = no immunity.

Vaccination deadline · onboarding ​

With enabled = true, each character gets a deadline to be vaccinated against one disease. When it expires without a vaccine, they catch it.

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue applies the deadline. false = no deadline.
hoursnumber24Hours given to characters created after the script was installed.
applyToExistingbooleanfalsetrue also gives a deadline to characters that already existed. false leaves them exempt.
hoursExistingnumber72Hours given to characters that already existed, counted from their first login.
diseasestringexample idDisease caught when the deadline expires. An id from data/diseases.lua. If the id does not exist, the deadline is disabled.
vaccineItemstringexample itemVaccine item shown to the player in the Health app.
reminderHoursBeforenumber2Hours before the deadline at which the last reminder is sent.

How it behaves:

  • On first start the script stores the highest character id of your server. Characters above it count as new; the rest count as existing.
  • The player is told the deadline when it is created and reminded at every login.
  • Any vaccine for disease fulfils the deadline. A character who is already immune or already sick is exempt.
  • If the deadline expires while the player is offline, they are infected anyway and the stage starts counting at their next login.

Diagnosis · diagnosis ​

OptionTypeDefaultWhat it does
revealToPatientbooleanfalsefalse hides the name of the disease from the patient until it is diagnosed; they only feel the symptoms. true shows it from the start.

A case becomes diagnosed with a positive test, from the MDT of Cuxial Police, with /disease diagnose or with the Diagnose export.

Staff · admin ​

OptionTypeDefaultWhat it does
permissionstring'admin'Framework permission checked through cuxial_bridge when a command is used.
restrictedstring'group.admin'ACE group that the commands /disease and /pregnancy are limited to.

Phone app · app ​

Only used when lb-phone is running.

OptionTypeDefaultWhat it does
enabledbooleantruetrue registers the app on the phone. false = no app.
identifierstring'cuxial-salud'Internal identifier of the app.
namestringtextName shown on the phone.
descriptionstringtextDescription in the app store.
developerstringtextDeveloper shown in the app store.
defaultAppbooleanfalsetrue = installed on every phone. false = players download it from the app store.
categoriesstring[]{ 'Lifestyle' }Categories in the app store.

The disease catalog · data/diseases.lua ​

The file returns a table where each key is the id of a disease. The script knows no disease by name: everything comes from this file. The included diseases are a starting point to edit, replace or delete.

Names, stage labels and descriptions are free text in this file. Write them in the language of your server.

Disease ​

FieldTypeWhat it does
labelstringName of the disease.
categorystringGroup used for display, such as 'respiratory' or 'digestive'.
iconstringFont Awesome icon, with the fa- prefix.
colorstring (hex)Colour of the disease in the interfaces.
descriptionstringText for the doctor.
contagiontableHow it is caught. See below.
incubationHoursnumberHours after infection during which a test can come back inconclusive. 0 = detected from the first moment.
stageslistStages in order. Required, at least one.
testtable{ item, inconclusiveChance, external }. Optional.
vaccinetable{ item, immunityHours } or { item, permanent = true }. Optional.
treatmenttableDoses that control the disease. Optional.
curetable{ steps, immunityHours }. Cure plan applied by a doctor. Optional.

contagion ​

FieldWhat it does
proximity = { radius, chance, stages }Caught by being near a sick player. radius in metres, chance as a percentage per check, stages is the list of stage ids that are contagious. Needs proximity.enabled = true in the config.
sexual = { chance, condomProtection }Caught in an encounter between two characters, through the RollContagion export. Both are percentages.
manual = trueOnly caught through an export, a command or the vaccination deadline.

stages ​

FieldTypeWhat it does
idstringIdentifier of the stage. Unique inside the disease.
labelstringName of the stage.
severitystring'mild', 'moderate', 'severe' or 'critical'.
durationHoursnumberReal hours until the next stage. Without it, the stage does not advance.
lethalbooleantrue = lethal stage. See Lethal stages.
lethalAfterHoursnumberHours between collapses in a last stage that is lethal. 6 when omitted.
symptomstableSymptoms of the stage. {} = none.

symptoms ​

min and max are the minutes between two episodes; each interval is picked at random between them.

SymptomShapeEffect
cough{ min, max }Cough animation with voice. Not played inside a vehicle.
dizziness{ min, max }Stumble and a short screen distortion. Not played inside a vehicle.
vomit{ min, max }Vomiting animation with voice. Not played inside a vehicle.
fatigue{ min, max }Out of breath animation. Does not change the movement speed. Not played inside a vehicle.
blur{ min, max }Blurred vision for 2.5 seconds.
shake{ min, max }Camera shake for 2.5 seconds.
healthDrain{ min, max, minDamage, maxDamage }Removes between minDamage and maxDamage health points. Never kills on its own: health stops at the minimum.

A symptom that cannot play because the player is in a vehicle or in the middle of another animation is tried again 30 to 60 seconds later.

test ​

FieldTypeWhat it does
itemstringItem that tests for this disease. One item can test several diseases at once.
inconclusiveChancenumberPercentage of inconclusive results. Only applies during incubationHours.
externalbooleantrue = the item is handled by another resource and this script does not register it.

A positive result marks the case as diagnosed.

vaccine ​

FieldTypeWhat it does
itemstringVaccine item.
immunityHoursnumberHours of immunity. 168 when omitted.
permanentbooleantrue = immune for good.

A vaccine has no effect on a character who already has that disease.

treatment ​

FieldTypeWhat it does
itemstringItem of one dose.
effectHoursnumberHours that one dose lasts. 6 when omitted.
preventsProgressionbooleantrue = while a dose is active the stage does not advance; each dose pushes the stage deadline back by the time it covers.
suppressSymptomsbooleantrue = no symptoms while a dose is active.
reducesSymptomsnumber | booleanWith a dose active, cough and vomiting appear that fraction of the time (0.5 = half as often) and every other symptom stops. 0.33 when omitted. false = symptoms are not reduced.
minIntervalHoursnumberMinimum hours between two doses. Without it, the next dose is only accepted when the previous one has run out.
curesAfterDosesnumberDoses that cure the disease. Without it the disease is chronic: it is controlled, never cured by doses.
resetAfterHoursnumberHours since the last dose after which the routine counts as broken and the dose count goes back to zero. Twice effectHours when omitted. 0 = never. Only with curesAfterDoses.
box = { item, count }tableA box item that gives count units of item when opened. count is 7 when omitted.

cure ​

A plan of steps that a doctor completes one by one. The last step cures the patient.

FieldTypeWhat it does
steps[n].idstringIdentifier of the step.
steps[n].labelstringName of the step.
steps[n].kindstring'item', 'procedure' or 'appointment'. An 'item' step also counts as one dose of the treatment.
steps[n].itemstringItem spent by the step. It is removed by the resource that applies the step.
steps[n].hoursnumberReal hours to wait before this step, counted from the previous step, or from the diagnosis for the first one.
steps[n].minigamestringMinigame used by EMS to apply the step in Cuxial Police, for example 'injection'. Without it, the step is completed from the patient file or the appointment.
steps[n].difficultynumberDifficulty of the minigame: 1 easy, 2 normal, 3 hard.
immunityHoursnumberHours of immunity when cured. immunity.defaultHours when omitted, 0 = none. It never shortens a longer or permanent immunity.

The cure plan is applied from the MDT of Cuxial Police, or from your own resource with the AdvanceCureStep export. Diseases with treatment.curesAfterDoses are also cured by taking the doses.

Lethal stages ​

A stage with lethal = true can make the patient collapse in two ways:

  • By health. When healthDrain leaves the patient at minimum health, they collapse. At most once every five minutes.
  • By time. Only in the last stage of the disease. Every lethalAfterHours without an active treatment, the patient collapses if they are online.

A collapse knocks the patient down through cuxial_medical. Without that resource the script only sends the collapse event, for you to handle from your own ambulance script. See Exports & events.

Add your own disease ​

Add the entry ​

Open data/diseases.lua and add a new key inside the returned table. The key is the id: one word without spaces, 40 characters at most.

data/diseases.lua
lua
bronchitis = {
    label = 'Bronchitis',
    category = 'respiratory',
    icon = 'fa-lungs',
    color = '#38bdf8',
    description = 'Inflammation of the airways. Syrup every eight hours and a review.',
    contagion = {
        proximity = { radius = 2.5, chance = 3, stages = { 'acute' } },
    },
    incubationHours = 3,
    stages = {
        { id = 'early', label = 'Early', severity = 'mild', durationHours = 6, symptoms = {} },
        {
            id = 'acute',
            label = 'Acute',
            severity = 'moderate',
            durationHours = 36,
            symptoms = {
                cough = { min = 4, max = 9 },
                fatigue = { min = 5, max = 10 },
            },
        },
        {
            id = 'chronic',
            label = 'Chronic',
            severity = 'severe',
            symptoms = {
                cough = { min = 2, max = 5 },
                healthDrain = { min = 10, max = 20, minDamage = 1, maxDamage = 2 },
            },
        },
    },
    test = { item = 'rapid_test', inconclusiveChance = 25 },
    treatment = {
        item = 'bronchitis_syrup',
        effectHours = 8,
        preventsProgression = true,
        reducesSymptoms = 0.5,
        curesAfterDoses = 4,
    },
    cure = {
        steps = {
            { id = 'nebulizer', label = 'Nebulizer session', kind = 'procedure' },
            { id = 'review', label = 'Review', kind = 'appointment', hours = 24 },
        },
        immunityHours = 48,
    },
},

This disease spreads by proximity during its acute stage, shows up on the rapid test, is controlled with a syrup and is cured after four doses. The last stage has no durationHours, so it stays there until treated.

Create its items ​

Every new item named in the entry needs a definition in your inventory. Here only the syrup is new:

ox_inventory/data/items.lua
lua
['bronchitis_syrup'] = {
    label = 'Bronchitis syrup',
    weight = 100,
    stack = true,
    close = true,
    description = 'One dose every eight hours.',
    server = {
        export = 'cuxial_diseases.bronchitis_syrup',
    },
},

Restart and test ​

Restart the server so the inventory loads the new item. Check the new disease with the staff commands:

text
/disease list
/disease infect <id> bronchitis
/disease stage <id> bronchitis acute
/disease status <id>

Do not rename or delete the id of a disease that players already have. Their cases stay in the database but stop being processed.

Common changes ​

Turn on proximity contagion

lua
proximity = {
    enabled = true,
    -- ...
},

Let the patient see what they have without a diagnosis

lua
diagnosis = {
    revealToPatient = true,
},

Make a disease slower. Raise durationHours in each stage of data/diseases.lua.

Make a disease chronic. Remove curesAfterDoses from its treatment.

Diseases without effects in game. Set symptoms.enabled = false.

Pregnancy · data/pregnancy.lua ​

Pregnancy is followed like one more medical state. Conception is decided by another resource through the exports, or by staff with /pregnancy.

Presentation and time ​

OptionTypeDefaultWhat it does
label, icon, colorstringtext, 'fa-baby', configurableHow the pregnancy appears in the interfaces.
time.daysPerMonthnumber3Real days that one month of pregnancy lasts.
time.monthsnumber9Months until birth.

Fertility · fertility ​

Used by the RollPregnancy export.

OptionTypeDefaultWhat it does
baseChancenumber5Base percentage per unprotected encounter.
fertileMultipliernumber3.0Multiplier inside the fertile window.
cycleLengthnumber28Days of the cycle.
fertileWindowStart, fertileWindowEndnumber12, 16First and last day of the fertile window.
frequencyBonusnumber0.1Increase per recent encounter (0.1 = +10 %).
frequencyMultMaxnumber1.5Highest multiplier that recent encounters can reach.
recentCooldownHoursnumber1Hours since the last encounter below which the chance is reduced.
recentReductionnumber0.5Multiplier applied in that case.
maxChancenumber60Highest percentage after everything is applied.

Test · test ​

OptionTypeDefaultWhat it does
falsePositiveChancenumber8Percentage of false positives when there is no pregnancy.
minHoursToDetectnumber12Hours since conception from which the test detects it.

Belly · belly ​

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue swaps a clothing piece for a belly as the months go by and restores it after birth. false = no clothing change.
componentnumber11Clothing component replaced: 11 torso, 8 undershirt, 3 arms.
modelsstring[]{ 'mp_f_freemode_01' }Character models it applies to.
stageslistfour entries{ fromMonth, drawable, texture }: clothing piece used from that month on.

Before setting belly.enabled = true, put the belly clothing of your server in the drawable and texture values of belly.stages.

Months · months ​

One entry per month, from [1] to [9].

FieldTypeWhat it does
labelstringName of the month.
symptomstableSymptoms of the month, same shape as in the diseases.
messagestringNotice sent to the mother when the month starts. A locale key or a literal text.
checkupbooleantrue = schedules a check-up appointment that month. Needs Cuxial Police and a pregnancy already known.

Check-ups · checkups ​

Only with Cuxial Police running.

OptionTypeDefaultWhat it does
enabledbooleantruetrue creates the appointments automatically. false = the doctor books them by hand.
kind, subtypestringtextType and subtype of the appointment in the MDT agenda.
hoursAfterMonthStartnumber6Hours after the month change at which the appointment is set.
durationMinnumber20Length of the appointment in minutes.

Labour · labor ​

OptionTypeDefaultWhat it does
enabledbooleantruetrue = when the date arrives, contractions start. false = the baby is born on its own on the due date.
durationMinnumber30Minutes to be attended before the birth happens outside the hospital.
contractionsEverytable{ min = 2, max = 4 }Minutes between contractions.
contractionSecondsnumber4Seconds that each contraction lasts.
notifyFatherbooleantruetrue also notifies the father. false = only the mother.
alertEmsbooleantruetrue sends an alert to EMS when labour starts. Needs Cuxial Police.
appointmentbooleantruetrue creates the birth appointment in the agenda. Needs Cuxial Police and a pregnancy already known.

Labour only starts while the mother is connected.

© Cuxial