GameDataObjects are scriptable objects used in PlateUp! to create a large number of everything you see on the screen, from Appliances, Items, and even the floor you walk on.
As with everything there will be some exceptions to this rule such as Doors, and UI (There is likely more that we still haven't discovered)
As we've previously established, GameDataObjects are scriptable objects, these objects are made in the Unity Editor, but we unfortunately don't have access to this, KitchenLib have built a work-around which we will explain later.
GameDataObjects all have individual IDs, and all derive from the GameDataObject
class. These are all in a List<GameDataObject>
and stored inside GameData
. This is done inside GameDataConstructor.BuildGameData()
.
KitchenLib has provided developers a way to create their own GameDataObjects without the need of the Unity Editor.
When creating a Custom GameDataObject you will need to create a class deriving from the Custom class.
ie. MyNewAppliance : CustomAppliance
, each Custom GameDataObject class provides a number of fields which can be overrided allowing developers to make edits to their GameDataObject.
public class MyNewAppliance : CustomAppliance
{
public override int BaseGameDataObject => ApplianceReferences.Hob; // This is defining an existing GameDataObject to base ours off (In this case, the Hob).
public override List<(Locale, ApplianceInfo)> InfoList => new List<(Locale, ApplianceInfo)>
{
(
Locale.English, // This is defining this localisation is for English.
new ApplianceInfo
{
Name = "My New Appliance" // This is setting the Name for our Appliance.
Description = "Super Cool Appliance!" // This is setting the Description for our Appliance.
}
)
};
}
Once you've created this GameDataObject you'll need to register it, we suggest registering it inside of OnPostActivate(Mod mod)
which can be overriden inside your Main
class.
protected override void OnPostActivate(Mod mod) // This method is called as soon as your mod is loaded.
{
AddGameDataObject<MyAppliance>(); // This method is what registers our GameDataObject.
}
Alternatively you are able to add the IRegisterGDO
interface to your GameDataObject class, which will automatically register it, or you can add the IAutoRegisterALl
interface to your main mod class which will automatically find and register all GameDataObject which are not tagged as IDontRegister
KitchenLib offers a "Custom" variant of most GameDataObjects which contains their existing variables as well as some extra utility variables.
This list is up-to-date as of 26/AUG/2023 - PlateUp! v1.1.7b - KitchenLib v0.8.0b5