Registry

SML provides a few registry mechanisms for quick and easy content management.

Remote Call Object Registry

The Remote Call Object Registry is a Game Instance Subsystem that automatically registers all listed remote call objects in the Satisfactory Player Character.

You can use the Register Remote Call Object-Function to add the class of a remote call object to the registry so that it gets automatically registered in the player.

Subsystem Holder Registry

The Subsystem Holder Registry ia a Game Instance Subsystem that automatically registers all listed subsystem holders to the mod loader lifecycle. The holders are then manged by SML and called at the correct times.

You can use the Register Subsystem Holder-Function to add the class of a subsystem holder to the registry.

Mod Key Bind Registry

The Mod Key Bind Registry is a blueprint function library that provides a couple of functions that allow you to easily add your own key bindings and axis bindings to the game via the UE ActionMappings and AxisMappings system.

Since we don’t have direct access to the Satisfactory project file, we can’t add them directly to Project Settings > Engine > Input > Bindings, so instead we add them through this SML registry.

Users of your mod can edit these keybinds from the in-game keybindings screen in the options. Your keybinds will show up with the given display name grouped in a category with your mod’s name, and their set values will persist between sessions of the game.

In order to get the keybinds to show up correctly inside the Blueprint editor, you may still have to add them to the Bindings section described above.

Once the keybinds are set up, they should show up when you type their name into the new node dialog. For example, if you named a keybind DocMod.DebugPrint then you can search DocMod.DebugPrint and the node for the DocMod.DebugPrint Action Event will show up.

RegisterModKeyBind(String ModReference, InputActionKeyMapping KeyMapping, Text DisplayName)

Register a given key mapping and associates it with mod reference provided. The action name (part of the InputActionKeyMapping) should be unique and start with a "ModReference." prefix to avoid conflicts with other mods. This function will throw an exception if the action name doesn’t start with the prefix described above. You can only register two keys with the same name. One of them should be a keyboard action and another is a gamepad action (optional).

RegisterModAxisBind(String ModReference, InputAxisKeyMapping PositiveAxisMapping, InputAxisKeyMapping NegativeAxisMapping, Text PositiveDisplayName, Text NegativeDisplayName)

Registers the given axis key mappings and associate them with the given mod reference. The axis names (part of the `InputAxisKeyMapping`s) should be unique and start with a "ModReference." prefix to avoid conflicts with other mods. This function will an throw exception if the axis names don’t start with the prefix described above. Both axis mappings should have equal action names, too. Satisfactory requires all axis binds to have 2 keys with opposite directions, and they will be displayed as 2 keys in the control options too. You can only register two axis binding pairs. One of them should be a keyboard axis and the other a gamepad axis (optional).

Mod Content Registry

The Mod Content Registry is a game instance subsystem that manages registration and lifetime of any kind of modded content.

All content you create and add with your mod that is of supported types should be registered through this registry. Meaning, you should not register it yourself in the games subsystems.

This essential in ensuring that it is correctly saved, loaded, and identified by the game and other mods.

If you don’t need any of the dynamic behaviors the Mod Content Registry provides, you should use properties in your RootGameWorld_YourModReferenceHere module instance instead of calling methods on this object directly.

Note that all `UObject*`s used by Mod Content Registry functions and in `FGameObjectRegistration`s are actually `UClass*`s (since UClass is a subclass of UObject), so you must cast them to UClass first before they can be used.

In blueprint, use the "Cast to Class" node with the class of Class. In C++, use Cast<UClass>(theThing) or const_cast depending on the use case.

Schematic and Research Tree registrations are frozen on BeginPlay. After that moment, the registry is frozen and no changes can be made after that!

UModContentRegistry* Get(UObject* WorldContext)

Get the global instance of the registry.

RegisterSchematic(FName ModReference, TSubclassOf<UFGSchematic> Schematic)

Registers schematic to be usable by the game. All recipes referenced by schematic are registered automatically. All items referenced by registered recipes are associated with passed mod reference too.

You must also provide your mod reference so the content can get associated properly.

