Skip to Content
Stoatly Docs
Concepts

Object types, fields and records

Your game data is built from three things. An object type is a kind of thing, like Weapon or Quest. A field is one property of it, like damage or description. A record is one actual instance, like the Iron Sword. Define the object type once and every record of it has the same fields.

Object types

An object type is the schema for a kind of data. It has a name, an optional description and an optional icon, and it can inherit from a parent type. Every object type also has a built-in Name field, which you can't remove. To make one, read Create an object type.

Fields

Each field has a type that decides what it can hold, such as text, a number, a yes or no value, a date, a choice from a list, a link to another record or a colour. A field can hold a single value or a list of them, and can have rules such as a minimum, a maximum or being required. The field types reference lists every type, and Add and edit fields shows how to use them.

Records

A record is one entry of an object type. It has a value for each field and a slug, which is its unique identifier in files and in code. To make one, read Create and edit a record.

How they fit together

An example

A Weapon object type has fields for damage, weight and rarity. The record Iron Sword gives them values. A Quest object type can have a field that links to a Weapon record, so a quest can name its reward.

On this page