If you are using Python, you can use built-in accessors to access subsystems, as shown in the example below. If you add the nodes from above, you get results like the following. There are categories for each major type and individual entries for each specific subsystem. If you right-click in a Blueprint graph to display the context menu and search for "subsystems," you see something similar to the image below. You are in control of what API is available to Blueprints with the standard UFUNCTION() markup and rules. Subsystems are automatically exposed to Blueprints, with smart nodes that understand context, and that do not require casting.
#Purebasic library subsystem how to#
As a result, you can focus on how to use the API and the functionality provided in UE4. The user can just add the plugin to the game, and you know exactly when the plugin will be instanced and initialized. You do not need to have instructions about the code needed to make the plugin work. Subsystems are particularly useful when creating plugins. Subsystems provide modularity and consistency in the codebase. Subsystems enable access to Python scripts for editor scripting, or for writing test code. Subsystems enable access to Blueprints through user friendly typed nodes. Subsystems help you avoid adding more API on an already busy class.
![purebasic library subsystem purebasic library subsystem](https://miro.medium.com/max/7680/1*q9LSq-bmdo_oJyN1yoJwpw.png)
![purebasic library subsystem purebasic library subsystem](https://cdn-images.visual-paradigm.com/guide/uml/what-is-package-diagram/02-simple-package-diagram-example.png)
Subsystems help you avoid overriding engine classes.
![purebasic library subsystem purebasic library subsystem](https://wiki.rdkcentral.com/download/attachments/34046138/WiFi-Architecture.png)
There are several reasons to use programming subsystems, including the following: When UGameInstance is shut down, Deinitialize() will be called on the subsystem.Īt this point, the reference to the subsystem is dropped, and the subsystem is garbage-collected if there are no more references to it. When UGameInstance initializes, Initialize() will be called on the subsystem. For example, if you create a class that derives from this base class:Ĭlass UMyGamesSubsystem : public UGameInstanceSubsystemĪfter UGameInstance is created, an instance called UMyGamesSubsystem is also created.