Hint Handler
The Hint Handler displays localized hint text and tracks hints already given. The convenience helpers choose a Hint, Information, Danger or Alert header; the Hold variants return a candidate ID that can later be released.
Contents
Before you start
- Open the map script inside your own mod. Keep its generated includes,
cScrMap : iScrMapclass and callback structure. See Add your first script if you have not edited a map script yet. - Add the helper include shown below alongside the script’s other includes.
- Read the stock example before copying its calls: named entities, voice subjects, materials and callbacks must belong to the map or resources you are using.
Follow the stock example
#include "helpers/helper_modules.hps"
Hint_ShowHint
In maps/chapter00/00_03_laboratory/00_03_laboratory.hps, SOMA calls Hint_ShowHint as follows.
Hint_ShowHint("Hints", "HintRun", true);
| Parameter | Value in this stock call |
|---|---|
asTextCat |
"Hints"
|
asTextEntry |
"HintRun"
|
abIsInputHint |
true
|
This is an excerpt from that stock script; its referenced names and variables belong to that script.
Hint_ShowHint_Hold
In script/player/PlayerState_Interact_Grab.hps, SOMA calls Hint_ShowHint_Hold as follows.
mlHintID = Hint_ShowHint_Hold("Hints", "HintGrab", true);
| Parameter | Value in this stock call |
|---|---|
asTextCat |
"Hints"
|
asTextEntry |
"HintGrab"
|
abIsInputHint |
true
|
This is an excerpt from that stock script; its referenced names and variables belong to that script.
Hint_Release
In script/player/PlayerState_Interact_Grab.hps, SOMA calls Hint_Release as follows.
Hint_Release(mlHintID);
| Parameter | Value in this stock call |
|---|---|
alID |
mlHintID
|
This is an excerpt from that stock script; its referenced names and variables belong to that script.
Check your change
Save the script and restart the map in development mode with F5. If the script fails, open F1 and use Show Error List or Show HPL Log. See the development loop for the launch and debugging steps.