Integer (property type)

From ADRIFT 5 Manual Wiki
Revision as of 01:59, 13 September 2013 by Saabie (Talk | contribs) (moved Integer property type to Integer (property type): clarify title)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
THE MAIN ITEMS
Locations
Objects
Tasks
Characters
Events
Variables
Groups
Properties
---- Character
---- Integer
---- Location Group
---- Location
---- Object
---- Selection
---- State
---- Value
---- Text
Text Overrides
Hints
Synonyms
User functions

At its simplest, an integer property stores a single integer value. However it is also possible to give the integer a specific type by selecting a value list to use with it.

The property now stores two values, a simple integer plus one of the items from this value list.

When this property is used in an expression, the integer value is multiplied by the value of the selection from the value list, and the result is returned as the value of the property.

Properties

A normal integer property stores a single integer number, as shown in the "...and the surface can hold" property below:

ObjectPropertiesCanHold.jpg

The value 14 here indicates that the surface of this object can have a maximum of 14 other objects placed on top of it.

An integer property with the type "Object size" stores both a number and the name of one of the values from the "Object size" value list.

PropertyContainerCapacity.jpg

Looking at the definition of the "Object size" value list, you will see that each name corresponds to a value.

The name "Normal" has the value 9, so the resulting value of the "...and the container can hold" property shown above is 1 x 9 = 9.

PropertyDialogObjectSize.jpg

Testing the property value

We can compare the value of an integer property with the result of an equation using a property restriction:

RestrictionContainerCanHold.jpg

In this case we have used a value-list integer, so the value we are comparing against is the result of the integer multiplied by the selection from the value list.

By clicking on the x+y button, you could instead select an integer variable to compare with the integer property.

Setting the property with an action

When you use an action to set a value-list integer, you cannot set the integer part and value-list part separately. The value that you set is the total value of the property.

ActionSetIntegerProperty.jpg

Creating a new integer property

Create a new property by clicking the "Add new property" button at the bottom of the Properties tab of a Character, Location, or Object. You can also right-click the open "Properties" folder and select "Add Property", or right-click any other open folder and select "Add new/Property".

The first example shows the creation of a normal integer property that indicates how many gold coins a particular character is carrying:

NewPropertyInteger.jpg

  • Give the new property a description.
  • Ensure that "property of" is correctly set (Characters, Objects or Locations)
  • Set the property "Type" to "Integer".
  • Tick the "Mandatory" box if you want this property to always be selected.

To create an integer property that uses a value list, simply select the wanted value-list from the "Integer Type" drop-down list.

NewPropertyIntegerType.jpg


<<< Character property typePropertiesLocation Group property type >>>