EverambleGAME API / 1

CONTENT CONTRACT · VERSION 1

npc

A persistent non-player character with a daily routine and stable respawn identity.

Signature

{ arrival: (NpcArrival)?, character: CharacterId, companion: (NpcCompanion)?, dialogue: (DialogueId)?, faction: (ContentId)?, favorites: ({ItemId})?, id: ContentId, interaction: (Interaction)?, inventory: (NpcInventory)?, invulnerable: (boolean)?, kind: "npc", lifecycle: NpcLifecycle, loadout: (Loadout)?, look: (Name)?, name: TextKey, routine: RoutineId, story_routines: ({StoryRoutine})?, tags: {TagId}, tasks: ({VillagerTaskId})?, voice: (VoiceId)? }

Fields

NameTypeMeaning
arrivalNpcArrivalWhen a village NPC enters a world; absent: with the world (`world_start`).
characterCharacterIdCharacter definition supplying body, stats and movement.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: character
companionNpcCompanionIt fights along while it escorts someone (`move_to` with `follow`): an enemy fighting its leader or itself within `assist_mm` of it is taken on, at `damage_permille` of the blow of the weapon at hand (loadout hotbar or hand, or a belonging locked in the hand); with none, it follows. Absent: it only follows.
dialogueDialogueIdDialogue talking to it opens.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: dialogue
factionContentIdInitial faction declared by the ruleset; if omitted, the definition's own ID must be a declared faction.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$
favorites{ItemId}Dishes this resident likes best; stored in the village supply they lift the village's food mood. Absent: none.
Items: 1…8; Unique entries
idContentIdPackage-qualified identity; unique within its declaring namespace.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$
interactionInteractionExplicit prompt, reach and action exposed by this object.
inventoryNpcInventoryBelongings players may see and change from a conversation; absent: none (children, story figures).
invulnerablebooleanBlows, damage and statuses pass it by (story NPCs on an escort); absent: false.
kind"npc"Discriminant
lifecycleNpcLifecycleRespawn policy preserving the NPC's persistent identity.
loadoutLoadoutInventory and quick slots; absent leaves the NPC empty-handed.
lookNameWorld-library human it is drawn as; absent: a look seeded from its character options.
Length: 1…96; Pattern: ^[a-z][a-z0-9_]{0,95}$
nameTextKeyLocalization key for the displayed name.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: text
routineRoutineIdDaily schedule assigned to this named NPC.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: routine
story_routines{StoryRoutine}Its day while the story says so: the first row whose conditions hold sets its routine, none its own (`routine`). The engine derives it at every evaluation; no handler switches it. Absent: always its own.
Items: 1…16
tags{TagId}Unique definition tags used for filtering and classification.
Items: 0…4096; Unique entries
tasks{VillagerTaskId}Villager tasks it takes from players ("who can do what"); absent: every task. Only residents whose things are open take tasks.
Items: 1…16; Unique entries
voiceVoiceIdVoice of its lines and mumble.
Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: voice

Validated example

{
  "arrival": "spawned",
  "character": "core:camp_chough_body",
  "faction": "core:camp_folk",
  "id": "core:camp_chough",
  "invulnerable": true,
  "kind": "npc",
  "lifecycle": {
    "delay_ticks": 300,
    "respawn": "same_ref"
  },
  "loadout": {
    "hotbar": [
      "core:bandit_club"
    ],
    "items": [
      {
        "count": 1,
        "item": "core:bandit_club"
      }
    ]
  },
  "name": "core:npc_camp_chough_name",
  "routine": "core:camp_chough_day",
  "story_routines": [
    {
      "routine": "core:camp_hide_tents",
      "when": [
        {
          "max": 2,
          "min": 2,
          "variable": "core:camp_state"
        }
      ]
    },
    {
      "routine": "core:camp_gone",
      "when": [
        {
          "max": 3,
          "min": 3,
          "variable": "core:camp_state"
        }
      ]
    }
  ],
  "tags": [],
  "voice": "core:camp_chough_voice"
}