Field Definitions - npruehs/tome-editor GitHub Wiki

The smallest unit of data in Tome is called a field. Each field has a name, a textual description, a specific type and a default value for that type.

Field Definitions

Currently, Tome supports the following basic data types:

  • Boolean. Boolean value (true or false).
  • Color. 32-bit RGBA color.
  • File. Relative or absolute path to another file, with or without file extension.
  • Integer. 32-bit signed integer.
  • Real. Single-precision floating-point number.
  • Reference. Reference to another record of data (e.g. projectile fired by a weapon).
  • String. Series of Unicode characters.
  • Vector. Two- or three-dimensional vectors with integer or floating-point numbers.

In records, fields are associated with values to make up the actual data of your game.

You can also define your own custom derived types, enumerations, lists and maps.

Adding Fields

In order to store data for your game, you need to add data fields first.

  1. In the main window, click Fields > Manage Field Definitions...
  2. In the Field Definitions window, click Fields > New Field...
  3. Enter a name, type, default value and description for the new field.
  4. Specify which file to add the new field to.
  5. Click OK.

An internal unique field identifier will automatically be generated from your field name, but you may change it as you like.

It is always a good idea to add a precise description of your field. This helps designers to provide the correct data, and reduces the turnaround time when adding new game data. For instance, if you're adding a Movement Speed field, you might want to specify the unit you're using to measure speed (e.g. meters per second, or tiles per turn).

New Field

Editing Fields

Field definitions can be edited in the Field Definitions window:

  1. In the main window, click Fields > Manage Field Definitions...
  2. In the Field Definitions window, double-click any field.
  3. Change name, type, default value and description as desired.
  4. Click OK.

Note that changing the type of a field might invalidate the data of any records using that field.

Deleting Fields

Existing field definitions can be removed in the Field Definitions window as follows:

  1. In the main window, click Fields > Manage Field Definitions...
  2. In the Field Definitions window, select any field.
  3. Click Fields > Delete Field.

Next: Data Records