Skip to content

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.

Item Properties

Creating a new Property

To create a new Property all that needs to be done is to click on the Add Property button.

Item Attack Property

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.

Visible determines when a Property is displayed in the UI, and Hide allows you to hide some of its elements. 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).

Item Inherit Properties

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. The Visible field determines when a property is displayed in the user interface:

  • Always Visible: The property is always displayed.
  • Hide If Zero: The property is hidden when its total Number value (including the value added by any attached Socket) is zero. This is the default value.
  • Hidden: The property is never displayed.

The Hide field allows you to hide only some elements of a property that is displayed: its Number, its Text and/or its Icon.

Item UI Properties

Stuff behind the scenes

This is especially 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.