Hint Usage – Arma Reforger
Lou Montana (talk | contribs) m (Lou Montana moved page Arma Reforger:Hint Creation to Arma Reforger:Hint Usage: Name standard) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
=== Name === | === Name === | ||
Hint title - should be as short as possible. | Hint's title - should be as short as possible. | ||
=== Description === | === Description === | ||
Line 93: | Line 93: | ||
When defined, the hint can be shown only a certain amount of times (defined by the {{Link|#Show Limit}} property below) | When defined, the hint can be shown only a certain amount of times (defined by the {{Link|#Show Limit}} property below) | ||
=== Show Limit === | === Show Limit === | ||
{{Feature|informative| | {{Feature|informative|{{GVI|armaR|1.0.0}} This property has currently no effect.}} | ||
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. | 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. | ||
Line 132: | Line 131: | ||
Then using the <enforce inline>SCR_HintUIInfo.CreateInfo()</enforce> method you can create a hint with your own parameters. | Then using the <enforce inline>SCR_HintUIInfo.CreateInfo()</enforce> method you can create a hint with your own parameters. | ||
{{Feature|important|A Hint created in script does not support Description blocks and as of right now | {{Feature|important|{{GVI|armaR|1.0.0}} A Hint created in script does not support Description blocks and as of right now only works with title and description.}} | ||
This is a example on how to create a hint in script using a {{Link/Enfusion|armaR|SCR_ScriptedWidgetComponent}}: | This is a example on how to create a hint in script using a {{Link/Enfusion|armaR|SCR_ScriptedWidgetComponent}}: | ||
Line 140: | Line 139: | ||
override void HandlerAttached(Widget w) | override void HandlerAttached(Widget w) | ||
{ | { | ||
string description = "#AR-LocalisedDescription"; // see {{Link|#Description}} - this text is localised | string description = "#AR-LocalisedDescription"; // see {{Link|#Description}} - this text is localised | ||
float duration = | string name = "Hint's title"; // see {{Link|#Name}} | ||
float duration = 10; // see {{Link|#Duration}} | |||
EHint type = EHint.UNDEFINED; // see {{Link|#Type}} | EHint type = EHint.UNDEFINED; // see {{Link|#Type}} | ||
bool isTimerVisible = true; // see {{Link|#Is Timer Visible}} | |||
// | // each entry in the EFieldManualEntryId enum represents a specific FieldManual entry | ||
// | // if set, a Field Manual button will appear in the hint, leading to said entry | ||
EFieldManualEntryId fieldManualEntry = EFieldManualEntryId.NONE; // see {{Link|#Field Manual Link}} | EFieldManualEntryId fieldManualEntry = EFieldManualEntryId.NONE; // see {{Link|#Field Manual Link}} | ||
// create the hint with the information set above | |||
// this will only create the Hint but not show it - to show it, a call to SCR_HintManagerComponent.ShowHint() is required | |||
// | |||
// SCR_HintUIInfo is an object with all the set information stored inside. | // SCR_HintUIInfo is an object with all the set information stored inside. | ||
TAG_HintInfo = SCR_HintUIInfo.CreateInfo( | TAG_HintInfo = SCR_HintUIInfo.CreateInfo(description, name , duration, type, fieldManualEntry, isTimerVisible); | ||
} | } | ||
} | } | ||
Line 161: | Line 159: | ||
And to show the hint: | And to show the hint: | ||
<enforce> | <enforce> | ||
// | // this will show the Hint immediately. | ||
// | // if there is another hint currently shown it will be replaced with this one. | ||
SCR_HintManagerComponent.ShowHint(TAG_HintInfo); | SCR_HintManagerComponent.ShowHint(TAG_HintInfo); | ||
</enforce> | </enforce> | ||
Line 207: | Line 205: | ||
Editing a Hint you previously created in your script is the easiest. Take the variable that holds the just change the values you want. | Editing a Hint you previously created in your script is the easiest. Take the variable that holds the just change the values you want. | ||
{{Feature|informative| | {{Feature|informative|{{GVI|armaR|1.0.0}} It is currently only possible to change the hint's description and label. Methods to change other attributes will be added later®.}} | ||
<enforce> | <enforce> | ||
Line 217: | Line 215: | ||
override void HandlerAttached(Widget w) | override void HandlerAttached(Widget w) | ||
{ | { | ||
// | // create the hint as we did in the example earlier. | ||
TAG_HintInfo = SCR_HintUIInfo.CreateInfo(hintDescription, hintName, duration, type, fieldManualEntry, isTimerVisible); | TAG_HintInfo = SCR_HintUIInfo.CreateInfo(hintDescription, hintName, duration, type, fieldManualEntry, isTimerVisible); | ||
// | // change the description of the Hint. | ||
TAG_HintInfo.SetDescription("This is a new description"); | TAG_HintInfo.SetDescription("This is a new description"); | ||
// | // change the label of the Hint. | ||
TAG_HintInfo.SetName("This is a new name"); | TAG_HintInfo.SetName("This is a new name"); | ||
// | // if the hint is already shown, it can be updated immediately using this | ||
SCR_HintManagerComponent.Refresh(); | SCR_HintManagerComponent.Refresh(); | ||
} | } |
Latest revision as of 23:37, 29 September 2024
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. |