dopfield expression function
Returns the value of a field as a float.
Usage
dopfield(dop, objectSpec, subDataName, recordType,
recordNum, fieldName)
If a field is multivalued, you can access individual parameters by adding a suffix.
For example, “ty” will access the y component of the “t” field. If the field is a quaternion, one can use “rx”, “ry”, and “rz” as extensions to get the euler rotations for the quaternion. In the special case of a quaternion named “orient”, simply using the name “rx” will return the equivalent of “orientrx”.
Note that when accessing subdata, the name of the data field is based on the name of the node that creates it. Also, note that the complete path to the subdata must be provided. See the example below.
Examples
dopfield("/obj/dopnet1", "obj0", "Position", "Options", 0, "ty")Returns the y position of object obj0
dopfield("/obj/dopnet1", "obj0", "Position", "Options", 0, "ry")Returns the ry component of the orientation of object obj0. This will be in degrees.
dopfield("/obj/dopnet1", "obj0", "Forces/Gravity_gravity1", "Options", 0, "forcey")Returns the y component of the gravity force created by the Gravity Force node named gravity1. Note that the full path must be given, including the relevant node name, and that this path corresponds to the folder names in the tree view of the DOP network.
