ItemData

consoledoc.h

Stores properties for an individual Item type.

More...

Public Attributes

float

A floating-point value specifying how 'bouncy' this ItemData is.

float

A floating-point value specifying how much velocity is lost to impact and sliding friction.

float

Floating point value to multiply the existing gravity with, just for this ItemData.

LinearColorF

Color value to make this light. Example: "1.0,1.0,1.0".

bool

If true, this ItemData will only cast a light if the Item for this ItemData has a static value of true.

float

Distance from the center point of this ItemData for the light to affect.

int

Time value for the light of this ItemData, used to control the pulse speed of the PulsingLight LightType.

Type of light to apply to this ItemData. Options are NoLight, ConstantLight, PulsingLight. Default is NoLight.

float

Maximum velocity that this ItemData is able to move.

bool

Determines if only simple server-side collision will be used (for pick ups).

bool

If true, ItemData will 'stick' to any surface it collides with.

Detailed Description

Stores properties for an individual Item type.

Items represent an object in the world, usually one that the player will interact with. One example is a health kit on the group that is automatically picked up when the player comes into contact with it.

ItemData provides the common properties for a set of Items. These properties include a DTS or DAE model used to render the Item in the world, its physical properties for when the Item interacts with the world (such as being tossed by the player), and any lights that emit from the Item.

datablock ItemData(HealthKitSmall)
{
   category ="Health";
   className = "HealthPatch";
   shapeFile = "art/shapes/items/kit/healthkit.dts";
   gravityMod = "1.0";
   mass = 2;
   friction = 1;
   elasticity = 0.3;
   density = 2;
   drag = 0.5;
   maxVelocity = "10.0";
   emap = true;
   sticky = false;
   dynamicType = "0"
;   lightOnlyStatic = false;
   lightType = "NoLight";
   lightColor = "1.0 1.0 1.0 1.0";
   lightTime = 1000;
   lightRadius = 10.0;
   simpleServerCollision = true;   // Dynamic properties used by the scripts

   pickupName = "a small health kit";
   repairAmount = 50;
};

Public Attributes

float elasticity 

A floating-point value specifying how 'bouncy' this ItemData is.

float friction 

A floating-point value specifying how much velocity is lost to impact and sliding friction.

float gravityMod 

Floating point value to multiply the existing gravity with, just for this ItemData.

LinearColorF lightColor 

Color value to make this light. Example: "1.0,1.0,1.0".

bool lightOnlyStatic 

If true, this ItemData will only cast a light if the Item for this ItemData has a static value of true.

float lightRadius 

Distance from the center point of this ItemData for the light to affect.

int lightTime 

Time value for the light of this ItemData, used to control the pulse speed of the PulsingLight LightType.

ItemLightType lightType 

Type of light to apply to this ItemData. Options are NoLight, ConstantLight, PulsingLight. Default is NoLight.

float maxVelocity 

Maximum velocity that this ItemData is able to move.

bool simpleServerCollision 

Determines if only simple server-side collision will be used (for pick ups).

If set to true then only simple, server-side collision detection will be used. This is often the case if the item is used for a pick up object, such as ammo. If set to false then a full collision volume will be used as defined by the shape. The default is true.

note:

Only applies when using a physics library.

see:

TurretShape and ProximityMine for examples that should set this to false to allow them to be shot by projectiles.

bool sticky 

If true, ItemData will 'stick' to any surface it collides with.

When an item does stick to a surface, the Item::onStickyCollision() callback is called. The Item has methods to retrieve the world position and normal the Item is stuck to.

note:

Valid objects to stick to must be of StaticShapeObjectType.