RegisterResearchTree(FName ModReference, TSubclassOf<UFGResearchTree> ResearchTree)

Registers research tree to be usable by the game. Also updates research trees so tree can be unlocked instantly if criteria are met. All schematics referenced by this research tree are registered automatically. Nodes should be of default BPD_ResearchTreeNode type to be discoverable for schematics.

You must also provide your mod reference so the content can get associated properly.

RegisterRecipe(FName ModReference, TSubclassOf<UFGRecipe> Recipe)

Registers recipe to be usable by the game. Also associates items referenced by this recipe with passed mod reference if they are not. associated with any other mod reference yet.

You must also provide your mod reference so the content can get associated properly.

RegisterResourceSinkItemPointTable(FName ModReference, UDataTable* PointTable, EResourceSinkTrack Track)

Register resource sink item points for each item row in the passed table object.

You must also provide your mod reference so the content can get associated properly.

RemoveSchematic(TSubclassOf<UFGSchematic> Schematic)

Explicitly removes the given schematic from the registry

RemoveResearchTree(TSubclassOf<UFGResearchTree> ResearchTree)

Explicitly removes the given research tree from the registry

TArray<FGameObjectRegistration> GetLoadedItemDescriptors()

Returns a list of all currently loaded item descriptors.

GetObtainableItemDescriptors(TArray<FGameObjectRegistration>& OutItemDescriptors, EGetObtainableItemDescriptorsFlags Flags)

Retrieves list of all obtainable item descriptors, e.g ones referenced by any recipe.

Use the Flags to further filter the results.

TArray<FGameObjectRegistration> GetRegisteredSchematics()

Returns a list of all currently registered schematics.

TArray<FGameObjectRegistration> GetRegisteredResearchTrees()

Returns a list of all currently registered research trees.

TArray<FGameObjectRegistration> GetRegisteredRecipes()

Returns a list of all currently registered recipes.

FGameObjectRegistration GetResearchTreeRegistrationInfo(TSubclassOf<UFGResearchTree> ResearchTree)

Returns the registration info of the given research tree.

FGameObjectRegistration GetSchematicRegistrationInfo(TSubclassOf<UFGSchematic> Schematic)

Returns the registration info of the given schematic.

FGameObjectRegistration GetRecipeInfo(TSubclassOf<UFGRecipe> Recipe)

Returns the registration info of the given recipe.

FGameObjectRegistration GetItemDescriptorInfo(TSubclassOf<UFGItemDescriptor> ItemDescriptor)

Returns the registration info of the given item descriptor.

bool IsItemDescriptorVanilla(TSubclassOf<UFGItemDescriptor> ItemDescriptor)

Returns true when given item descriptor is considered vanilla.

bool IsRecipeVanilla(TSubclassOf<UFGRecipe> Recipe)

Returns true when given recipe is considered vanilla.

bool IsSchematicVanilla(TSubclassOf<UFGSchematic> Schematic)

Returns true when given schematic is considered vanilla.

bool IsResearchTreeVanilla(TSubclassOf<UFGResearchTree> ResearchTree)

Returns true when given research tree is considered vanilla.

FOnGameObjectRegistered OnRecipeRegistered

Called when recipe is registered into content registry.

FOnGameObjectRegistered OnSchematicRegistered

Called when schematic is registered into content registry.

FOnGameObjectRegistered OnResearchTreeRegistered

Called when research tree is registered into the registry.

FGameObjectRegistration

Holds basic information about a single content registration entry.

This struct is used to hold information about all registered content types, so you must cast `UObject*`s into the relevant classes depending on what type of content you’re working with

FName RegistrarModReference

Mod reference of the plugin which actually performed the object registration. Usually same as OwnedByModReference.

FName OwnedByModReference

Mod reference of the plugin which owns the actual registered object.

UObject* RegisteredObject

The object/content this registration info holds registry information about.

EGameObjectRegistrationFlags Flags

Flags set on this object.

TArray<UObject*> ReferencedBy

List of all objects that reference this one.