Torque Game Engine DocumentationVersion 1.3.x |
Like PlayerData, ItemData is derived from ShapeBaseData and includes all the fields ShapeBaseData defines. ItemData defines new fields as well, and allows developers to quickly specify data related to basic items in the game world.
As with PlayerData, we will only list the new fields defined in ItemData, for convenience and ease of reading. See ShapeBaseData for more details on the fields it defines.
Table D.4. ItemData Member Fields
| Field Name | Type | Default Value | Description |
|---|---|---|---|
| Lighting Data | |||
| lightType | LightType (enum) | NoLight | Specifies whether and what type of light is associated with this item. Valid values are NoLight, ConstantLight, and PulsingLight. Note: all itemData-based lights are Point lights, this field simply specifies whether the light pulses or not. |
| lightColor | ColorF | (1.0, 1.0, 1.0, 1.0) | The item light's color, if a lightType other than NoLight is provided. |
| lightRadius | Float | 10.0 | The item's point light radius. |
| lightOnlyStatic | Boolean | False | Specifies that only static objects should be lit with this light. May be used only with static items. |
| lightTime | Integer | 1000 | For PulsingLight types, the length of a pulse, in ticks. |
| Physics Data | |||
| elasticity | Float | 0.0 | Used to simulate the physical property of an object's collision elasticity. In physical collisions, resultant velocity is scaled by elasticity. Valid range is 0 to 1. |
| friction | Float | 0.0 | Used to simulate the physical property of friction when colliding with an object. In physical collisions, resultant velocity is dampened by scaling the friction value. Valid range is 0 to 1. |
| sticky | Boolean | False | Used to force the item to be sticky; the item will stick to interior or terrain objects it collides with; data returned in console object methods such as GetLastStickyPos will be affected. |
| maxVelocity | Float | -1.0 | Specifies the maximum sustainable velocity for the object. |
| gravityMod | Float | 1.0 | Scalar multiple applied to gravity effects for the item. |
| Miscellaneous Fields | |||
| pickUpName | String | "an item" | Can be used to specify the item name to display when a player picks up the item. |
| dynamicType | Integer | 0 | Can be used to specify the item's dynamic type for it's Type Mask. Valid value is $TypeMasks::DamagableItemObjectType. |
In the next section, we'll look at four datablocks at once MissionMarkerData, CameraData, and PathCameraData, and StaticShapeData. We group these datablocks in a single section, because they all derive from ShapeBaseData, but define almost no new fields.