Hint Usage – Arma Reforger
This tutorial explains the Hint system.
Config Creation
Create a config that inherits from SCR_HintUIInfo; this config has a lot of customisation options.
Name
Hint's title - should be as short as possible.
Description
The text displayed in the hint.
Icon
This will be shown right below the title. If an imageset is provided, the desired icon from the set needs to be set in Icon Set Name below.
Icon Set Name
The icon name if an imageset has been provided in Icon.
Description Blocks
The text displayed in the hint; like Description, but allows for more customisation.
Details
Description blocks can be seen like building blocks with which you build your Hint.
There are different types of description blocks that each have their own purpose.
Block | Description | Properties |
---|---|---|
ActionBlockUIName |
This is used to display key binds. Automatically changes between keyboard and gamepad. |
|
BulletPointUIName | This is just a Text that has a Bullet point in front of it. |
|
DeviceBlockUIName | This is a normal description block that can be shown when selected Input device is used. |
|
ImageBlockUIName | This allows you to insert an Image into the Text. Other than the Icon, this can be anywhere in the text. Can be either from an imageset or a normal image. Size and color can be changed. |
|
KeyBlockUIName | This works like the 'ActionBlockUIName' with the difference, that you are not limited to an action but can show custom key binds. |
|
SimpleTextBlockUIName | This can be used as a sub header. An easy way to make the text bold, italic, etc. Can be formatted into "H1, H2, P, B, I". |
|
SubBlockUIName | This is just a normal text with no special stuff |
|
TipBlockUIName | This can be used as a small Tip. Gets a tip icon in front of it. Has lower opacity and is slightly grey. |
|
Type
When defined, the hint can be shown only a certain amount of times (defined by the Show Limit property below)
Show Limit
Determines how often the hint will be shown; if set to 1 the hint is only shown once and then never again, even after game restart.
Priority
Sets the priority of the hint over other hints:
- If the priority if higher or equal to the currently shown hint, this hint will be shown.
- If the priority is less than the currently shown hint, the hint will only be shown once the current hint disappears.
Duration
Defines how long the hint will be visible; if set to 0, set time from HintManager will be used, if set to -1 the hint will stay on screen until closed manually.
Highlight Widgets Names
Highlights widgets with the provided names - useful for explaining widgets usage in a menu.
Is Timer Visible
If enabled, a timer bar will appear at the top of the hint:
- If a duration is set the bar will behave like a timer.
- When the bar finishes its animation, the hint is hidden automatically.
- If no duration is set, the bar stays static and does not move.
Field Manual Link
If set, an option to open the Field Manual to the selected page will be added to the hint.
Script Creation
To create a Hint in script create a new script or use an existing one. In there create a new variable for SCR_HintUIInfo.
Then using the SCR_HintUIInfo.CreateInfo() method you can create a hint with your own parameters.
This is a example on how to create a hint in script using a SCR_ScriptedWidgetComponent:
And to show the hint:
Config Modification
To edit a hint that was created in a config you first need to get a reference to it. The easiest way to do that is to create a variable in your script, make it an attribute and assign your SCR_HintUIInfo config to it. With this done you are able to edit the following things in your hint:
- Description
- Title
- Text in your description blocks
Script Modification
Editing a Hint you previously created in your script is the easiest. Take the variable that holds the just change the values you want.
Hint Sequence Creation
To create a Hint sequence, it is recommended to first create the different configs for each hint as shown above. It is also possible to create the different hints inside the sequence config to have less configs.
- Create a config that inherits from SCR_HintSequenceList
- Insert or create your hints in the Hints array - hints will be displayed in the order of the array, from first to last
- Create an entity (or use an existing one in your world) and attach the SCR_HintSequenceComponent to it
- In that component, assign your Sequence config to the Sequence attribute
Show the Sequence
In script, get a reference to your entity and find its SCR_HintSequenceComponent.
With the reference to the SCR_HintSequenceComponent you can then start/stop the sequence as well as listen to its OnSequenceChange() invoker.
Method | Description |
---|---|
GetOnSequenceActive | Get the event triggered when the hint sequence starts or stops.
return Script invoker. |
IsSequenceActive | Check if the hint sequence is currently active.
return True when active. |
StartSequence | Start the hint sequence defined in the SCR_HintSequenceComponent. |
StopSequence | Stop the hint sequence defined in the SCR_HintSequenceComponent. |
ToggleSequence | Toggle the hint sequence defined in the SCR_HintSequenceComponent.
Stops the sequence if it is active and starts it if it is not. |