Properties¶
Properties are mutable values that compose a runtime item. For example, an Item's attack power, its durability or whether they apply a special effect, such as Burn.
Creating a new Property¶
To create a new Property all that needs to be done is to click on the Add Property button.
The Property ID field determines the unique ID of this Property. It is used to identify it, so make sure it's a name that's easy to remember and type.
Is Hidden determines if a Property is hidden in the UI. For more information, see the Hiding Properties section.
The rest of fields are all optional.
- Icon: Provides the Property with a Sprite to be used in user interfaces.
- Color: Assigns a color to the Property. Useful to differentiate items in user interfaces.
- Number: A mutable value that can be used in-game, such as increasing stats.
- Text A dynamic value that is usually used to represent the in-game name of the Property.
Mutable vs Immutable
Mutable is a programming concept which means that the value is dynamic and can be changed at runtime. Immutable, in contrast, means that its value can't be changed once a value is assigned.
Inheriting Properties¶
Checking the Inherit Properties toggle found at the top will automatically inherit all properties from its parent(s).
The value of an inherited Property can be overridden by checking its left toggle and changing the field value.
Taking advantage of inheritance
It is very common to have a type of item that shares the same properties with all its child items. Setting a base value for the parent item type will make it much easier to define what each sub-item does.
For example, let's say all shield items have a defense
value. We could add this property on the base item "Shield" and propagate this property to all other shields that inherit from this item, and just change the final value, so a "Wooden Shield" has a lower defense
value than a Steel Shield
.
Hiding Properties¶
When displaying properties in the UI, these can be sequentially displayed, without having to manually set them one by one. If the Is Hidden checkbox is ticked, these properties will not be displayed in the user interface.
Stuff behind the scenes
This is specially useful when a property represents something that the user should not be aware of.
For example, some items could have the is-metal
property that determines if an item is a metallic one or not.