Harvestable
Associated namespace: sm.harvestable
Represents a harvestable object in the game.
Values:
- clientPublicData
- id
- initialPosition
- initialRotation
- mass
- material
- materialId
- name
- publicData
- type
- uuid
- worldPosition
- worldRotation
Functions:
- destroy
- getAabb
- getClientPublicData
- getColor
- getData
- getId
- getMass
- getMaterial
- getMaterialId
- getName
- getPoseWeight
- getPosition
- getPublicData
- getRotation
- getScale
- getSeatCharacter
- getType
- getUuid
- getUvFrameIndex
- getWorld
- hasSeat
- isKinematic
- setClientPublicData
- setColor
- setParams
- setPoseWeight
- setPosition
- setPublicData
- setRotation
- setSeatCharacter
- setUvFrameIndex
Operations:
Operation | Description |
---|---|
Harvestable == Harvestable | Checks 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:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
getAabb(harvestable)
Returns the bounds of the harvestable shape.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
Vec3,Vec3 | The min and max bounds. |
getClientPublicData(harvestable)
Client only
Returns client public data from a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
table | The client public data. |
getColor(harvestable)
Returns the color of the harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
Color | The color. |
getData(harvestable)
Get the script data from a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
table | data The script data. |
getId(harvestable)
Returns the id of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
integer | The harvestable id. |
getMass(harvestable)
Returns the mass of a harvestable. The mass scales with the harvestable's scale.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
number | The mass. |
getMaterial(harvestable)
Returns the material name of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
string | The name of the material. |
getMaterialId(harvestable)
Returns the material id of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
integer | The id of the material. |
getName(harvestable)
Returns the name of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
string | The harvestable name. |
getPoseWeight(harvestable, index)
Client only
Returns the pose weight of the pose in the given index.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
integer | index | The index. |
Returns:
Type | Description |
---|---|
number | The pose weight. |
getPosition(harvestable)
Returns the world coordinates of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
Vec3 | The position. |
getPublicData(harvestable)
Server only
Returns (server) public data from a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
table | The public data. |
getRotation(harvestable)
Returns the quaternion rotation of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
Quat | The rotation. |
getScale(harvestable)
Returns the scale of the harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
Vec3 | The scale. |
getSeatCharacter(kinematic)
Returns the Character that is seated in the kinematic.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | kinematic | The kinematic. |
Returns:
Type | Description |
---|---|
Character | The character. |
getType(harvestable)
Returns the type of a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
string | The harvestable's type. |
getUuid(harvestable)
Returns the Uuid of the harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
Uuid | The uuid. |
getUvFrameIndex(harvestable)
Client only
Returns the index of the current UV animation frame
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
integer | The uv frame. |
getWorld(harvestable)
Returns the world a harvestable exists in.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
World | The world the harvestable exists in. |
hasSeat(kinematic)
Returns true if kinematic has a seat component.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | kinematic | The kinematic. |
Returns:
Type | Description |
---|---|
boolean | The result. |
isKinematic(harvestable)
Check if a harvestable is kinematic
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Returns:
Type | Description |
---|---|
boolean | Return true if the harvestable is kinematic. |
setClientPublicData(harvestable, data)
Client only
Sets client public data on a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
table | data | The client public data. |
setColor(harvestable, color)
Client only
Sets the color of the harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Color | color | The color. |
setParams(harvestable, data)
Server only
Sets param data for a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
any | data | The param data. |
setPoseWeight(harvestable, index, value)
Client only
Set the pose weight of the pose in the given index.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
integer | index | The index. |
number | value | The pose weight. |
setPosition(harvestable, position)
Set the world coordinates of a harvestable. Can only be used on kinematic harvestables.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Vec3 | position | The position. |
setPublicData(harvestable, data)
Server only
Sets (server) public data on a harvestable.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
table | data | The public data. |
setRotation(harvestable, rotation)
Set the quaternion rotation of a harvestable. Can only be used on kinematic harvestables.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
Quat | rotation | The rotation. |
setSeatCharacter(kinematic, character)
Requests to seat a Character in the kinematic.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | kinematic | The kinematic. |
Character | character | The character. |
setUvFrameIndex(harvestable, index)
Client only
Sets the UV animation frame with the given index.
Parameters:
Type | Name | Description |
---|---|---|
Harvestable | harvestable | The harvestable. |
integer | index | The index. |