Components - npruehs/tome-editor GitHub Wiki

As mentioned in the introduction, many game engines embrace organizing data as components. Usually, a component is nothing more or less than a collection of related fields. For example, you might want to compose a Current Health and a Maximum Health field into a HealthComponent, as neither of them makes much sense without the other. Then, game entities are comprised of multiple components to make up their data.

Clearly, this composition of fields might seem rather arbitrary in some cases, which is why components are optional in Tome. Each field may be part of zero or one component(s).

Adding Components

Before you can assign fields to components, you need to create some in the Components window.

  1. In the main window, click Fields > Manage Components...
  2. In the Components window, click Components > New Component...
  3. Specify which file to add the new component to.
  4. Enter a name for the new component and click OK.

Components

Using Components

After having added one or more components, you can specify their fields in the Field Definitions window.

  1. In the main window, click Fields > Manage Field Definitions...
  2. Double-click any existing field definition, or create a new one.
  3. Select the component the field should belong to.

Whenever you edit a record, all fields of the same component are now added or removed at once.

Record With Components

Whenever you add a new field to a component, that field will automatically be added to all records that have all existing fields of that component.

Deleting Components

You can delete existing components as follows:

  1. In the main window, click Fields > Manage Components...
  2. Select the component to delete.
  3. Click Components > Delete Component.

Next: Custom Types