Predefined Effects

Since many effects are used by explosions or attached to projectiles, it is useful to predefine them outside the level and saves having to add many entities to each new level. The effect.ini file contains the definition of any effect you wish to use. The format of this file is as follows:

Each effect definition is headed by the name of the effect, enclosed in square brackets, such as [YellowLight] or [RedSpray]. This name will be used by other entities to reference this effect. Following the name, up to the next effect name or end of the file, is the information needed to define the effect. The important line here is the one starting with type = . This defines what type of effect you are working with. The different types of effects you can define are:

It is important to use the exact spelling and case of each effect type. Each different effect requires different information to be defined.

Light

This is defined by type = light. This effect has 6 variables that must have data assigned to them. They are:

totallife the number of seconds this effect will be active
intensity the brightness of the light, with a range greater than 0 and less than or equal to 1
colormax the maximum color the light can take
colormin the minimum color the light can take
radiusmax the maximum radius of the light coverage
radiusmin the minimum radius of the light coverage

The colormax and colormin entries are RGB colors and have 3 values, separated by spaces. The color of the light will be randomly chosen each frame from a value between these colors. The closer these colors are to each other, the less variation in color will occur. The radius of the light coverage will be chosen randomly each frame from a value between radiusmax and radiusmin. The closer these values are to each other, the less flicker will be shown.

Spray

This is defined by type = spray. This effect is very similar to the Spout entity and requires most of the same information to be defined. The variables that require data are:

bitmapname the name of the bitmap file used to texture each particle
alphamapname the name of the alphamap file used to assign transparency to each particle
angles the angle, in degrees for X, Y and Z, that the particles will travel away from their starting point
colormax the maximum color the particles can take
colormaxalpha the transparency amount for the maximum color. Range of 0 to 255 (solid).
colormin the minimum color the particles can take
colorminalpha the transparency amount for the minimum color. Range of 0 to 255 (solid).
sourcevariance the maximum distance that the particle start point can vary
destvariance the maximum amount the particle destination point can vary
gravity the direction, in degrees for X, Y and Z, that gravity will be applied to each particle
maxscale the maximum amount to scale each particle from the bitmap size
minscale the minimum amount to scale each particle from the bitmap size
maxspeed the maximum speed that each particle can travel
minspeed the minimum speed that each particle can travel
maxunitlife the maximum number of seconds that a particle will survive
minunitlife the minimum number of seconds that a particle will survive
particlecreationrate the number of seconds between creation of each particle
totallife the number of seconds this effect will be active
bounce if true the particles will bounce off objects. If false they will die upon collision

The colormax and colormin entries are RGB colors and have 3 values, separated by spaces. The color of each particle will be randomly chosen from a value between these two entries. The angles and gravity entries also have 3 values, separated by spaces, that define directions for the X, Y and Z axis. Note that if the spray is attached to an actor via a Predefined Explosion, angles is the number of degrees in each direction from the direction the actor is facing.

Actor Spray

This is defined by type = actorspray. It is similar to the spray effect except that it uses actors rather than textured polys as its particles. The section definition would look like this:

basename base name of sequence of actors to use as particles
numberactors number of actors in sequence
style style of using actors
alpha initial alpha value of actors
alpharate amount per second to decrease actor alpha
baserotation initial rotation of actors
minrotationspeed minimum rotation speed of actors
maxrotationspeed maximum rotation speed of actors
fillcolor fill color of actor lighting
ambientcolor ambient color of actor lighting
gravity true or false to signify if actors are subject to gravity
angles
sourcevariance
destvariance
maxscale
minscale
maxspeed the rest of these are the same as the spray effect
minspeed
maxunitlife
minunitlife
particlecreationrate
totallife
bounce
solid if true then particles are solid and can be interacted with

The sequence of actors used is similar to the bitmaps in the FlipBook. If you have 3 actors in the sequence then they must be named <name>0.act, <name>1.act and <name>2.act. The basename used would be <name>. The style can be 0, 1 or 2. A style of 0 uses the actors in increasing order (starting at 0 and going up) and wraps around to 0 at the end. A style of 1 starts in increasing order and switches to decreasing at the end, then increasing again at the beginning. A style of 2 uses them in random order. The baserotation is the initial rotation assigned to all the actors when they are created in the spray. It is in degrees. If minrotationspeed and maxrotationspeed are not zero in all axis then a speed will be randomly chosen for each axis in this range. The actor will rotate at that speed during its life. The speed is in degrees per second. An example of an actorspray effect is as follows. It has 8 actors named con0.act to con7.act. Note that if the actor spray is attached to an actor via a Predefined Explosion, angles is the number of degrees in each direction from the direction the actor is facing.

