Blueprint Library

The most up to date information about SML blueprint library functions is the header files present in the source code.

This page may fall behind what is actually available.

SML provides numerous helpful blueprint function libraries, and even some custom K2 nodes, allowing you to interact with the engine, Satisfactory, or the mod loader itself from blueprints with relative ease.

Logging

The mod loader provides a blueprint function library Blueprint Logging Library that exposes some logging features to blueprints. This allows you to log messages in different verbosity states.

The output will be displayed in the SML console (if enabled in your config) and in FactoryGame.log in your %LOCALAPPDATA%\FactoryGame\Saved\Logs folder.

If you want to log something from C++, we suggest you use Unreal’s default logging systems instead. It would be best to create your own log category for your mod.

You can read more about logging on the Unreal Engine docs and the Logging page.

LogVerbose(String str)

Logs the given string in the "verbose-level".

LogDisplay(String str)

Logs the given string in the "display-level".

LogWarning(String str)

Logs the given string in the "warning-level".

LogError(String str)

Logs the given string in the "error-level".

LogFatal(String str)

Logs the given string in the "fatal-level". Causes the game to crash.

Custom K2 Nodes

Sort Array

When supplied with an array of any type and a comparator function, the array elements will be sorted in place using the comparator function to determine which elements are greater/less than others.

After hooking up the array pin, [Create a matching function] will appear as an option in the in the Select Function dropdown which, when selected, will create a function stub with the correct function signature.

The comparator function should return true when item A is "less" than item B, meaning that A will be sorted before B.

Use TArray::StableSort instead of this node when working in C++.

Hooking

BindOnBPFunction(const TSubclassOf<UObject> Class, FObjFunctionBind Binding, const FString FunctionName, bool HookOffsetStart)

Allows binding an event to a function that is implemented in blueprint.

HookOffsetStart controls if your event will be called before or after the hooked function.

Config

This section was written while the SML Configuration system was still being developed. As such, these partially out of date, and are still being worked on. If you would like to use this system, you should read this page first, and reach out on the Discord if you have questions.

The Blueprint Interface also provides the ability to save and load configurations via Blueprint.

As config you can pass any kind of custom struct. But only the following types will be parsed properly:

  • String

  • Float

  • Integer

  • Bool

  • other Structs

  • Arrays of any of the above allowed types

You should create a custom Structure (Create Advanced Asset > Blueprints > Structure) to hold all of the configs for your mod

Here is an example of a Blueprint function that that can be called to reload config. Note that this function simply returns the loaded config struct - what is done with the values is handled by the caller of the function. Notice the usage of variables and the separation of the variable wires. The struct variable is read from multiple times as opposed to the wire being reused. This is intentional, since reusing the wire means that the loaded config values don’t get used. image

void SaveConfig(String modid, Struct config)

Dumps the given config struct as a Json and saves it as the config file for the mod with the given name. You can find it in the configs folder of your Satisfactory install.

void LoadConfig(String modid, Struct& config)

Parses the config file of the given mod id to the attributes of the passed in config struct. You should pass it a variable that contains an instance of your config struct. It will then modify that instance to have the values read from the config file. You can define the default values for each property in your custom struct definition. Settings not present in the config file will be left unmodified in the config struct. Settings present in the config file which don’t have a corresponding attribute in the config struct simply get ignored.

void StructToJson(String& String, bool UsePrettyPropertyNames, Struct Structure)

Converts the given structure to a string, storing it at the passed String address. If UsePrettyPropertyNames is true, the property names will look more human readable.

Note that the SaveConfig function does this automatically.

void StructFromJson(String String, bool UsePrettyPropertyNames, Struct& Structure)

Converts the given json String to a structure. Make sure that UsePrettyPropertyNames is enabled if it was enabled when producing the json via StructToJson.

Note that the LoadConfig function does this automatically.

Blueprint Mod Loading Library

The Blueprint Mod Loading Library provides functions to interact with the modloading process.

bool IsModLoaded(String ModReference)

This function takes a mod reference as input and checks if any kind of mod with that reference got loaded or not.

Array<String> GetLoadedMods()

This function returns the mod references of all currently loaded mods in an array.

ModInfo GetLoadedModInfo(String ModReference)

This function allows you to access additional information about the mod with the given reference.

Texture2D LoadModIconTexture(String ModReference, Texture2D FallbackIcon)

This function allows you to load the mod icon of the mod with the given reference as a Texture2D. If no Texture or mod is found, the function will return the fallback icon.

Version GetSMLVersion()

This function allows you to retrieve the version of the currently installed mod loader.

bool IsDevelopmentModeEnabled()

This function allows you to easily check if the SML development mode is activated.

Map<Name, String> GetExtraModLoaderAttributes()

Returns extra attributes exposed by the mod loader implementation.

Version Library

The Blueprint Version Library provides a couple of functions that allow you to interact with the version system more easily and generally helps you out with some stuff.

bool ParseVersionString(String String, out Version OutVersion, out String ErrorMessage)

This function tries to create a FVersion object from the provided string. Returns true if able to convert the string successfully and if not, sets the ErrorMessage accordingly.

String Conv_VersionToString(FVersion Version)

Converts the given version structure to a string.

bool ParseVersionRangeString(String String, out VersionRange OutVersionRange, out String OutErrorMessage)

Tries to convert the given string into a Version Range struct. Returns true if it was able to do so, and if not, sets the error message accordingly.

String Conv_VersionRangeToString(FVersionRange VersionRange)

Converts the given version range structure to a string.

bool Matches(VersionRange VersionRange, Version Version)

Returns true if the provided version matches the given version range.

FVersion

