![]() |
Autonauts Modding
|
Public Member Functions | |
void | CreateBuilding (string UniqueName, string[] NewIngredientsStringArr, int[] NewIngredientsAmountArr, string ModelName="", int[] TL=null, int[] BR=null, int[] Access=null, bool UsingCustomModel=true) |
bool | IsBuildingActuallyFlooring (int UID) |
int[] | GetAllBuildingsUIDsOfType (string NewTypeString, int StartX, int StartY, int EndX, int EndY) |
int[] | GetBuildingsUIDsRequiringIngredientInArea (string IngredientString, int StartX, int StartY, int EndX, int EndY) |
void | SetBuildingWalkable (string NewTypeString, bool CanBeWalkedThrough) |
int | GetBuildingCoveringTile (int PosX, int PosY, bool AllowFlooring=false, bool AllowWalls=false, bool AllowFootprintTiles=false) |
Table | GetAllBuildingsUIDsFromName (string DesiredName) |
bool | AddEnergy (int UID, float EnergyAmount, bool SetToMax=false) |
bool | AddWater (int UID, float WaterAmount, bool SetToMax=false) |
bool | AddFuel (int UID, float FuelAmount, bool SetToMax=false) |
float | GetFuelMaxCapacity (int UID) |
void | ShowBuildingAccessPoint (string NewTypeString, bool EnableAccessPoint) |
bool | SetBuildingName (int UID, string BuildingName) |
bool | SetRotation (int UID, int Rotation) |
int | GetRotation (int UID) |
bool | IsBuildingSaveable (int UID) |
void | RegisterForBuildingEditedCallback (int BuildingUID, DynValue Callback) |
void | UnregisterForBuildingEditedCallback (int BuildingUID) |
void | RegisterForNewBuildingInAreaCallback (int StartX, int StartY, int EndX, int EndY, DynValue Callback) |
void | UnregisterForNewBuildingInAreaCallback (int StartX, int StartY, int EndX, int EndY) |
void | RegisterForBuildingTypeSpawnedCallback (string NewTypeString, DynValue Callback) |
![]() | |
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) |
bool ModBuilding.AddEnergy | ( | int | UID, |
float | EnergyAmount, | ||
bool | SetToMax = false |
||
) |
Add Energy to a Power Building (e.g. Windmill, GiantWaterWheel, StationaryEngine)
UID | - Number (integer) - the unique ID of the power building object - Required |
EnergyAmount | - Number (float) - energy to add to building - Required |
SetToMax | - Boolean - if energy should be filled to max capacity - Defaults to false |
bool ModBuilding.AddFuel | ( | int | UID, |
float | FuelAmount, | ||
bool | SetToMax = false |
||
) |
Add Fuel to a Building that allows it (e.g. TrainRefuellingStation, StationaryEngine)
UID | - Number (integer) - the unique ID of the building object - Required |
FuelAmount | - Number (float) - Fuel to add to building - Required |
SetToMax | - Boolean - if Fuel should be filled to max capacity - Defaults to false |
bool ModBuilding.AddWater | ( | int | UID, |
float | WaterAmount, | ||
bool | SetToMax = false |
||
) |
Add Water to a Building that allows it (e.g. TrainRefuellingStation, StationaryEngine)
UID | - Number (integer) - the unique ID of the building object - Required |
WaterAmount | - Number (float) - water to add to building - Required |
SetToMax | - Boolean - if water should be filled to max capacity - Defaults to false |
void ModBuilding.CreateBuilding | ( | string | UniqueName, |
string[] | NewIngredientsStringArr, | ||
int[] | NewIngredientsAmountArr, | ||
string | ModelName = "" , |
||
int[] | TL = null , |
||
int[] | BR = null , |
||
int[] | Access = null , |
||
bool | UsingCustomModel = true |
||
) |
Create a custom building
UniqueName | - String - The unique and corresponding name of the building - Required |
NewIngredientsStringArr | - String array - List of ingredients required to make the building - 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 'BlockWall' Model |
TL | - Number (integer) array - Top Left ground coordinates of the building (for area) e.g. (-1,-1) - Defaults to none |
BR | - Number (integer) array - Bottom Right ground coordinates of the building (for area) e.g. (2,0) - Defaults to none |
Access | - Number (integer) array - Access point ground coordinates of the building e.g. (1,1) - Defaults to none |
UsingCustomModel | - Boolean - True if using a custom model, false if using in game model/default model - Defaults to true |
Table ModBuilding.GetAllBuildingsUIDsFromName | ( | string | DesiredName | ) |
Get the unique IDs of buildings matching the desired name provided
DesiredName | - String - Name of the building to search for - Required |
int [] ModBuilding.GetAllBuildingsUIDsOfType | ( | string | NewTypeString, |
int | StartX, | ||
int | StartY, | ||
int | EndX, | ||
int | EndY | ||
) |
Get the unique IDs of buildings of type in a specified area
NewTypeString | - String - The building type to search for - Required |
StartX | - Number (integer) - The location to start the search from (X) - Required |
StartY | - Number (integer) - The location to start the search from (Y) - Required |
EndX | - Number (integer) - The location to end the search at (X) - Required |
EndY | - Number (integer) - The location to end the search at (Y) - Required |
int ModBuilding.GetBuildingCoveringTile | ( | int | PosX, |
int | PosY, | ||
bool | AllowFlooring = false , |
||
bool | AllowWalls = false , |
||
bool | AllowFootprintTiles = false |
||
) |
Get the Unique ID of the building that covers the provided tile coordinates
PosX | - Number (integer) - The location to check (X) - Required |
PosY | - Number (integer) - The location to check (Y) - Required |
AllowFlooring | - Boolean - Allow flooring in the check? - Defaults to false |
AllowWalls | - Boolean - Allow walls in the check? - Defaults to false |
AllowFootprintTiles | - Boolean - Allow the spawn/in/out/footprint tiles of the building in the check? - Defaults to false |
int [] ModBuilding.GetBuildingsUIDsRequiringIngredientInArea | ( | string | IngredientString, |
int | StartX, | ||
int | StartY, | ||
int | EndX, | ||
int | EndY | ||
) |
Get the unique IDs of buildings that require the specified ingredient in their recipe
IngredientString | - String - The ingredient to search for - Required |
StartX | - Number (integer) - The location to start the search from (X) - Required |
StartY | - Number (integer) - The location to start the search from (Y) - Required |
EndX | - Number (integer) - The location to end the search at (X) - Required |
EndY | - Number (integer) - The location to end the search at (Y) - Required |
float ModBuilding.GetFuelMaxCapacity | ( | int | UID | ) |
Get the maximum Fuel capacity of a Building that allows it (e.g. TrainRefuellingStation, StationaryEngine)
UID | - Number (integer) - the unique ID of the building object - Required |
int ModBuilding.GetRotation | ( | int | UID | ) |
Get a building rotation
UID | - Number (integer) - The unique ID of the building object - Required |
bool ModBuilding.IsBuildingActuallyFlooring | ( | int | UID | ) |
Get if this building is actually of type flooring (Flooring is a type of building)
UID | - Number (integer) - the unique ID of the building - Required |
bool ModBuilding.IsBuildingSaveable | ( | int | UID | ) |
Get boolean of if building can be saved (is not a temp building)
UID | - Number (integer) - The unique ID of the building object - Required |
void ModBuilding.RegisterForBuildingEditedCallback | ( | int | BuildingUID, |
DynValue | Callback | ||
) |
Register for a building edited callback
BuildingUID | - Number (integer) - The unique ID of the building object - Required |
Callback | - Function to be called when building is edited (EditType: Rotate, Move, Rename, Destroy) |
void ModBuilding.RegisterForBuildingTypeSpawnedCallback | ( | string | NewTypeString, |
DynValue | Callback | ||
) |
Register for a callback when building of type spawned
ObjectType | - String - The 'Type' of building |
Callback | - Function to be called when building is destroyed |
void ModBuilding.RegisterForNewBuildingInAreaCallback | ( | int | StartX, |
int | StartY, | ||
int | EndX, | ||
int | EndY, | ||
DynValue | Callback | ||
) |
Register a callback for when a building is moved into or created within a specific area
int | - StartX |
int | - StartY |
int | - EndX |
int | - EndY |
CallbackFunction | - Function - The function to callback to on event - Required |
bool ModBuilding.SetBuildingName | ( | int | UID, |
string | BuildingName | ||
) |
Set a building name
UID | - Number (integer) - The unique ID of the building object - Required |
BuildingName | - String - New name for the building - Required |
void ModBuilding.SetBuildingWalkable | ( | string | NewTypeString, |
bool | CanBeWalkedThrough | ||
) |
Set a building to be walked through (like a door/arch)
NewTypeString | - String - The building type to search for - Required |
CanBeWalkedThrough | - Boolean - If this custom building can be walked through - Required |
bool ModBuilding.SetRotation | ( | int | UID, |
int | Rotation | ||
) |
Set a building rotation
UID | - Number (integer) - The unique ID of the building object - Required |
Rotation | - int - New rotation for the building between 0 and 3 - Required |
void ModBuilding.ShowBuildingAccessPoint | ( | string | NewTypeString, |
bool | EnableAccessPoint | ||
) |
Set a building access point to be visible/invisible
NewTypeString | - String - The building type to search for - Required |
EnableAccessPoint | - Boolean - If this custom building access point is enabled (visible) - Required |
void ModBuilding.UnregisterForBuildingEditedCallback | ( | int | BuildingUID | ) |
Unregister for a building edited callback
BuildingUID | - Number (integer) - The unique ID of the building object - Required |
void ModBuilding.UnregisterForNewBuildingInAreaCallback | ( | int | StartX, |
int | StartY, | ||
int | EndX, | ||
int | EndY | ||
) |
Unregister a callback for when a building is moved into or created within a specific area
int | - StartX |
int | - StartY |
int | - EndX |
int | - EndY |