NPCs

In Ranvier all npcs for an area are defined in a single file within the area folder: npcs.yml

Example File

bundles/core-areas/areas/limbo/npcs.yml

- id: 1
  keywords: ['rat']
  name: 'Rat'
  level: 2
  description: "The rat's beady red eyes dart frantically, its mouth foaming as it scampers about."
  behaviors: [ 'combat' ]
  script: '1-rat'
  items: ['limbo:2']
  quests: ['limbo:2']
  attributes:
    health: 100
    speed: 2.5
  damage: 1-7
- id: 2
  keywords: ["wise", "old", "man"]
  name: "Wise Old Man"
  description: "A wise looking old man sits on the ground with legs crossed."

Here we have two npcs. The rat can enter combat, has a custom script, a default inventory, hands out a quest and has some extra attributes. The old man is the most basic NPC you can have.

Definition Fields

field type (default)


id number
required NPC id unique among the npcs of the current area
name string
required String displayed the player sees the npc in the room
keywords string
required Keywords that the player can use to target this npc, does not need to be unique
description string
required String displayed when the player looks directly at the npc
script string
Name of custom script to attach to this npc (See Scripting)
behaviors array<string>
List of behaviors to attach to this npc (See Scripting)
attributes object
Arbitrary list of attributes to attach to this NPC. There are no constraints on this so you are free to assign basically anything here that you want to look for inside commands/scripts/etc.
items array<EntityReference>
List of Entity References representing the NPC's default inventory
quests array<EntityReference>
List of Entity References representing the quests that this character gives out (See Quests)