[ConSpray]
type = actorspray
basename = con
numberactors = 8
style = 2
alpha = 255
alpharate = 32
baserotation = 0 0 0
minrotationspeed = 90 90 0
maxrotationspeed = 180 180 0
angles = 0 0 0
fillcolor = 255 255 255
ambientcolor = 255 255 255
sourcevariance = 25
destvariance = 150
gravity = true
maxscale = 0.5
minscale = 0.3
maxspeed = 150
minspeed = 100
maxunitlife = 8
minunitlife = 6
particlecreationrate = 0.02
totallife = 0.5
bounce = true
solid = false

Sound

This is defined by type = sound. The only variable required by this effect is:

name    the name of the WAV file to be played

The sound file is played once for its entire length.

Sprite

This is defined by type = sprite. This effect is very similar to the FlipBook entity and requires most of the same information. The variables that must be defined are:

basebitmapname the base name of the animated bitmap files
basealphamapname base name of the alphamap files used to assign transparency to the bitmaps
bitmapcount the number of bitmaps in the animation
texturerate the number of frames per second to animate at
color the color of the bitmaps
alpha the initial transparency level of the bitmaps, range 0 to 255 (solid)
alpharate the amount per second to decrease the alpha value
scale the amount to initially scale each bitmap
scalerate the amount each second to decrease the scale of each bitmap
rotation the initial amount, in degrees, to rotate each bitmap
rotationrate the number of degrees per second to rotate each bitmap
lifetime lifetime = 10 and the sprite will terminate after a max of 10 seconds.
style The styles of the sprite are defined as:
style = none  show first frame only
style = reset  start from beginning again
style = reverse  reverse order of frames
style = random  randomly pick next bitmap

If no style is supplied then the sprite will cycle through the bitmap list from start to finish only once.

The basebitmapname and basealphamapname entries are the base name of a sequence of bitmaps. The first bitmap in the sequence must be <name>0.bmp, the second <name>1.bmp and so on, where <name> is either basebitmapname or basealphamapname. The color entry is a RGB color and has 3 values, separated by spaces. The animation is played through only once before being terminated.

Corona

This is defined by type = corona. This is the same as the Corona entity and requires the same information to be defined. The variables that must have data assigned are:

fadetime number of seconds required when corona fades
minradius minimum radius of corona
maxradius maximum radius of corona
maxvisibledistance maximum distance that corona is visible at
maxradiusdistance distance after which corona is capped at maxradius
minradiusdistance distance under which corona is capped at minradius
color color of corona
totallife the number of seconds this effect will be active

The color entry is a RGB color and has 3 values, separated by spaces.

Bolt

This is defined by type = bolt. This is similar to the ElectricBolt entity except that the terminus is an offset distance from the start position rather than a separate entity. The variables that require data are:

bitmapname name of bitmap used to texture the bolt
alphamapname name of the alphamap used to assign transparency to the bitmap
endoffset the distance in the X, Y and Z directions to add to the start position to get the end position
width the width of the bolt
numberpoints the number of polys in the bolt, must be a power of 2 (16, 32, 64, 128)
wildness how much the bolt varies from straight, range from 0 to 1(maximum variation)
intermittent if true then bolt stops and starts, if false then runs continuously
maxfrequency maximum number of seconds before intermittent bolt fires again
minfrequency minimum number of seconds before intermittent bolt fires again
dominantcolor dominant color of bolt, 0 = red, 1 = green and 2 = blue
color base color of bolt. The nondominant colors should have the same value
totallife the number of seconds this effect will be active

The color entry is a RGB color and has 3 values, separated by spaces. Note that if the bolt is attached to an actor via a Predefined Explosion, endoffset is the distance in each direction from the direction the actor is facing. If the bolt is attached to an actor the value of numberpoints must be 64 or less.

The effect.ini file already contains some predefined effects and you can look at these to see what each different effect requires.