Harvestable

Associated namespace: sm.harvestable

Represents a harvestable object in the game.

Values:

Functions:

Operations:

OperationDescription
Harvestable == HarvestableChecks if two instances of Harvestable refer to the same Harvestable.

clientPublicData table

Get:

Client only

Returns client public data from a harvestable.

Set:

Client only

Sets client public data on a harvestable.


id integer

Get:

Returns the id of a harvestable.


initialPosition Vec3

Get:

Returns the initial world coordinates of a kinematic.


initialRotation Quat

Get:

Returns the initial quaternion rotation of a harvestable.


mass number

Get:

Returns the mass of a harvestable. The mass scales with the harvestable's scale.


material string

Get:

Returns the material name of a harvestable.


materialId integer

Get:

Returns the material id of a harvestable.


name string

Get:

Returns the name of a harvestable.


publicData table

Get:

Server only

Returns (server) public data from a harvestable.

Set:

Server only

Sets (server) public data on a harvestable.


type string

Get:

Returns the type of a harvestable.


uuid Uuid

Get:

Returns the Uuid of the harvestable.


worldPosition Vec3

Get:

Returns the world coordinates of a harvestable.


worldRotation Quat

Get:

Returns the quaternion rotation of a harvestable.


destroy(harvestable)

Server only

Destroys a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

getAabb(harvestable)

Returns the bounds of the harvestable shape.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
Vec3,Vec3The min and max bounds.

getClientPublicData(harvestable)

Client only

Returns client public data from a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
tableThe client public data.

getColor(harvestable)

Returns the color of the harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
ColorThe color.

getData(harvestable)

Get the script data from a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
tabledata The script data.

getId(harvestable)

Returns the id of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
integerThe harvestable id.

getMass(harvestable)

Returns the mass of a harvestable. The mass scales with the harvestable's scale.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
numberThe mass.

getMaterial(harvestable)

Returns the material name of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
stringThe name of the material.

getMaterialId(harvestable)

Returns the material id of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
integerThe id of the material.

getName(harvestable)

Returns the name of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
stringThe harvestable name.

getPoseWeight(harvestable, index)

Client only

Returns the pose weight of the pose in the given index.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
integerindexThe index.

Returns:

TypeDescription
numberThe pose weight.

getPosition(harvestable)

Returns the world coordinates of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
Vec3The position.

getPublicData(harvestable)

Server only

Returns (server) public data from a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
tableThe public data.

getRotation(harvestable)

Returns the quaternion rotation of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
QuatThe rotation.

getScale(harvestable)

Returns the scale of the harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
Vec3The scale.

getSeatCharacter(kinematic)

Returns the Character that is seated in the kinematic.

Parameters:

TypeNameDescription
HarvestablekinematicThe kinematic.

Returns:

TypeDescription
CharacterThe character.

getType(harvestable)

Returns the type of a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
stringThe harvestable's type.

getUuid(harvestable)

Returns the Uuid of the harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
UuidThe uuid.

getUvFrameIndex(harvestable)

Client only

Returns the index of the current UV animation frame

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
integerThe uv frame.

getWorld(harvestable)

Returns the world a harvestable exists in.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
WorldThe world the harvestable exists in.

hasSeat(kinematic)

Returns true if kinematic has a seat component.

Parameters:

TypeNameDescription
HarvestablekinematicThe kinematic.

Returns:

TypeDescription
booleanThe result.

isKinematic(harvestable)

Check if a harvestable is kinematic

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.

Returns:

TypeDescription
booleanReturn true if the harvestable is kinematic.

setClientPublicData(harvestable, data)

Client only

Sets client public data on a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
tabledataThe client public data.

setColor(harvestable, color)

Client only

Sets the color of the harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
ColorcolorThe color.

setParams(harvestable, data)

Server only

Sets param data for a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
anydataThe param data.

setPoseWeight(harvestable, index, value)

Client only

Set the pose weight of the pose in the given index.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
integerindexThe index.
numbervalueThe pose weight.

setPosition(harvestable, position)

Set the world coordinates of a harvestable. Can only be used on kinematic harvestables.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
Vec3positionThe position.

setPublicData(harvestable, data)

Server only

Sets (server) public data on a harvestable.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
tabledataThe public data.

setRotation(harvestable, rotation)

Set the quaternion rotation of a harvestable. Can only be used on kinematic harvestables.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
QuatrotationThe rotation.

setSeatCharacter(kinematic, character)

Requests to seat a Character in the kinematic.

Parameters:

TypeNameDescription
HarvestablekinematicThe kinematic.
CharactercharacterThe character.

setUvFrameIndex(harvestable, index)

Client only

Sets the UV animation frame with the given index.

Parameters:

TypeNameDescription
HarvestableharvestableThe harvestable.
integerindexThe index.