Kartik Scripts

Identity & Dialogue

NPC identity, config_identity.lua

Every NPC and vehicle gets a random identity the first time it matters. All chances are in %.

Config.Identity = {
    age = { min = 18, max = 78 },

    licenseOdds   = { valid = 82, suspended = 6, expired = 7, none = 5 }, -- driver's licence (must add up to 100)
    extraLicenses = { bike = 25, truck = 8, boat = 6, pilot = 2 },

    flags = {
        wanted    = 4, -- active warrant (also created in the MDT)
        armed     = 2, -- armed & dangerous
        probation = 3,
        gang      = 2,
    },

    situation = { drunk = 5, drugs = 4 },

    vehicle = {
        registrationValid = 90,
        insuranceValid    = 88,
        stolen            = 2,
        bolo              = 1,
        ownerIsDriver     = 72,
    },

    warrantReasons = { 'Failure to appear', 'Outstanding traffic fines', ... },
    nationalities  = { ... },
    cities         = { ... },
    streets        = { ... },
    firstNames     = { male = { ... }, female = { ... } },
    lastNames      = { ... },
}

Raise flags.wanted for a busier server, or rename the cities and streets to match your map.

Questioning, config_dialogue.lua

Config.Dialogue = {
    honesty = { base = 60, drunk = 80, wanted = 25 }, -- % an NPC tells the truth about incriminating facts
    questions = { ... },
    answers   = { ... },
}

Each question decides who it is shown for:

{ id = 'warrants', label = 'Any warrants I should know about?', icon = 'shield',
  roles = { 'suspect', 'civilian' }, services = { 'police' } },
FieldValues
rolessuspect, victim, civilian, patient
contextsfoot, vehicle
servicesService ids that can ask it
sceneOnly on scenes of this kind (e.g. 'suspect')

answers holds the lines per question and role. The deny pools are the lies an NPC tells when they decide not to be honest.

Negotiation

Used by the Barricaded Suspect and Overdose (hostile friend) callouts. Trust starts at a random value in start. The person complies at success and gives up at fail.

Config.Negotiation = {
    barricade = {
        start = { 25, 45 }, success = 80, fail = 0,
        options = {
            { id = 'listen', label = 'Talk to me. What happened today?', icon = 'message-circle', delta = { 8, 16 } },
            { id = 'threat', label = 'Drop it now or we come in!', icon = 'siren', tone = 'danger', delta = { -30, -12 }, uses = 1 },
            -- ...
        },
        replies = { low = { ... }, mid = { ... }, high = { ... } },
    },
    friend = { ... },
}
FieldMeaning
deltaTrust change { min, max } when the line is said
usesHow often a line can be said (default 2). Repeats work half as well
tone = 'danger'Shown in red, as a risky option
repliesWhat they say back at low, mid and high trust

On this page