|
Storm Game Framework 2.0.0
User guide
|
Start from a working checkpoint in the first-project guide. This page covers C++ integration and advanced diagnostics. Use the architecture overview to find the class or adapter that owns the operation you want to change.
Compose SGF modules in a game gives complete setup chains for asset discovery, inventory and weapons, roster-backed spawning and level travel.
Use console variables and debug commands to time traversal planning, inspect audio and retained assets, or show native animation state on screen.
Start with a project-owned Blueprint child of BP_Humanoid when you need a new composition. Use the Actor Definition for the configuration that varies per character.
For a C++ host with your own component graph, implement the capability interfaces that the systems you use require. A capability is a feature an actor offers to other systems through a StormCore interface, such as IStormInventoryOwner for inventory. For example, a pickup can locate the host's inventory through this interface.
Add StormCore to your game module. Pass an actor that implements UStormInventoryOwner to this function. The returned interface can be empty if the actor supplies no inventory.
Test your host with one pickup or grant. When another game system needs the same inventory, have it query the interface too rather than looking up a component class.
In multiplayer the server has authority: it decides the outcome of each request, and clients see the result once it replicates. See Multiplayer and networking for the wider picture.
When a player drags an item from indexed inventory to equipment, use UStormInventoryEquipmentCoordinator::RequestEquipFromPlacement. The coordinator needs the character's backing inventory and equipment, and the server must permit requests for the slot. Pass the exact item instance ID, the observed source cell, the destination slot tag and the observed occupant. An invalid occupant ID means an empty slot.
The return value on the owning client tells you only whether the request was submitted. Listen to OnRequestCompleted for the server's outcome, and update the display from replicated state once the server has accepted or refused the request. Use FStormOperationResult::FailureTag to tell a stale occupant from a permission or compatibility failure. With two PIE players, test a valid request and one based on a slot occupant that has since changed.
For a server-only operation, add StormCharacters and StormCore to your game module. Call this from an authoritative game rule after the pawn is ready and the AI controller has been spawned with a usable configuration. A controller that already possesses a pawn should produce a failure. After a successful transfer, read the controller's AI startup result separately. The NPC control handoff walks through the same steps in Blueprint.
StormSave keeps the state of actors placed in a map. The save API is C++ only: add StormSave to your game module.
Duplicating a stamped actor in the editor gives the duplicate a new ID. Only SaveGame fields are written, on the actor and on components declared in C++ or added in the Blueprint's Components panel. Components created by a construction script or added to a single placed instance are not saved. Capture also records the actor's transform. Restore reapplies that transform unless the actor is attached to another actor. Override OnStormSaveRestored to refresh visuals, such as the door's mesh rotation, after every participant has been restored.
Actors spawned during play are not saved or rebuilt in this version. If a placed participant is destroyed during play, the save records that, and a later restore removes it again.
In an authoritative game world, obtain UStormSaveSubsystem from the game instance and check each FStormSaveResult before the next step.
Repeat with an empty slot. StormSaveEditor reports missing and duplicate identities when you save or validate a map. To fail a build on them, run the StormSaveValidate commandlet, for example UnrealEditor-Cmd.exe <project> -run=StormSaveValidate -Paths=/Game/Maps. It returns a non-zero exit code when a map has a problem.
Package a Development build that includes L_SetupTest. Make sure the Asset Manager scans cover the project-owned definitions and that their cook rules include them. Run the executable directly and repeat movement, view switching and the Intermediate tasks you integrated.
If a soft-referenced asset resolves only in the editor, inspect its registered type, folder and cook rule. Repeat in the configuration you intend to ship, and test late join or map travel if your game relies on either.
Use the module index to locate another owner.