Autonauts Modding
ModConverter Class Reference
Inheritance diagram for ModConverter:
ModCustom

Public Member Functions

void CreateConverter (string UniqueName, string[] RecipeStringArr, string[] NewIngredientsStringArr, int[] NewIngredientsAmountArr, string ModelName="", int[] TL=null, int[] BR=null, int[] Access=null, int[] Spawn=null, bool UsingCustomModel=true)
 
bool AddIngredientToSpecifiedConverter (int UID, string IngredientString)
 
bool AddFuelToSpecifiedConverter (int UID, float Fuel)
 
float GetFuelQuantity (int UID)
 
float GetFuelMaxCapacity (int UID)
 
bool AreConverterRequrementsMet (int UID)
 
Table GetConverterProperties (int UID)
 
- Public Member Functions inherited from ModCustom
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

◆ AddFuelToSpecifiedConverter()

bool ModConverter.AddFuelToSpecifiedConverter ( int  UID,
float  Fuel 
)

Add Fuel to a converter (Fueler)

Version
136.23
Parameters
UID- Number (integer) - the unique ID of the converter (Fueler) object - Required
Fuel- Number (float) - How much fuel to add - Required
Returns
Boolean - True if added to converter [NOTE: Returns false if failed OR trying to add more fuel than capacity allows]
Example
Success = ModConverter.AddFuelToSpecifiedConverter(ObjId, 2)
Note
Can be used in functions: AfterLoad(), AfterLoad_CreatedWorld(), AfterLoad_LoadedWorld(), OnUpdate()

◆ AddIngredientToSpecifiedConverter()

bool ModConverter.AddIngredientToSpecifiedConverter ( int  UID,
string  IngredientString 
)

Add an ingredient to a converter

Version
135.16
Parameters
UID- Number (integer) - the unique ID of the converter object - Required
IngredientString- String - The ingredient to search for - Required
Returns
Boolean - True if the Ingredient was added to converter
Example
Success = ModConverter.AddIngredientToSpecifiedConverter(ObjId, "Berries")
Note
Can be used in functions: AfterLoad(), AfterLoad_CreatedWorld(), AfterLoad_LoadedWorld(), OnUpdate()

◆ AreConverterRequrementsMet()

bool ModConverter.AreConverterRequrementsMet ( int  UID)

Have the requirements been met for provided converter

Version
136.27
Parameters
UID- Number (integer) - the unique ID of the converter object - Required
Returns
Boolean - True if converter requirements met
Example
ModConverter.AreConverterRequrementsMet(ObjId)
Note
Can be used in functions: AfterLoad(), AfterLoad_CreatedWorld(), AfterLoad_LoadedWorld(), OnUpdate()

◆ CreateConverter()

void ModConverter.CreateConverter ( string  UniqueName,
string[]  RecipeStringArr,
string[]  NewIngredientsStringArr,
int[]  NewIngredientsAmountArr,
string  ModelName = "",
int[]  TL = null,
int[]  BR = null,
int[]  Access = null,
int[]  Spawn = null,
bool  UsingCustomModel = true 
)

Create a custom converter

Version
134.29
Parameters
UniqueName- String - The unique and corresponding name of the converter - Required
RecipeStringArr- String array - List of recipes allowed in this converter - Defaults to none
NewIngredientsStringArr- String array - List of ingredients required to make the converter - Defaults to none
NewIngredientsAmountArr- Number (integer) array - The amount of each of the ingredients (Must match size of ingredients array) - Defaults to none
ModelName- String - The name/path of the custom model to use or name/path of the in game model to use - Defaults to in game 'Workbench' Model
TL- Number (integer) array - Top Left ground coordinates of the converter (for area) e.g. (-1,-1) - Defaults to none
BR- Number (integer) array - Bottom Right ground coordinates of the converter (for area) e.g. (2,0) - Defaults to none
Access- Number (integer) array - Access point (for the farmer player) ground coordinates of the converter e.g. (1,1) - Defaults to none
Spawn- Number (integer) array - Spawn point (of the item) ground coordinates of the converter e.g. (2,1) - Defaults to none
UsingCustomModel- Boolean - True if using a custom model, false if using in game model/default model - Defaults to true
Returns
None
Example
ModConverter.CreateConverter("BerryMaker", {"Berries"}, {"Pole"}, {1}) – Default Model
ModConverter.CreateConverter("Colonist Converter", {"Cupcake"}, {"Folk"}, {4}, "", {-1,-1}, {1,0}, {0,1}, {1,1}) – Default Model, Using Custom Food "Cupcake" as Ingredient
ModConverter.CreateConverter("Colonist Cupcakes Maker", {"Cupcake"}, {"Folk"}, {4}, "Models/Buildings/Converters/Workbench", {-1,-1}, {1,0}, {0,1}, {1,1}, false) – In Game Model
ModConverter.CreateConverter("Mega Maker", {"Colonist Cupcake","Berries"}, {"Crate3"}, {4}, "ObjCrates/wooden boxes pack", {-1,-1}, {1,0}, {0,1}, {1,1}) – Custom Model
Note
Can be used in functions: Creation()

◆ GetConverterProperties()

Table ModConverter.GetConverterProperties ( int  UID)

Get the properties of a given converter providing the object's unique ID

Version
136.27
Parameters
UID- Number (integer) - the unique ID of the converter - Required
Returns
Table (Mixed) - Properties [1]=State(Idle,Converting,Creating,Cancelling), [2]=TileX, [3]=TileY, [4]=Rotation, [5]=Name, [6]=RequirementsMet, [7]=OutputX, [8]=OutputY, [9]=InputX, [10]=InputY, [11]=LastObjectAddedType, [12]=CurrentFuel, [13]=FuelCapacity
Example
Info = ModConverter.GetConverterProperties(ObjId)
Note
Can be used in functions: AfterLoad(), AfterLoad_CreatedWorld(), AfterLoad_LoadedWorld(), OnUpdate()

◆ GetFuelMaxCapacity()

float ModConverter.GetFuelMaxCapacity ( int  UID)

Get max Fuel capacity (in a Fueler Converter)

Version
136.26
Parameters
UID- Number (integer) - the unique ID of the converter (Fueler) object - Required
Returns
Number (float) - The amount of fuel allowed in fueler (Returns -1 if error)
Example
Max = ModConverter.GetFuelMaxCapacity(ObjId)
Note
Can be used in functions: AfterLoad(), AfterLoad_CreatedWorld(), AfterLoad_LoadedWorld(), OnUpdate()

◆ GetFuelQuantity()

float ModConverter.GetFuelQuantity ( int  UID)

Get current Fuel quantity (in a Fueler Converter)

Version
136.26
Parameters
UID- Number (integer) - the unique ID of the converter (Fueler) object - Required
Returns
Number (float) - The amount of fuel in fueler (Returns -1 if error)
Example
Amount = ModConverter.GetFuelQuantity(ObjId)
Note
Can be used in functions: AfterLoad(), AfterLoad_CreatedWorld(), AfterLoad_LoadedWorld(), OnUpdate()

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