Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

ItemData

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 NameTypeDefault ValueDescription
Lighting Data
lightTypeLightType (enum)NoLightSpecifies 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.
lightColorColorF(1.0, 1.0, 1.0, 1.0)The item light's color, if a lightType other than NoLight is provided.
lightRadiusFloat10.0The item's point light radius.
lightOnlyStaticBooleanFalseSpecifies that only static objects should be lit with this light. May be used only with static items.
lightTimeInteger1000For PulsingLight types, the length of a pulse, in ticks.
Physics Data
elasticityFloat0.0Used 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.
frictionFloat0.0Used 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.
stickyBooleanFalseUsed 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.
maxVelocityFloat-1.0Specifies the maximum sustainable velocity for the object.
gravityModFloat1.0Scalar multiple applied to gravity effects for the item.
Miscellaneous Fields
pickUpNameString"an item"Can be used to specify the item name to display when a player picks up the item.
dynamicTypeInteger0Can 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.