Difference between revisions of "%object%.Weight function"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
(Created page with " <TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER><<< Size</TD><TD WIDTH="34%" ALIGN=CENTER>Object Functions</TD>...")
 
m (picture)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
The Weight function returns an integer that indicates the relative weight of the object.
  
 +
== Requirements ==
 +
This function can only be used with dynamic objects.
  
 +
The "Object weight" property of the object must be selected to be able to use this function.
  
 +
You can check this using the object restriction:
  
 +
[object] [must] [have property] [Object Weight]
  
 +
== Properties ==
 +
The "[[Object weight]]" property of the object has a drop-down list containing the five weight ranges defined in the Object weight value-list property.
 +
The number returned by this function will be the value corresponding to the weight selected in the drop-down list.
  
 +
[[File:PropertyObjectWeight.jpg]]
  
 +
[[File:PropertyDialogObjectWeight.jpg]]
  
 +
*All weights are relative to the size of a "Very light" object.
 +
*ADRIFT does not specify the units used for these weight values, they are completely arbitrary values.
 +
:If you wanted to print these values with units you could use grams, kilograms, or even pounds if your game is set in the past.
 +
*You can change the values in the "Object weight" value list if you need a greater or smaller range of object weights.
 +
:The default is for each weight to have three times the mass of the next smallest.
  
 +
== How to use ==
 +
This function simply returns the value of the object weight property as a single integer value that can be inserted into text, or used as part of an expression in a restriction or action. No further functions can be appended to this function.
  
 
+
== Examples ==
 
+
*<span style="color:red">Object7</span>.<span style="color:red">Weight</span>
 +
:The weight of the specific object with the key "Object7". 
 +
*<span style="color:green">%object%</span>.<span style="color:red">Weight</span>
 +
:The weight of the referenced object, in a task with an %object% reference.
  
  
 
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[%object%.Size function|<<< Size]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]]</TD><TD ALIGN=CENTER>[[%object%.AtLocationGroup function|AtLocationGroup >>>]]</TD></TABLE>
 
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[%object%.Size function|<<< Size]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]]</TD><TD ALIGN=CENTER>[[%object%.AtLocationGroup function|AtLocationGroup >>>]]</TD></TABLE>
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 07:53, 19 September 2013

The Weight function returns an integer that indicates the relative weight of the object.

Requirements

This function can only be used with dynamic objects.

The "Object weight" property of the object must be selected to be able to use this function.

You can check this using the object restriction:

[object] [must] [have property] [Object Weight]

Properties

The "Object weight" property of the object has a drop-down list containing the five weight ranges defined in the Object weight value-list property. The number returned by this function will be the value corresponding to the weight selected in the drop-down list.

PropertyObjectWeight.jpg

PropertyDialogObjectWeight.jpg

  • All weights are relative to the size of a "Very light" object.
  • ADRIFT does not specify the units used for these weight values, they are completely arbitrary values.
If you wanted to print these values with units you could use grams, kilograms, or even pounds if your game is set in the past.
  • You can change the values in the "Object weight" value list if you need a greater or smaller range of object weights.
The default is for each weight to have three times the mass of the next smallest.

How to use

This function simply returns the value of the object weight property as a single integer value that can be inserted into text, or used as part of an expression in a restriction or action. No further functions can be appended to this function.

Examples

  • Object7.Weight
The weight of the specific object with the key "Object7".
  • %object%.Weight
The weight of the referenced object, in a task with an %object% reference.


<<< SizeObject FunctionsAtLocationGroup >>>