Skip to content

Objects

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

Objects

Objects are constructed from entries that have a dot-separated keys field.
The final element in the dot-separated path has its property within the Object assigned the value of the entry's entry field.

  • The presence of # in the keys field omits the entry for Object creation and instead tests it for Attributes.
  • Entries consumed for Object creation are removed from worldEntries.

Basic Object Creation

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

  1. Via the World Information interface.

    KEYS                             | ENTRY
    john.abilities.magic.alteration  | "Transmutation, Etherealness"
    john.traits                      | "Wizard, Sage, Alchemist"
    
    david.abilities.magic.alteration | "Corruption, Corrosive, Flimsy"
    david.abilities.melee.fencing    | "Proficient, Agile, Show-off"
    
    • If you intend to solely utilize the World Information interface, enable the parity mode with /parity
  2. Via the /set command.

    • /set is used to quickly assign a value to the specific property.
    • /set john.abilities.magic.alteration Transmutation, Etherealness
  3. Via the /from command.

    • /from allows the assignment of an Object from a JSON- line.
    • /from john [{"abilities": {"magic": {"alteration": "Transmutation, Etherealness"}}, "traits": "Wizard, Sage, Alchemist"}]
  4. Via external editors and spreadsheets.

    1. Create a Spreadsheet with four horizontal fields/columns named keys, entry, isNotHidden, and id.
    2. Fill in the rows of the columns in the expected format.
    3. Export as a .cvs file then use a .cvs to .JSON converter.
    4. Import the .JSON file to AI Dungeon via the World Information interface.

In all of the preceding examples, it results in the assignment and creation of the Objects and values within the path.
It creates and accesses all of the paths in the individual Object(s), john and david, until it reaches its final destination.

dataStorage["john"] = {"abilities": {"magic": {"alteration": "Transmutation, Etherealness"}}, "traits": "Wizard, Sage, Alchemist"}
dataStorage["david"] = {"abilities": {"magic": {"alteration": "Corruption, Corrosive, Flimsy"}, "melee": {"fencing": "Proficient, Agile, Show-off"}}}

Clone this wiki locally