If you’re looking for the subsystems that SML provides by default, check out the Registry page.
Subsystems are actors that exist only once in the world (similar to Singletons, but not quite) as an instance general manager. These subsystems are accessible from anywhere you have a world context available (f.e. actors). Subsystems allow you to implement custom game state information, for example, that you want to have saved to the save file, or when you want to manage multiple actors or some system from one central point.
For example, the mod Light It Up uses subsystems to create a lamp group system. With this system, every lamp can get information about the current group settings without storing that data again in each lamp instance.
Subsystems can exist on host, client, or both sides of a multiplayer game, possibly replicated, depending on their Replication Policy setting.
If you’re implementing a subsystem in C++ and you override BeginPlay or EndPlay, be sure to call the super functions, or the subsystem will not be handled correctly.
If you want to have a subsystem you will need at least one class that inherits the
To register a subsystem, you should add it to the
Mod Subsystems array of the
Game World Module.
The subsystems are held by the
SubsystemActorManager, that can be obtained using the
As long as you have correctly registered the subsystem, there is no need to for you to spawn its actor - SML will take care of spawning it for you.
If the actor doesn’t seem to be spawning for some reason, make sure that you have correctly configured its Replication Policy.
A subsystem itself is an actor inheriting from
You can also use subsystems to store data to save states.
You should use the
GetSubsystemActor function to reference your desired subsystem.
The first parameter of the function is a reference to your
SubsystemActorManageracquired using the
The second parameter is just a name for the actor in this example
Consider checking if the retrieved subsystem is valid before trying to do anything with it.