Image Trail

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting
Revision as of 14:23, 2 October 2026 by TiMan (talk | contribs) (Add a sourced SOMA guide with explanations and stock-script examples.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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.

Before you start

  1. Open the map script inside your own mod. Keep its generated includes, cScrMap : iScrMap class and callback structure. See Add your first script if you have not edited a map script yet.
  2. Add the helper include shown below alongside the script’s other includes.
  3. 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.

See also