Flash
Jump to navigation
Jump to search
SOMA provides the Flash script in script/effects/Effect_Flash.hps.
Flash temporarily fades exposure up and back down to produce a white flash. It is a screen exposure effect, while LightFlash_Add creates a light in the world.
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_effects.hps"
Effect_Flash_Start
Fades exposure in and out to create a white flash effect.
| Parameter | Meaning |
|---|---|
afFadeIn |
time to fade in. |
afWhite |
time to remain at the max exposure. |
afFadeOut |
time to fade out. |
In maps/_e3/_e3_01_02/_e3_01_02.hps, SOMA calls Effect_Flash_Start as follows.
Effect_Flash_Start(0.5f,1.5f,1.0f);
| Parameter | Value in this stock call |
|---|---|
afFadeIn |
0.5f
|
afWhite |
1.5f
|
afFadeOut |
1.0f
|
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.