-
Notifications
You must be signed in to change notification settings - Fork 7
Components
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).
Before you can assign fields to components, you need to create some in the Components window.
- In the main window, click Fields > Manage Components...
- In the Components window, click Components > New Component...
- Specify which file to add the new component to.
- Enter a name for the new component and click OK.
After having added one or more components, you can specify their fields in the Field Definitions window.
- In the main window, click Fields > Manage Field Definitions...
- Double-click any existing field definition, or create a new one.
- 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.
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.
You can delete existing components as follows:
- In the main window, click Fields > Manage Components...
- Select the component to delete.
- Click Components > Delete Component.
Next: Custom Types