|
Storm Game Framework 2.0.0
User guide
|
Add a help screen to the same project. You will give CommonUI a layout, register the screen by tag, and open it for the local player once the character is ready.
Complete Add your first game rule. Keep CommonGameViewportClient configured as described in dashboard settings.
Add the gameplay tag UI.Widget.Tutorial.Help in your project's Gameplay Tags settings.
Enable Show Plugin Content and open SGF Content > SGFUI > UI > Examples. Copy WB_StormPrimaryLayout_Example and DA_StormWidgetRegistry_Example into Tutorial/UI. Name the copies WB_TutorialLayout and DA_TutorialWidgetRegistry.
The layout owns the actual CommonUI layer stacks. The registry maps screen tags to widget classes and destination layers. Its layer definitions must agree with the stack registrations in the layout.
Open both copies. Keep the existing layer table and the layout's Construct-time Register Layer Stack calls. Use the existing UI.Layer.Menu stack layer for help. Its registry definition and stack registration must use that same tag; a registry entry alone does not create a stack.
On WB_TutorialLayout, provide Get Desired Input Config with Input Mode = Game and Mouse Capture Mode = Capture Permanently Including Initial Mouse Down. The active help screen overrides it; closing the screen restores the gameplay configuration. Keep input-mode changes in CommonUI's active widget configuration.
For Back handling in a blank project, open Project Settings > Game > Common Input Settings and select the engine CommonUI plugin's GenericInputData as Input Data if no project input data is configured. Its Back action supplies the standard bindings. Existing projects should keep their own CommonUI input data and check its Back binding. In PIE, Escape may be reserved to stop play; use the Close button and repeat the Back test in a standalone game or package.
In DA_TutorialWidgetRegistry > Widgets, add an entry:
| Field | Value |
|---|---|
| Widget Tag | UI.Widget.Tutorial.Help |
| Widget Class | WB_TutorialHelp |
| Layer Tag | UI.Layer.Menu |
| Pause Policy | None, so this also works in the multiplayer tutorial. |
| Duplicate Policy | BringToFront |
| Suppress While Loading | Enabled. |
In Project Settings > Game > Storm UI, set Default Primary Layout Class to WB_TutorialLayout and Widget Registry to DA_TutorialWidgetRegistry. Keep Auto Create Layout on Player Controller Ready enabled. Save.
Create a Blueprint child of StormNativeHumanoidController, named BP_TutorialController, in Tutorial/UI. This retains the camera controller selected in the character chapter and adds your screen entry point.
The entry component belongs on the player controller. Its early BeginPlay can run before Unreal assigns the local player, and a pawn's configuration readiness can arrive before its local controller. Make startup wait for both conditions:
Keep the prop's character-readiness handler from the previous chapter. Help startup belongs to this controller loop, which can observe local ownership even when it arrives after configuration readiness.
Show Entry Widget requests immediately if the layout is ready, or waits for layout readiness. It returns a Boolean describing whether it requested or arranged the screen. Missing tags and registry entries are configuration problems, reported in the Output Log.
Play the level. The help screen should appear once the local character is ready. CloseButton should receive keyboard focus. Close it using Enter or a click, confirm movement and mouse look work again, then press 7 to reopen it. Check Back in a standalone game or Development package.
With two PIE players, each local viewport should have its own layout and help screen. Opening one player's help must not open a second screen for the other player or pause the server.
| Symptom | Check |
|---|---|
| No screen appears. | Check the actual game mode/controller, readiness handler, tag, registry and selected layer. |
| The log says the layout is not routable. | Match every registry layer to a stack registration in the layout. |
| Mouse capture remains on the game. | Check both widgets' Get Desired Input Config overrides and the CommonUI viewport. |
| Back does not close it. | Check Is Back Handler, Common Input Data and the game's Back binding outside PIE. |
| Startup help is absent but 7 works. | Check the controller's startup timer, local ownership, ready pawn and timer-clear condition. |
Checkpoint: the local player can open, focus, close and reopen a screen, with CommonUI restoring gameplay input afterwards.