Radial Blur

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting(Redirected from HPL3/Scripting/Radial Blur)
Jump to navigation Jump to search


This page describes SOMA’s Radial Blur effect.

Radial blur is configured by amount, size and distance from the image center at which blurring starts. Instances remain active until faded out; FadeOut invalidates the removed ID.

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_RadialBlur_Start

Starts a radial blur effect, will be active until Effect_RadialBlur_FadeOut() is called Multiple instances of radial blur can be active at the same time

Parameter Meaning
afSize size of the blur, screen size, looks good 0.01-0.1
afAlpha how visible the blur is
afStartDistance how far away from the center the blur should start
afTime time to fade in

In maps/chapter04/04_03_tau_escape/04_03_tau_escape.hps, SOMA calls Effect_RadialBlur_Start as follows.

Effect_RadialBlur_Start(0.1f,0.1f,0.75f,0.0f);
Parameter Value in this stock call
afSize 0.1f
afAlpha 0.1f
afStartDistance 0.75f
afTime 0.0f

This is an excerpt from that stock script; its referenced names and variables belong to that script.

Effect_RadialBlur_FadeOut

Fades out this instance and removes it. The ID is invalid after this has been called

Parameter Meaning
alID id to the instance to fade out
afTime fade time

In maps/chapter01/01_04_transport_station/01_04_transport_station.hps, SOMA calls Effect_RadialBlur_FadeOut as follows.

Effect_RadialBlur_FadeOut(mlRadialBlurID, 3);
Parameter Value in this stock call
alID mlRadialBlurID
afTime 3

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.

See also