Image Trail
This page describes SOMA’s Image Trail effect.
Image trail blends previous frames into the current image. Multiple instances can be active, with the strongest amount used; FadeOut removes an instance and Clear removes all effects.
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_ImageTrail_Start
Image trail blends the image of multiple previous frames over time, multiple instances can be active at the same time The strongest instance of image trail will be used
| Parameter | Meaning |
|---|---|
afAmount |
how much of the previous frame should be blended, values from 0-inf, 0 = disabled |
afFadeInTime |
how long it should take to fade to fade in |
afStayTime |
how long it will stay before starting to fade out. If <0, then it stays for ever. |
afFadeOutTime |
how long it will take to fade out |
In maps/02_06_theta_tunnels_old/02_06_theta_tunnels.hps, SOMA calls Effect_ImageTrail_Start as follows.
Effect_ImageTrail_Start(0.5,1,10,8.0);
| Parameter | Value in this stock call |
|---|---|
afAmount |
0.5
|
afFadeInTime |
1
|
afStayTime |
10
|
afFadeOutTime |
8.0
|
This is an excerpt from that stock script; its referenced names and variables belong to that script.
Effect_ImageTrail_FadeOut
Fades out an active instance of image trail
| Parameter | Meaning |
|---|---|
alID |
id of the trail instance, returned by _Start |
afFadeOutTime |
how long it will take to fade out |
In maps/chapter03/03_01_omicron_outside/03_01_omicron_outside.hps, SOMA calls Effect_ImageTrail_FadeOut as follows.
Effect_ImageTrail_FadeOut(mlImageTrailId, 2);
| Parameter | Value in this stock call |
|---|---|
alID |
mlImageTrailId
|
afFadeOutTime |
2
|
This is an excerpt from that stock script; its referenced names and variables belong to that script.
Effect_ImageTrail_Clear
Clears all effects
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.