Base Item class. Uses the ItemData datablock for common properties.
More...
List of all members.
Public Member Functions |
string | getLastStickyNormal () |
| Get the normal of the surface on which the object is stuck.
|
string | getLastStickyPos () |
| Get the position on the surface on which this Item is stuck.
|
bool | isAtRest () |
| Is the object at rest (ie, no longer moving)?
|
bool | isRotating () |
| Is the object still rotating?
|
bool | isStatic () |
| Is the object static (ie, non-movable)?
|
bool | setCollisionTimeout (int ignoreColObj=NULL) |
| Temporarily disable collisions against a specific ShapeBase object.
|
|
|
void | onEnterLiquid (string objID, string waterCoverage, string liquidType) |
| Informs an Item object that it has entered liquid, along with information about the liquid type.
|
void | onLeaveLiquid (string objID, string liquidType) |
| Informs an Item object that it has left a liquid, along with information about the liquid type.
|
void | onStickyCollision (string objID) |
| Informs the Item object that it is now sticking to another object.
|
Public Attributes |
|
|
bool | rotate |
| If true, the object will automatically rotate around its Z axis.
|
bool | static |
| If true, the object is not moving in the world (and will not be updated through the network).
|
Static Public Attributes |
static bool | isRenderable |
| Disables rendering of all instances of this type.
|
static bool | isSelectable |
| Disables selection of all instances of this type.
|
static int | maxWarpTicks |
| When a warp needs to occur due to the client being too far off from the server, this is the maximum number of ticks we'll allow the client to warp to catch up.
|
static float | minWarpTicks |
| Fraction of tick at which instant warp occures on the client.
|
Detailed Description
Base Item class. Uses the ItemData datablock for common properties.
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.
- Example:
datablock ItemData(HealthKitPatch)
{
category = "Health";
className = "HealthPatch";
shapeFile = "art/shapes/items/patch/healthpatch.dts";
mass = 2;
friction = 1;
elasticity = 0.3;
emap = true;
pickupName = "a health patch";
repairAmount = 50;
};
%obj = new Item()
{
dataBlock = HealthKitSmall;
parentGroup = EWCreatorWindow.objectGroup;
static = true;
rotate = true;
};
- See also:
- ItemData
Member Function Documentation
string Item::getLastStickyNormal |
( |
|
) |
|
Get the normal of the surface on which the object is stuck.
- Returns:
- Returns The XYZ normal from where this Item is stuck.
- Example:
%stuckPosition = %item.getLastStickPos();
- Note:
- Server side only.
string Item::getLastStickyPos |
( |
|
) |
|
Get the position on the surface on which this Item is stuck.
- Returns:
- Returns The XYZ position of where this Item is stuck.
- Example:
%stuckPosition = %item.getLastStickPos();
- Note:
- Server side only.
Is the object at rest (ie, no longer moving)?
- Returns:
- True if the object is at rest, false if it is not.
- Example:
-
bool Item::isRotating |
( |
|
) |
|
Is the object still rotating?
- Returns:
- True if the object is still rotating, false if it is not.
- Example:
- See also:
- rotate
Is the object static (ie, non-movable)?
- Returns:
- True if the object is static, false if it is not.
- Example:
- See also:
- static
void Item::onEnterLiquid |
( |
string |
objID, |
|
|
string |
waterCoverage, |
|
|
string |
liquidType | |
|
) |
| | |
Informs an Item object that it has entered liquid, along with information about the liquid type.
- Parameters:
-
| objID | Object ID for this Item object. |
| waterCoverage | How much coverage of water this Item object has. |
| liquidType | The type of liquid that this Item object has entered. |
- Note:
- Server side only.
- See also:
- Item, ItemData, WaterObject
void Item::onLeaveLiquid |
( |
string |
objID, |
|
|
string |
liquidType | |
|
) |
| | |
Informs an Item object that it has left a liquid, along with information about the liquid type.
- Parameters:
-
| objID | Object ID for this Item object. |
| liquidType | The type of liquid that this Item object has left. |
- Note:
- Server side only.
- See also:
- Item, ItemData, WaterObject
void Item::onStickyCollision |
( |
string |
objID |
) |
|
Informs the Item object that it is now sticking to another object.
This callback is only called if the ItemData::sticky property for this Item is true.
- Parameters:
-
| objID | Object ID this Item object. |
- Note:
- Server side only.
- See also:
- Item, ItemData
bool Item::setCollisionTimeout |
( |
int |
ignoreColObj = NULL |
) |
|
Temporarily disable collisions against a specific ShapeBase object.
This is useful to prevent a player from immediately picking up an Item they have just thrown. Only one object may be on the timeout list at a time. The timeout is defined as 15 ticks.
- Parameters:
-
| objectID | ShapeBase object ID to disable collisions against. |
- Returns:
- Returns true if the ShapeBase object requested could be found, false if it could not.
- Example:
%ignoreColObj = %player.getID();
%item.setCollisionTimeout(%ignoreColObj);
Member Data Documentation
When a warp needs to occur due to the client being too far off from the server, this is the maximum number of ticks we'll allow the client to warp to catch up.
Fraction of tick at which instant warp occures on the client.
If true, the object will automatically rotate around its Z axis.
If true, the object is not moving in the world (and will not be updated through the network).