PlaceableComponent

Component allowing an object to be placed by generation.  Note that this class will soon be deprecated, and exist only as scripted logic/data.

Summary
PlaceableComponentComponent allowing an object to be placed by generation.
Functions
NKGetMaterialRepIDReturns the material id for this objects placeablematerial representation, if it has one.
NKGetStepSoundReturns the step sound name for this GameObject.
NKGetRemovalSoundReturns the removal sound name for this GameObject.
NKGetPlacementSoundReturns the placement sound name for this GameObject.
NKGetMaxScaleReturns the max scale for this object.
NKGetMinScaleReturns the min scale for this object.
NKGetTierReturns the placeable item tier.
NKSetTierSets the tier of this object
NKIsResourceReturns true if this placeable is a resource.
NKSetAsResourceSets this item to be a resource or not.
NKPlayCraftEmitter(Needs to be deprecated) Plays this object’s on-craft emitter.
NKGetCraftEmitterNameGets the crafting emitter name
NKGetCraftEmitterAltNameGet the alt crafting emitter name
NKGetBreakEmitterNameGets the breaking emitter name
NKGetBreakEmitterAltNameGet the alt breaking emitter name
NKGetPlaceEmitterNameGets the placing emitter name
NKGetPlaceEmitterAltNameGet the alt placing emitter name
NKShouldFaceCameraReturns whether or not this object should face the camera when dropped.
NKIsPlacedWithPhysicsReturns whether or not this object should be placed physics active.
NKGetTetherDistanceModifierRetrieves the tether distance modifier for this object.
NKGetHealthReturns the max health of this object.
NKGetDurabilityLossOnCorrectHitReturns how much damage a tool with the correct category type will take from hitting this object type.
NKGetDurabilityLossOnIncorrectHitReturns how much damage a tool with the incorrect category type will take from hitting this object type.
NKGetRotOffsetReturns the base rotation offset of this object that is applied when placing it in the world.
NKGetPosOffsetReturns the base positional offset of this object that is applied when placing it in the world.
NKGetCategoryReturns this object’s category.
NKGetCraftingArchetypeThis function is deprecated and scheduled for removal.
NKSetIconNameSets the icon we should use for this placeable material when displayed in the inventory
NKGetIconNameGets the icon we should use for this placeable material when displayed in the inventory
NKGetDropsGets a table of items to be dropped by this placeable material
PlaceableMaterialComponentComponent representing a voxel material that can appear in the players inventory.
Functions
NKGetMaterialIDReturns the material id representing this placeable.

Functions

NKGetMaterialRepID

Returns the material id for this objects placeablematerial representation, if it has one.

Returns

intThe material id representing this placeable, or -1 if it has no material representation.

NKGetStepSound

Returns the step sound name for this GameObject.

Returns

stringThe step sound name.

NKGetRemovalSound

Returns the removal sound name for this GameObject.

Returns

stringThe removal sound name.

NKGetPlacementSound

Returns the placement sound name for this GameObject.

Returns

stringThe placement sound name.

NKGetMaxScale

Returns the max scale for this object.

Returns

floatThe max scale for this object.

NKGetMinScale

Returns the min scale for this object.

Returns

floatThe min scale for this object.

NKGetTier

Returns the placeable item tier.

Returns

intThe placeable item tier

NKSetTier

Sets the tier of this object

Parameters

intThe tier of this object

NKIsResource

Returns true if this placeable is a resource.

Returns

intTrue if this placeable is a resource.

NKSetAsResource

Sets this item to be a resource or not.

Parameters

boolResource or not.

NKPlayCraftEmitter

(Needs to be deprecated) Plays this object’s on-craft emitter.

Parameters

vec3The location at which to play the emitter.
vec3The direction to face the emitter in.

NKGetCraftEmitterName

Gets the crafting emitter name

Parameters

none

NKGetCraftEmitterAltName

Get the alt crafting emitter name

Parameters

none

NKGetBreakEmitterName

Gets the breaking emitter name

Parameters

none

NKGetBreakEmitterAltName

Get the alt breaking emitter name

Parameters

none

NKGetPlaceEmitterName

Gets the placing emitter name

Parameters

none

NKGetPlaceEmitterAltName

Get the alt placing emitter name

Parameters

none

NKShouldFaceCamera

Returns whether or not this object should face the camera when dropped.

Returns

boolWhether or not this object should face the camera when dropped.

NKIsPlacedWithPhysics

Returns whether or not this object should be placed physics active.

Returns

boolWhether or not this object should be placed physics active.

NKGetTetherDistanceModifier

Retrieves the tether distance modifier for this object.

Returns

floatHow much to alter the tether distance when this object is held in front of the player.

NKGetHealth

Returns the max health of this object.

Returns

floatThe max health of this object.

NKGetDurabilityLossOnCorrectHit

Returns how much damage a tool with the correct category type will take from hitting this object type.

Returns

floatThe amount of damage a tool with the correct category type will take from hitting this object type.

NKGetDurabilityLossOnIncorrectHit

Returns how much damage a tool with the incorrect category type will take from hitting this object type.

Returns

floatThe amount of damage a tool with the incorrect category type will take from hitting this object type.

NKGetRotOffset

Returns the base rotation offset of this object that is applied when placing it in the world.

Returns

quatThe base rotation applied to this object when it is placed in the world.

NKGetPosOffset

Returns the base positional offset of this object that is applied when placing it in the world.

Returns

vec3The base positional offset applied to this object when it is placed in the world.

NKGetCategory

Returns this object’s category.

Returns

stringThe category for this object type.

NKGetCraftingArchetype

This function is deprecated and scheduled for removal.

NKSetIconName

Sets the icon we should use for this placeable material when displayed in the inventory

Parameters

stringThe icon name as it appears in the icon imageset (TUGIcon)

NKGetIconName

Gets the icon we should use for this placeable material when displayed in the inventory

Returns

stringThe icon name as it appears in the icon imageset (TUGIcon)

NKGetDrops

Gets a table of items to be dropped by this placeable material

Returns

Tablea LUA table defining the items to be dropped in the following format
[1] = { itemName, dropChance, dropMinAmount, dropMaxAmount},
[2] = { itemName, dropChance, dropMinAmount, dropMaxAmount},
[3] = { itemName, dropChance, dropMinAmount, dropMaxAmount},
...

PlaceableMaterialComponent

Component representing a voxel material that can appear in the players inventory.

Inherits:

Summary
Functions
NKGetMaterialIDReturns the material id representing this placeable.

Functions

NKGetMaterialID

Returns the material id representing this placeable.

Returns

intThe material id representing this placeable, or -1 if it has no material representation.
Component allowing an object to be placed by generation.
Close