Kartik Scripts

Adding Content

The script is built so you can add your own medical content without writing any code. Everything below is a config entry.

🦠 Adding a disease

Add an entry to Config.Diseases:

radiation_sickness = {
    label = 'Radiation Sickness',
    tokens = { 'toxic', 'systemic' },

    stages = {
        { duration = 600,  symptoms = { 'nausea', 'fatigue' } },
        { duration = 1800, symptoms = { 'nausea', 'health_loss', 'high_fever' } },
        { duration = 0,    symptoms = { 'health_loss', 'confusion', 'passing_out' } },
    },

    recoverNaturally = false,
    fieldDiagnosis = { 'thermometer', 'bp_cuff' },
    confirm = 'bloodtest',
    treatment = { tokens = { 'bacterial' }, doses = 3, recovery = 900 },
},
Field
tokensCategories it belongs to
stagesEach with a duration and a symptom list. duration = 0 means it stays at this stage forever
recoverNaturallySeconds after the last stage until it clears, or false
fieldDiagnosisTools that make it suspected
confirmWhich hospital test confirms it, or false for field diagnosis only
treatment.tokensAny medication whose treats list contains one of these counts as a dose
treatment.dosesHow many doses cure it
treatment.recoverySeconds of recovery after the final dose

Optional:

contagious = { radius, chance }It spreads
randomChancePercentage per random roll
chronic = trueNever cured, only controlled, with courseHours and flareEvery
complicationOf / complicationChanceDevelops out of another disease
environmental = trueOnly given by the environment system
overdose = true / collapseAfterBehaves like an overdose

Symptoms are composed from Config.Symptoms, and the doses system reads existing medications. No code is needed, the disease appears in diagnosis, the tablet, records and the AI callout pool automatically.


😷 Adding a symptom

Add to Config.Symptoms:

hallucination = {
    label = 'Hallucinations',
    effect = 'blur',
    interval = { 40, 90 },
    strength = 0.7,
    duration = 10,
    vitals = { hr = 15 },
},

Available effects:

cough · sneeze · vomit · faint · blur · shake · stamina · health · clutch · drunk · heartbeat · sweat · none

vitals shifts the patient's readings so a medic can actually detect it. signs sets what tools report, for example signs = { lungs = 'wheezing' }.


💊 Adding a medication

Add to Config.Medications:

ketamine = {
    label = 'Ketamine', item = 'ketamine', route = 'IV',
    duration = 240, class = 'sedative', anim = 'inject',
    effects = { pain = -70, hr = 10 },
    sedate = 120,
    fee = 220,
},
Field
routeIV, Oral, Nasal, SubQ, Inhaled, External
classUsed by reverse and addiction relief
effectspain, hr, sys, rr, spo2, temp, glucose, blood
treatsDisease tokens it counts as a dose for
sedateSeconds unconscious
reverseClasses it cancels, how naloxone works
addiction / overdoseSee Addictions
prescription / dosagesMakes it prescribable
selfUsePatients can use it on themselves
consume = falseNot used up
propA visible prop on the patient

Running Lua

Any medication can execute code:

blood_drip = {
    label = 'Blood Drip', item = 'blood_bag', route = 'IV',
    duration = 60, class = 'fluid', anim = 'iv', prop = 'iv',
    tickInterval = 2,
    onUse    = function(ctx) ctx.notify('drip_started') end,
    onTick   = function(ctx) ctx.addBlood(15) end,
    onFinish = function(ctx) ctx.notify('drip_finished') end,
},

ctx gives you source, key, patient, medication, doses, remaining, addBlood(ml), addPain(n) and notify(localeKey, kind, ...).


🩹 Adding a treatment

Add to Config.Treatments:

chest_seal = {
    label = 'Chest Seal', item = 'chest_seal',
    target = 'zone', duration = 6000, anim = 'bandage',
    zones = { 'chest' },
    condition = 'wound',
    requires = { bleedingControlled = true },
    effects = { wound = 'close', pain = -10 },
    prop = 'bandage', fee = 200,
},
Field
targetzone (a body part) or body (the whole patient)
zonesRestrict it to specific body parts
conditionWhich injury it applies to, or any
requiresbleedingControlled, minWound, known, location = 'hospital', grade
effectsbleedControl, wound, infection, fracture, burn, bruise, pain, tourniquet
feeAdded to the patient's bill
selfUsePatients can apply it themselves
healDirect health restore, amount, duration, stopBleedingChance, maxBleeding, clearStunChance

💥 Adding a damage type

Add to Config.DamageClasses, then map weapons to it:

Config.DamageClasses.acid = {
    label = 'Chemical Burn',
    burn = { chance = 100, min = 2, max = 3 },
    wound = { chance = 60, min = 1, max = 2, type = 'chemical' },
    pain = 40,
    infectionRisk = 2,
}

Config.Weapons.WEAPON_ACID = 'acid'

Each injury type takes chance, min, max, and optionally heavy (damage that adds +1 severity), zones (restrict it to body parts), open (chance a fracture is open) and limbsOnly.


🚑 Adding an AI callout

Add to Config.AIPatients.complaints:

{
    id = 'overdose_alley',
    label = 'Possible Overdose',
    dispatch = 'Caller found someone slumped in an alley, barely breathing.',
    posture = 'unconscious',
    diseases = { 'opioid_overdose' },
    weight = 4,
    transport = 'required',
},

Postures: sit · lie · writhe · stand · unconscious · seizure Transport: 'required' · 'optional' · false

Add locations as vec4 entries in Config.AIPatients.locations, the Z is snapped to the ground automatically.


📄 Adding a report template

Do this in game, EMS tablet → Report templates, or /emsadmin → Templates. See Reports & Templates.


🏥 Adding a hospital

Do this in game, /emsadmin → World → Hospitals. See Hospital Creator.

On this page