Autonauts Modding
ModCustom Class Reference
Inheritance diagram for ModCustom:
ModBuilding ModConverter ModDecorative ModEducation ModFood ModGoTo ModHat ModHoldable ModMedicine ModTool ModTop ModToy

Public Member Functions

void UpdateModelParameters (string UniqueName, float Scale=1f, float RotX=0f, float RotY=0f, float RotZ=0f, float TransX=0f, float TransY=0f, float TransZ=0f)
 
void UpdateModelScale (string UniqueName, float Scale=1f)
 
void UpdateModelScaleSplit (string UniqueName, float ScaleX=1f, float ScaleY=1f, float ScaleZ=1f)
 
void UpdateModelRotation (string UniqueName, float RotX=0f, float RotY=0f, float RotZ=0f)
 
void UpdateModelTranslation (string UniqueName, float TransX=0f, float TransY=0f, float TransZ=0f)
 
void RegisterForCustomCallback (string UniqueName, string CallbackType, DynValue Callback)
 

Member Function Documentation

◆ RegisterForCustomCallback()

void ModCustom.RegisterForCustomCallback ( string  UniqueName,
string  CallbackType,
DynValue  Callback 
)

Register a callback on specific events for a custom item

Version
135.18
Parameters
UniqueName- String - The unique name of the custom item - Required
CallbackType- String - The type of callback to register for - Required [FoodConsumed, ClothingTopAdded, ClothingTopRemoved, ClothingHatAdded, ClothingHatRemoved, ConverterCreateItem, ConverterComplete, HoldablePickedUp, HoldableDroppedOnGround, AddedToConverter]
CallbackFunction- Function - The function to callback to on event - Required
Returns
None
Example
ModFood.RegisterForCustomCallback("Cupcake", "FoodConsumed", FoodCallbackFunction) – The start e.g. 'ModFood' MUST match the type of custom object (Like ModConverter if it's a custom converter)
ModConverter.RegisterForCustomCallback("Butcher", "ConverterComplete", CallbackFunction)
ModHoldable.RegisterForCustomCallback("Raw Meat", "AddedToConverter", CallbackFunction)
Callback return : function FoodCallbackFunction(Type, LocationX, Location Y, ItemUniqueID, UserUniqueID) – (Type of custom item - UniqueMame)(ItemUniqueID the item's uniqueID)(UserUniqueID of the user of Worker/Player/ConverterAddedTo etc.)
Note
Can be used in functions: Creation()

◆ UpdateModelParameters()

void ModCustom.UpdateModelParameters ( string  UniqueName,
float  Scale = 1f,
float  RotX = 0f,
float  RotY = 0f,
float  RotZ = 0f,
float  TransX = 0f,
float  TransY = 0f,
float  TransZ = 0f 
)

Update custom model parameters (All parameters - scale, rotation and translation)

Version
134.30
Parameters
UniqueName- String - The unique name of the custom item - Required
Scale- Number (float) - Scale of the model - Defaults to 1
RotX- Number (float) - Rotation (X) of the model - Defaults to 0
RotY- Number (float) - Rotation (Y) of the model - Defaults to 0
RotZ- Number (float) - Rotation (Z) of the model - Defaults to 0
TransX- Number (float) - Translation (X) of the model - Defaults to 0
TransY- Number (float) - Translation (Y) of the model - Defaults to 0
TransZ- Number (float) - Translation (Z) of the model - Defaults to 0
Returns
None
Example
ModFood.UpdateModelParameters("Cupcake", 0.2, -90,0,0, 0,0,1)
Note
Can be used in functions: Creation()

◆ UpdateModelRotation()

void ModCustom.UpdateModelRotation ( string  UniqueName,
float  RotX = 0f,
float  RotY = 0f,
float  RotZ = 0f 
)

Update custom model rotation only

Version
134.30
Parameters
UniqueName- String - The unique name of the custom item - Required
RotX- Number (float) - Rotation (X) of the model - Defaults to 0
RotY- Number (float) - Rotation (Y) of the model - Defaults to 0
RotZ- Number (float) - Rotation (Z) of the model - Defaults to 0
Returns
None
Example
ModFood.UpdateModelRotation("Cupcake", -90,0,0)
Note
Can be used in functions: Creation()

◆ UpdateModelScale()

void ModCustom.UpdateModelScale ( string  UniqueName,
float  Scale = 1f 
)

Update custom model scale only

Version
134.30
Parameters
UniqueName- String - The unique name of the custom item - Required
Scale- Number (float) - Scale of the model - Defaults to 1
Example
ModFood.UpdateModelScale("Cupcake", 0.2)
Note
Can be used in functions: Creation()

◆ UpdateModelScaleSplit()

void ModCustom.UpdateModelScaleSplit ( string  UniqueName,
float  ScaleX = 1f,
float  ScaleY = 1f,
float  ScaleZ = 1f 
)

Update custom model scale only (Defining each of the axes)

Version
134.30
Parameters
UniqueName- String - The unique name of the custom item - Required
ScaleX- Number (float) - X Scale of the model - Defaults to 1
ScaleY- Number (float) - Y Scale of the model - Defaults to 1
ScaleZ- Number (float) - Z Scale of the model - Defaults to 1
Example
ModFood.UpdateModelScaleSplit("Cupcake", 1,1,1)
Note
Can be used in functions: Creation()

◆ UpdateModelTranslation()

void ModCustom.UpdateModelTranslation ( string  UniqueName,
float  TransX = 0f,
float  TransY = 0f,
float  TransZ = 0f 
)

Update custom model translation only

Version
134.30
Parameters
UniqueName- String - The unique name of the custom item - Required
TransX- Number (float) - Translation (X) of the model - Defaults to 0
TransY- Number (float) - Translation (X) of the model - Defaults to 0
TransZ- Number (float) - Translation (X) of the model - Defaults to 0
Returns
None
Example
ModFood.UpdateModelTranslation("Cupcake", 20,5,0)
Note
Can be used in functions: Creation()

The documentation for this class was generated from the following file: