User Tools

Site Tools


modding:xml:effects

This is an old revision of the document!


Overview

An effect element is an element that defines how to paint something on the screen. For example, weapons use an <Effect> element to define how to paint a projectile. Not all effect elements are called <Effect>. For example, weapons also have a <FireEffect> element that describes how to paint the muzzle-flash for the weapon.

In all cases, an effect element contains 0 or more sub-elements called painters. Each painter defines a particular type of paint effect. For example, an <Image> painter is used to paint a bitmap. If more than one painter is specified, they are painted in order, one of top of the other.

Suggesstion for laser colors.

The following painters exist:

new in 1.06
<Beam>

<Beam>

Version: 1.06 and above.

beamType= Choose from one of many styles (list taken from TSE\SFXBeam.cpp)

  • laser
  • lightning
  • heavyblaster
  • starblaster
  • particle
  • greenparticle
  • blueparticle
  • blaster
  • greenlightning

primaryColor= Hexidecimal for the primary color.

secondaryColor= Hexidecimal for the secondary color.

intensity= Increases beam width (discovered by Hatsya)

<Bolt>

length= The length of the bolt in pixels.

width= The width of the bolt in pixels.

primaryColor= The primary color.

secondaryColor= The secondary color.

<Flare>

style= One of the following:

  • fadingBlast

radius= The radius in pixels.

lifetime= The lifetime of the effect in ticks.

<Image>

imageID= UNID of the image to use.

imageX= X-coordinate of the upper-left of the image to use.

imageY= Y-coordinate of the upper-left of the image to use.

imageWidth= Width of the image in pixels.

imageHeight= Height of the image in pixels.

lifetime= Ticks to show image.

imageFrameCount= Number of animation frames in the image. If the effect lasts longer than the number of frames then the animation starts again from the beginning.

imageTicksPerFrame= Ticks to show each frame (valid only if imageFrameCount is non-zero).

randomStartFrame= If true, then start at a random frame (valid only if imageFrameCount is non-zero).

rotationCount= Number of rotation frames.

<ImageAndTail>

Same attributes as <Image> plus the following additional attributes:

length= Length of the tail in pixels.

width= Width of the tail in pixels.

primaryColor= Primary color of the tail.

secondaryColor= Secondary color of the tail.

<MoltenBolt>

length= Length of the bolt in pixels.

width= Width of the bolt in pixels.

growth= If non-zero, the length of the bolt will increase by this number of pixels on each tick (up to a maximum of 8 ticks).

primaryColor= Primary color of bolt.

secondaryColor= Secondary color of bolt.

<Particle>

This painter is used for weapons of type=particles.

style= One of:

  • flame
  • plain
  • line
  • smoke

minWidth= The minimum width of the particle in pixels.

maxWidth= The maximum width of the particle in pixels.

primaryColor= The primary color of the particle.

secondaryColor= The secondary color of the particle.

<ParticleCloud>

Version: 1.08 and above.

This painter creates a cloud of particles with various shapes and behaviors.

style= One of:

  • cloud
  • splash

lifetime= The lifetime of the effect in ticks (expressed as a dice range). The value -1 means that the effect is immortal (lasts forever).

emitDuration= The amount of time during which the effect will create new particles. For immortal effects this is expressed as a number of ticks. For effects with a limited lifetime, this is expressed as a % of the total lifetime.

emitRate= The number of new particles to create per tick (expressed as a dice range).

emitSpeed= The speed of a newly created particle (as a percent of light speed, expressed as a dice range).

particleCount= The number of particles initially created; these will appear immediately when the effect starts. The position and velocity of the initially created particles depends on the style. This property is a dice range.

particleLifetime= The lifetime a particle in the cloud in ticks. A value of -1 means that particles live forever. This property is a dice range.

radius= For cloud effects, this is the maximum radius of the cloud. For ring effects this is the radius of the ring. (expressed in pixels).

ringWidth= For ring effects, this is the radius of the ring in pixels.

cohesion= This is a value from 0 to 100 specifying the cohesion of the particles. Higher values accelerate the particles towards the center of the effect.

viscosity= This is a value from 0 to 100 specifying the tendency of the particles to move out of their designated shape (either cloud or ring). With higher values, particles tend to stay within the effect's shape.

wakePotential= This is a value from 0 to 100 specifying the tendency of the particles to be affected by objects (such as ships) moving through them.

<ParticleEffect> This sub-element defines the effect to use to paint each particle. You may use any valid painter (or set of painters), but the <Particle> painter is the most efficient.

<ParticleComet>

width= Width of the comet in pixels.

length= Length of the comet in pixels.

particleCount= Number of particles in the comet.

primarColor= Primary color of the particles.

<ParticleExplosion>

particleCount= The number of particles in the explosion (this is a dice range).

particleSpeed= The speed of each particle in % of light-speed.

particleLifetime= The lifetime of each particle (in ticks).

lifetime= The lifetime of the effect (expressed as a dice range).

<Image> A sub-element that defines the image to use for each particle.

<PlasmaSphere>

spikeCount= The number of spikes, expressed as a dice range. The number of spikes is computed on each frame.

spikeLength= The length of each spike, in pixels, expressed as a dice range. Each spike's length is computed independently on each frame.

primaryColor= The primary color of the sphere.

secondaryColor= The secondary color of the sphere.

<Polyflash>

This painter paints a muzzle-flash. It has no attributes.

<Shape>

This painter draws a filled polygon defined by the <Point> sub-elements.

width= The width of the polygon in pixels

length= The length of the polygon in pixels.

widthInc= Each tick, the width is increased by this number of pixels.

lengthInc= Each tick, the length is increased by this number of pixels.

color= The color of the polygon.

opacity= The opacity of the polygon (0 = transparent; 255 = opaque).

directional= If true, then the polygon is oriented along the appropriate direction (e.g., the direction in which the projectile was fired).

<Point>

The <Point> sub-element determines a corner of the shape you are making. It consists only of an x and y value. Negative values are declared by placing a minus (-) sign before the value; the game will treat the value as positive otherwise.

x= The vertical location of the point. Positive value: up; negative value: down.

y= The horizontal location of the point. Positive value: left; negative value: right.

<Point x="0" y="0"/>
<Point x="-35" y="50"/>
<Point x="-100" y="0"/>
<Point x="-35" y="-50"/>

The <Point> sub-elements must be declared in clockwise or anti-clockwise order for the shape to look right. In the above example, the <Point> sub-elements are declared in a clockwise manner, creating a diamond shape.

<Shockwave>

style= One of the following:

  • glowRing
  • image

speed= The speed with which the shockwave expands (as % of light-speed).

lifetime= The lifetime of the shockwave in ticks.

fadeStart= The point at which the shockwave begins to fade (expressed as a percent of lifetime).

style=glowRing

This style paints an expanding, glowing ring. It includes the following attributes:

primaryColor= The primary color of the ring.

secondaryColor= The secondary color of the ring.

width= The width of the ring in pixels (i.e., the thickness of the ring).

glowWidth= The width of the glowing part of the ring in pixels (generally greater than the width).

style=image

This style using an image to paint the shockwave.

<Image> An element describing the image to use.

<SmokeTrail>

lifetime= The lifetime of the effect in ticks.

spread= The width of the particle spray (expressed as units proportional to the angular spread). This is a dice range.

emitDuration= The amount of time that new particles are being emitted (expressed as a percentage of total lifetime).

emitRate= The number of particles emitted on each tick. This is a dice range.

emitSpeed= The speed of each particle, as a percent of light-speed. This is a dice range.

particleLifetime= The lifetime (in ticks) of an individual particle expressed as a dice range.

<ParticleEffect> This sub-element defines the effect to use to paint each particle. You may use any valid painter (or set of painters), but the <Particle> painter is the most efficient.

<Starburst>

style= One of the following:

  • flare
  • lightningStar
  • morningStar
  • plain

lifetime= The lifetime of the effect in ticks.

spikeCount= The number of spikes to paint (this is a dice range computed on every tick).

spikeLength= The length of each spike in pixels (this is a dice range computed for each spike on every tick).

primaryColor= The primary color.

secondaryColor= The secondary color.

Suggested Colors

(Taken from here)
Lasers: red, green, or purple (in ascending order of strength)
Kinetic: gray
Particle: green, with particulate texture
Blast: flame
Ion: cyan
Thermo: flame/orange
Positron: yellow, with particulate texture
Plasma: yellow
Antimatter: yellow
Nano: various (gray/green/etc) but with complex texture
Graviton: purple/violet
Singularity: black/white/violet
Dark Acid: teal
Dark Steel: gray-green
Dark Lightning: blue
Dark Fire: red

For lasers, we should probably avoid yellow and blue (to avoid confusion with positron/antimatter and ion). If you want to create new laser styles I recommend mixing in more white (to make the beam whiter). For example, I imagine a gamma-ray laser could be white with fringes of violet/purple.

API 20 (1.3 Beta 1 )

From wolfy's post.
Beam types

lightning
lightningBolt
heavyblaster
greenparticle
blueparticle
blaster
starblaster
greenlightning
jaggedBolt

Ray types

fade
diamond
oval
straight
tapered
cone
wavy
smooth
jagged
grainy
modding/xml/effects.1394431584.txt.gz ยท Last modified: 2014/12/27 04:40 (external edit)