Frostdev

KilnAPI reference Guide

creatureState (instance registry)

Generated from schema/registry/creatureState.json by tools/registrygen/registrygen.py: edit the schema, never this page.

One creature's, NPC's or player's live values on the server: health, attributes, god mode, kiln.creatures' per-entity values, its relations, and the actions that hurt, heal, kill, command or lease it. Server-owned (a joined client reads the game's own replicated values and sends requests). The old APIs (Combat, Attributes, CreatureRef) keep their signatures and write at once as before; the Gate journals those writes under the calling mod.

  • Key: entity (one value per entity); side: server; version 0.1.0, experimental (KILNX032)
  • Values are live: a write applies at the Gate's next turn (one-time, owned by the mod), a hold is re-applied at its cadence until released. Kiln.Gate: CreatureState.<Field>; refs: creatureState[<key>].<field>.
Field Type Holds Cadence Saved Notes
health int 0..1000000000 pin, min, max step world the game acts on it inside one step: a min hold does not prevent what the game did meanwhile; replicated by game; Health points now (the engine's integers; the HUD shows these). A write is the game's own attribute add, clamped to 0..healthMax; 0 kills at the next step without a killer. Invulnerability keeps it at 1 or more. A hold is re-applied after the step (holdLimit step): a hit to 0 kills, the hold never raises a dead entity's health and holds again once it lives.
healthMax int 0..1000000000 - - world read-only; The computed maximum health (level, gear, buffs).
dead bool - - world read-only; The game's dead state as its death check leaves it at the next step (health below 1: dead or dying). False without an Actor.
attributes.stamina int 0..1000000000 pin, min, max, range step world replicated by game; Stamina now (creatures and players). A write goes through the game's attribute code, clamped to the pair's minimum and maximum; the game replicates it.
attributes.mana int 0..1000000000 pin, min, max, range step world replicated by game; Mana now (players, and a few creatures). A write goes through the game's attribute code, clamped to the pair's minimum and maximum; the game replicates it.
attributes.bodyHeat int 0..1000000000 pin, min, max, range step world replicated by game; Body heat now (players). A write goes through the game's attribute code, clamped to the pair's minimum and maximum; the game replicates it.
attributes.oxygen int 0..1000000000 pin, min, max, range step world replicated by game; Oxygen now (players and most creatures). A write goes through the game's attribute code, clamped to the pair's minimum and maximum; the game replicates it.
invulnerable bool pin inline world Kiln's god mode: damage hits on it are dropped before they apply and other health losses are restored before the game's death check. A pin is enforced in kiln.combat's hit path (inline); with no Gate hold, Combat.SetInvulnerable's holders decide as before.
level int 1..10000 pin, min, max step world Its level (health follows through the game's own scaling). kiln.creatures' owner layers (the level of CreatureRef) stay the old stack beneath; Gate writes and holds are one Kiln layer above them.
faction enum (environment, hitAll, fogger, vukah, scavenger, wildlife, wildBeast, player, automatedPlayer, hitOthers, skeleton, playerAlly, farmAnimal, cyclops, drak, ancients) pin step world Its faction: who it fights and who fights it. A layer of kiln.creatures above every older mod's.
scale float 0.01..100 pin, min, max step world Its uniform scale (its model and its collision).
xpFactor float 0..1000 pin, min, max step world The factor on the XP of its kill (1 = the template's).
speedFactor float 0..100 pin, min, max step world The factor on all its movement speeds against the values before the first change (1 = unchanged).
damageFactor float 0..1000 pin, min, max step world The factor on the damage it deals (1 = as made).
resist.physical float 0..100 pin, min, max step world The share of physical damage as a whole it takes (1 = normal, 0 = immune, 2 = double).
resist.cut float 0..100 pin, min, max step world The share of cutting damage it takes (1 = normal, 0 = immune, 2 = double).
resist.pierce float 0..100 pin, min, max step world The share of piercing damage it takes (1 = normal, 0 = immune, 2 = double).
resist.blunt float 0..100 pin, min, max step world The share of blunt damage it takes (1 = normal, 0 = immune, 2 = double).
resist.wood float 0..100 pin, min, max step world The share of wood damage it takes (1 = normal, 0 = immune, 2 = double).
resist.stone float 0..100 pin, min, max step world The share of stone damage it takes (1 = normal, 0 = immune, 2 = double).
resist.metal float 0..100 pin, min, max step world The share of metal damage it takes (1 = normal, 0 = immune, 2 = double).
resist.poison float 0..100 pin, min, max step world The share of poison damage it takes (1 = normal, 0 = immune, 2 = double).
resist.explosion float 0..100 pin, min, max step world The share of explosion damage it takes (1 = normal, 0 = immune, 2 = double).
resist.skillShot float 0..100 pin, min, max step world The share of skill-shot damage it takes (1 = normal, 0 = immune, 2 = double).
resist.fire float 0..100 pin, min, max step world The share of fire damage it takes (1 = normal, 0 = immune, 2 = double).
resist.shroud float 0..100 pin, min, max step world The share of shroud (fog) damage it takes (1 = normal, 0 = immune, 2 = double).
resist.ice float 0..100 pin, min, max step world The share of ice damage it takes (1 = normal, 0 = immune, 2 = double).
resist.lightning float 0..100 pin, min, max step world The share of lightning damage it takes (1 = normal, 0 = immune, 2 = double).
loot.disabled bool pin step world No random loot at its death.
relations.environment enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the environment faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.hitAll enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the hitAll faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.fogger enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the fogger faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.vukah enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the vukah faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.scavenger enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the scavenger faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.wildlife enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the wildlife faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.wildBeast enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the wildBeast faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.player enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the player faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.automatedPlayer enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the automatedPlayer faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.hitOthers enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the hitOthers faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.skeleton enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the skeleton faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.playerAlly enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the playerAlly faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.farmAnimal enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the farmAnimal faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.cyclops enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the cyclops faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.drak enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the drak faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
relations.ancients enum (game, hostile, friendly, neutral) - - world unproven: writes refused (kiln.npcai's entity rows have no Gate lab yet; Kiln.Blocks' AI factions write them as before); What it does toward the ancients faction (kiln.npcai's entity row): game (the game decides), hostile, friendly or neutral.
Action Arguments What it does
damage amount (int, 1..1000000000), attacker (key, optional), reaction (enum, optional: none/veryLight/light/medium/heavy/boss/longStun/trapStun/throwIntoAir), pushBack (int, optional, 0..255), aggro (number, optional, 0..1000), silent (bool, optional), noCredit (bool, optional), forceInterrupt (bool, optional) Deals damage as a real hit of the game's (health change, killing blow, hit reaction, damage numbers, kill credit to the attacker), as Combat.Damage. The hit applies in the game's next hit conclusion. Receipt: healthBefore (int), healthAfter (int), killingBlow (bool). Pending first: the game finishes it in a later step.
kill attacker (key, optional), noCredit (bool, optional) Kills with a hit of exactly its health (a killing blow; kill credit for the attacker), as Combat.Kill. Receipt: healthBefore (int), healthAfter (int), killingBlow (bool). Pending first: the game finishes it in a later step.
heal amount (int, 0..1000000000) Heals up to its maximum, silently (no hit event), as Combat.Heal. Receipt: healed (int), health (int).
say tag (int, 0..4294967295), ms (int, optional, 0..600000) Says one of Kiln's lines in the game's own speech bubble over a friendly NPC (kiln.npcspeech). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).
assignRoutine plan (json) Gives a villager a routine plan (kiln.routines, wire format 1). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).
removeRoutine - Takes a villager's routine away (kiln.routines). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).
resumeRoutine - Lets a villager go on with its routine (kiln.routines). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).
survivorRequest request (json) Asks the game's roster for a survivor change: a bed, a base (kiln.survivors). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).
acquireControl request (json, optional) Takes a control lease of its body (kiln.creature_control). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).
releaseControl - Gives a control lease of its body back (kiln.creature_control). The old API performs it at once, as before; the Gate counts each call per mod. Unproven: refused (a Gate call of it has no lab yet: the old API performs it, the Gate counts it).

Enshrouded is a trademark of Keen Games GmbH. Kiln is unofficial.