atl/item.hpp
sm.item: static information about item and shape uuids.
sm::item
Section titled "sm::item"inline bool isBlock(const Uuid &u);What kind of item a uuid is.
Parameters
u(const Uuid &): The item uuid.
Returns bool
Lua: sm.item.isBlock
inline bool isPart(const Uuid &u);What kind of item a uuid is.
Parameters
u(const Uuid &): The item uuid.
Returns bool
Lua: sm.item.isPart
inline bool isTool(const Uuid &u);What kind of item a uuid is.
Parameters
u(const Uuid &): The uuid.
Returns bool
Lua: sm.item.isTool
inline bool isJoint(const Uuid &u);What kind of item a uuid is.
Parameters
u(const Uuid &): The item uuid.
Returns bool
Lua: sm.item.isJoint
inline bool isHarvestablePart(const Uuid &u);What kind of item a uuid is.
Parameters
u(const Uuid &): The shape uuid.
Returns bool
Lua: sm.item.isHarvestablePart
inline bool isFlammable(const Uuid &u);True if the item can burn.
Parameters
u(const Uuid &): The item uuid.
Returns bool
Lua: sm.item.isFlammable
inline String title(const Uuid &u);The item's display name and description.
Parameters
u(const Uuid &): The uuid.
Returns String
Lua: sm.shape.getShapeTitle
inline String description(const Uuid &u);The item's display name and description.
Parameters
u(const Uuid &): The uuid.
Returns String
Lua: sm.shape.getShapeDescription
inline int stackSize(const Uuid &u);How many fit in one inventory slot.
Parameters
u(const Uuid &): The item uuid.
Returns int
Lua: sm.item.getStackSize
inline int qualityLevel(const Uuid &u);The item's quality level.
Parameters
u(const Uuid &): The shape uuid.
Returns int
Lua: sm.item.getQualityLevel
inline String material(const Uuid &u);The physics material name and id.
Parameters
u(const Uuid &): The uuid of the shape.
Returns String
Lua: sm.item.getMaterial
inline int materialId(const Uuid &u);The physics material name and id.
Parameters
u(const Uuid &): The uuid of the shape.
Returns int
Lua: sm.item.getMaterialId
inline Vec3 size(const Uuid &u);Size in blocks (the part's bounding box).
Parameters
u(const Uuid &): The item uuid.
Returns Vec3
Lua: sm.item.getShapeSize
inline Vec3 offset(const Uuid &u);Offset of the part's origin within its bounding box.
Parameters
u(const Uuid &): The shape uuid.
Returns Vec3
Lua: sm.item.getShapeOffset
inline Color defaultColor(const Uuid &u);The color the item has when first placed.
Parameters
u(const Uuid &): The item uuid.
Returns Color
Lua: sm.item.getShapeDefaultColor
inline Quat rotation(const Uuid &u, int rotationIndex = 0);The rotation for one of the part's rotation-set indices.
Parameters
u(const Uuid &)rotationIndex(int)
Returns Quat
Lua: sm.item.getShapeRotation
inline Ratings ratings(const Uuid &u);Reads all four ratings of an item.
Parameters
u(const Uuid &): The item uuid.
Returns Ratings
Lua: sm.item.getDensityRating
inline Value featureData(const Uuid &u);Raw definition tables; nil when the item has no such feature.
Parameters
u(const Uuid &): The item uuid.
Returns Value
Lua: sm.item.getFeatureData
inline Value edible(const Uuid &u);Raw definition tables; nil when the item has no such feature.
Parameters
u(const Uuid &): The shape uuid.
Returns Value
Lua: sm.item.getEdible
inline Value plantable(const Uuid &u);Raw definition tables; nil when the item has no such feature.
Parameters
u(const Uuid &): The shape uuid.
Returns Value
Lua: sm.item.getPlantable
inline Vector<Uuid> interactablesOfType(StringView type);Every interactable item of a type, e.g. "chest", "engine", "seat".
Parameters
type(StringView): The interactable type name
Returns Vector<Uuid>
Lua: sm.item.getInteractablesUuidsOfType
inline Vector<Uuid> plantables();Every item that can be planted.
Returns Vector<Uuid>
Lua: sm.item.getPlantableUuids
inline bool isMultiShape(const Uuid &u);True for an item made of several shapes.
Parameters
u(const Uuid &): The uuid.
Returns bool
Lua: sm.item.isMultiShape
inline CharacterShape characterShape(const Uuid &u);Reads an item's character shape; empty if it has none.
Parameters
u(const Uuid &): The shape uuid.
Returns CharacterShape
Lua: sm.item.getCharacterShape
inline void addTracked(const Uuid &u, int type);[client] Starts / stops tracking placement and use of an item (type is sm.item's tracking type).
Parameters
u(const Uuid &): The uuid of the shape.type(int): Thesm.item.trackingType.
Lua: sm.item.addTrackedItem
inline void removeTracked(const Uuid &u, int type);[client] Starts / stops tracking placement and use of an item (type is sm.item's tracking type).
Parameters
u(const Uuid &): The uuid of the shape.type(int): Thesm.item.trackingType.
Lua: sm.item.removeTrackedItem
Ratings
Section titled "Ratings"The 1 to 10 ratings shown in the inventory.
struct Ratingsint density = 0, durability = 0, friction = 0, buoyancy = 0;CharacterShape
Section titled "CharacterShape"The character a "character shape" item places.
struct CharacterShapeUuid characterUuid;double placementSphereRadius = 0;