Skip to content

Objects

Zynj-git edited this page Jan 22, 2021 · 12 revisions

Objects

Objects are constructed and managed from entries.
Objects provide a flexible and dynamic framework for displaying information to the AI on-demand and by fine-tuned conditions.
Objects consist of three core components:

  • <root> - is the identifier and access point of the Object.
    • <root> can be arbitrarily named as the script is agnostic to its existence.
    • e.g john in john.character is the <root> of the Object.
  • <paths> - is any of the child Object(s) in the paths of <root>.
    • e.g character in john.character is a path of john.
    • <paths> holds the values to present when qualified.
      • e.g John within john.character is the value of the path.
    • <paths> are displayed to the AI simultaneously as its values.
      • Label your <paths> with an identifier to the value it holds.
      • e.g john.character hints that it contains a character, John
  • _synonyms - is an internal path that holds the conditions the Object should adhere to.
    • By default, <root> becomes the <root>._synonyms with an automatic application of the #[t] attribute.
      • An example is john._synonyms defaulting to john#[t]
    • <root>._synonyms can hold individual conditions per line-break and run separate functions on demand.
      • The lowest positioned line is the one executed if qualified.

Basic Object Creation

There are three methods of Object creation to facilitate various workflows.

World Information Interface

  • Manipulation of Objects via the World Information interface.

  • Dot-separated keys assign the entry's content to the Object.

  • ! prefixed keys is an alternate method that parses the entry's content into dot-separated entries.

    Click for Examples
    • Dot-separated
      keys entry
      john.character John
      john.traits Wizard, Sage, Alchemist
      john.type Legendary Mage
      john.outfit Withered Robe
      john.status Stunned
      john.effects Radiant Light
      [{"character": "John", "traits": "Wizard, Sage, Alchemist", "type": "Legendary Mage", "outfit": "Withered Robe", "status": "Stunned", "effects": "Radiant Light"}]
    • ! Prefixed
      keys entry
      !john [{"character": "John", "traits": "Wizard, Sage, Alchemist", "type": "Legendary Mage", "outfit": "Withered Robe", "status": "Stunned", "effects": "Radiant Light"}]
      [{"character": "John", "traits": "Wizard, Sage, Alchemist", "type": "Legendary Mage", "outfit": "Withered Robe", "status": "Stunned", "effects": "Radiant Light"}]

Input Commands

  • Manipulation of Objects via the input field.
  • See the list of commands.
    • /set mimics the behavior of dot-separated paths.
    • /from mimics the behavior of ! prefixed entries.

External Editors and Importing

  • As Objects are handled via worldEntries, importing .JSON files into AI Dungeon is an option.
  • Create and fill in the mandatory keys, entry, and optional isNotHidden and id fields.
  • Use the formats described in World Information Interface for the file's keys and entry fields.

Clone this wiki locally