Skip to content

Creating NPCS

Cromha edited this page Apr 7, 2024 · 6 revisions

Introduction

A NPC (Non-Playable-Character), in Bane Of Wargs, is an entity that is encountered on multiple specifics map points. When encountering a NPC, a dialog phrases will appear on the game's UI, the same way a dialog appears; the principal goal of NPCs is to buy and sell items and drinks to the player. Note that NPCs can be re-used in different map points, and that a map point can have multiple NPCs at once.

NPCs definitions are located in the npcs.yaml yaml file.

Extra Data

In order to make the NPC display correctly on the player's diary, you'll need to create a <npc_id>.txt file where <npc_id> is the id of the NPC; in the imgs/ directory of the plugin. In this file, you'll put the ascii art of that NPC with, if you want, yaml data color codes.

Explanation

An example of a NPC definition:

Jerry The Junk Seller:
  name: "Jerry The Junk Seller"
  cost value: 1.7
  speech:
  - "Hey my guy! Searchin' for good odd antiques?"
  - "By the way, I just recently found an old rusted key. Maybe it's for a secret chest?"
  sells:
    drinks:
    - Suspicious Stew
    items:
    - Old Rusted Key
    - Knife
    - Tissue Bag
    - Bone
    - Bow String
    - Raw Wood
  buys:
    items:
    - None
  description: "This guys sells really bad stuff but sometimes it's really rare"

When encountering this NPC, the defined dialog phrases will be displayed in a speech text effect, and after the player will be able to buy some drinks and items but not able to sell items.

Here is the full syntax:

<npc id>:
  name: <displayed name(str)>
  cost value: <cost value(float)>
  speech: <strings to display(list)>
  sells:
    drinks: <drinks id(list)>  # put "- None" for none
    items: <items id(list)>  # put "- None" for none
  buys
    items: <items id(list)>  # put "- None" for none
  descriptions: <a clear and concise description(str)>
  • name // here you'll enter the name of the NPC you want to be displayed.
  • cost value // this is the price in gold of the item. Note that this price vary following the cost value from where you buy/sell it.
  • speech // here you'll list every phrases the NPC will output when encountered.
  • sells
    • drinks // here you'll list every drinks you want this NPC to sell. Put "- None" for none.
    • items // here you'll list every items you want this NPC to sell. Put "- None" for none.
  • buys
    • items // here you'll list every items you want this NPC to buy from the player. Put "- None" for none.
  • description // here you'll put the description of the NPC that will display on the player's diary.
Clone this wiki locally