2.11 Attributes/properties, ATTRLIST definitions
Posted on Aug 18, 2016 | 0 comments
This definition is relevant to all objects.
The additional attributes help you to better qualify and specify the behaviour of an object as they are treated like local variables (or properties) of that object.
By means of an additional attribute you can specify for instance whether an item can be picked or not (“pickable”), if it is visible (“hidden”), if it is “open”, and so on.
A number of pre-defined attributes are ready to be used. Plus, the developer can define his own attributes which can help him to control the game plot by means of events.
Here in this section you find a list of pre-defined, standard attributes which are automatically recognised and managed by the system to handle the most common situations.
Basic principle: Attributes are specified as comma-separated list of “key=value” pairs. The part “=value” can be omitted, in that case =true is considered the default value.
|Attribute/property name||Meaning for the game|
Tells whether an object is open or not.
WAY objects not having this attribute are implicitely open.
Tells whether an object can be opened by a player. If it has open or locked attributes, the object is implicitly openable.
You should use this one in the form openable=0 to specify that cannot be opened, and this does not depend from a lock.
For example, a sealed metal box cannot be opened, and it has no lock to open with whatever key. So the message the player will get when trying to open it will be different.
Tells whether an object can be opened with a key.
Nota: To programmatically open a “locked” object, you set the “open” attribute to 1 or true.
|pickable||If an object can be picked or not. Implicitely is not.|
|Hidden||If an object is hidden or not. Implicitely is not.|
If an item is hideable or not. Implicitely it is.
You should use this one in the form hideable=0 to specify that cannot be hidden.
Characters, ways and scenes cannot be hidden by the player.
Examples on the use of attributes can be found in the sample games provided with DimensioneX.
Note: the VOLUME and CAPACITY attributes are currently controlled by specific tags. See the section 2.11.2 – CAPACITY and VOLUME attributes.
2.11.1 Hidden properties
Normally, player’s and each examined object’s properties are not displayed on the game screen. To show them, the programmer has got two options:
1. Use property names beginning with a CAPITAL letter. By default, all properties beginning with a capital letter are shown.
Example: Health will be displayed, health will not.
2. Define a custom list of properties to be shown with the SHOW PROPERTIES directive in the GUI section. See 2.3 – GUI section for more details.
2.11.2 CAPACITY and VOLUME attributes
Each object has a specific size or, better saaid, volume (this is to add realism, otherwise you may pick up inifinite objects) and, if an item is a container, it also has a capacity. Volume and capacity are measured in units, and there are default values for all objects, see the following table.
|object type||default CAPACITY||default VOLUME|
In simple words, by default a player can carry 5 items of size 1, or an item of size 3 plus an of size 2, or… you got it.. You may want, however, create volume-less object by setting their volume to zero, or you may want to create huge containers with capacity 1000, 5000, 10000 …