This struct contains information about a SemVer compatible version in a parsed state.

Member Fields

  • int64 Major (read only)

    The major SemVer version number

  • int64 Minor (read only)

    The minor SemVer version number

  • int64 Patch (read only)

    The SemVer patch number

  • String Type (read only)

    The version type of this SemVer version.

    Can be:

    • "alpha"

    • "beta"

    • "release"

  • String BuildInfo (read only)

    Additional information to the version build.

FModInfo

This struct contains information about a loaded mod. Mainly contents of the data.json of the mod.

Member Fields

  • String ModId (read only)

  • String Name (read only)

    The display name of the mod

  • FVersion Version (read only)

    The version of the mod

  • String Description (read only)

    The description of the mod

  • Array<String> Authors (read only)

    The names of the authors of the mod in a list.

  • String Credits (read only)

    Credits of the mod

Blueprint Reflection Library

The Blueprint Reflection Library provides a couple function for interacting with the unreal reflection system from within Blueprints.

ReflectedObject ReflectObject(Object Object)

Allocates a reflected object wrapper for the given object.

ReflectObject ReflectStruct(DynamicStructInfo StructInfo)

Allocates a reflected object wrapper for the given struct.

Object DeflectObject(ReflectedObject ReflectedObject)

Deflects reflected object wrapper to the raw object pointer.

void DeflectStruct(ReflectedObject ReflectedObject, out DynamicStructInfo StructInfo)

Deflects reflected object wrapper into the passed struct out variable.

Array<ReflectedPropertyInfo> GetReflectedProperties(ReflectedObject ReflectedObject)

Returns a list of reflected properties provided by the given object

uint8 GetByteProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the byte property with the given name at the given array index in the given reflected object.

void SetByteProperty(ReflectedObject ReflectedObject, String PropertyName, uint8 Value, int ArrayIndex)

Updates the value of the byte property with the given name at the given array index in the given reflected object.

int64 GetInt64Property(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the 64-bit signed integer property with the given name at the given array index in the given reflected object.

void SetInt64Property(ReflectedObject ReflectedObject, String PropertyName, int64 Value, int ArrayIndex)

Updates the value of the 64-bit signed integer property with the given name at the given array index in the given reflected object to the given new value.

int32 GetInt32Property(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the 32-bit signed integer property with the given name at the given array index in the given reflected object.

void SetInt32Property(ReflectedObject ReflectedObject, String PropertyName, int32 Value, int ArrayIndex)

Updates the value of the 32-bit signed integer property with the given name at the given array index in the given reflected object to the given new value.

float GetFloatProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the floating point property with the given name at the given array index in the given reflected object.

void SetFloatProperty(ReflectedObject ReflectedObject, String PropertyName, float Value, int ArrayIndex)

Updates the value of the floating point property with the given name at the given array index in the given reflected object to the given new value.

String GetStringProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the string property with the given name at the given array index in the given reflected object.

void SetStringProperty(ReflectedObject ReflectedObject, String PropertyName, String Value, int ArrayIndex)

Updates the value of the string property with the given name at the given array index in the given reflected object to the given new value.

bool GetBoolProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the boolean property with the given name at the given array index in the given reflected object.

void SetBoolProperty(ReflectedObject ReflectedObject, String PropertyName, bool Value, int ArrayIndex)

Updates the value of the boolean property with the given name at the given array index in the given reflected object to the given new value.

Name GetNameProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the name property with the given name at the given array index in the given reflected object.

void SetNameProperty(ReflectedObject ReflectedObject, String PropertyName, Name Name, int ArrayIndex)

Updates the value of the name property with the given name at the given array index in the given reflected object to the given new value.

Text GetTextProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the text property with the given name at the given array index in the given reflected object.

void SetTextProperty(ReflectedObject ReflectedObject, String PropertyName, Text Text, int ArrayIndex)

Updates the value of the text property with the given name at the given array index in the given reflected object to the given new value.

Object GetObjectProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the object property with the given name at the given array index in the given reflected object.

void SetObjectProperty(ReflectedObject ReflectedObject, String PropertyName, Object Object, int ArrayIndex)

Updates the value of the object property with the given name at the given array index in the given reflected object to the given new value.

FReflectedObject GetStructProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the struct property with the given name at the given array index in the given reflected object.

void SetStructProperty(ReflectedObject ReflectedObject, String PropertyName, FReflectedObject Struct, int ArrayIndex)

Updates the value of the struct property with the given name at the given array index in the given reflected object to the given new value.

ReflectedEnumValue GetEnumProperty(ReflectedObject ReflectedObject, String PropertyName, int ArrayIndex)

Retrieves the value of the enum property with the given name at the given array index in the given reflected object.

void SetEnumProperty(ReflectedObject ReflectedObject, String PropertyName, ReflectedEnumValue Value, int ArrayIndex)

Updates the value of the enum property with the given name at the given array index in the given reflected object to the given new value.

ReflectedObject

Describes a reflected object.

ReflectedEnumValue

Describes a reflected enumeration value.

Enum EnumerationType

The unreal type of the enumeration.

int64 RawEnumValue

The enumeration value represented as raw integer.

Reflected Property Info

Describes a single reflected property accessible to blueprints.

Name PropertyName

The name of the property.

ReflectedPropertyType PropertyType

The type of the reflected property.

int32 ArrayDim

Dimensions of the fixed-size property array.

ReflectedPropertyType

Enum that describes the type of the reflected property.

  • Invalid

  • Byte

  • Int

  • Int64

  • Float

  • String

  • Boolean

  • Name

  • Text

  • Struct

  • Object

  • Enum