Home > notes > SiegeFX

Siege FX

This note will be updated as I find out more about the parameters of the various functions, both the calls to WorldFXMgr and the "Simulations" that are added to build up an effect. Where the functions are reasonably well understood, they will link to pages that describe the known parameters and any notes on their use.

FX generic method

This may be the entire skrit for an effect, or it may be a function that is repeated using a timer. The outline given here is common to most effects.

Create an empty effect

Instantiate an as yet unspecified position for the effect to happen

The Timed version appears to auto-destruct the effect when the time is up.

Position the effect

Set the position of that effect target to a location in the game, typically matching a game object (Go) such as an emitter, weapon or actor.

The location can be adjusted from the Go's location by adding a displacement. E.g. from a bone position out to the mesh surface.

Make something visible

Create a "canvas" to paint the effect onto. Cylinder, disc and sphere are obvious shapes. Model is a non-generic shape, and a particle is actually a two-dimensional square, but you typically create a number of these at once. Ribbon is a ???

Multiple effect surfaces can be created within one effect by grouping each in a pair of curlies "{}".

  • CreateCylinderEffect
  • CreateDiscEffect
  • CreateModelEffect
  • CreateParticleEffect
  • CreateRibbonEffect
  • CreateSphereEffect

In the case of a Particle Effect, the particles themselves will not be created until you attach a Spawn simulation to the effect. You can spawn particles over time, or all at once.


Paint the texture onto the effect surface

Note that the effect texture may have a large transparent area surrounding an opaque centre, thus making the visible effect significantly smaller than the declared size.

Add the time dimension

Now apply modifications to the effect. These can move the location of the effect, change its texture, size and a number of other things.

AttachTargetSimulation applies them to everything at the target, the others are applied to the one effect. AttachSimulationf modifies the definition string with skrit variables, so it is helpful to scan the GPG code for this as the variable names often explain what the parameters are for. The other technique used to do the same thing is to use the StringTool to build the string parameter before calling AttachSimulation with the result. Again, looking at the variable names helps to decode the parameters.

List of known Simulations:

Terminate when done

The effect can end in a number of ways. It can be explicitly destroyed, it can be timed out, or killed when no longer visible.

The skrit code can repeated restart effects using timers to provide continuous effects such as flames, mist etc. or they can be run once, such as explosions. Many, if not all, have parameters passed in to determine the size of the effect, its color, the rate of particles spawning, so that one effect definition can provide a range of results. Emitters have a standard set of usable parameters that are defined in the base template, and they may have different meanings in different effects. Width may be a real width or it may really be some related float value such as the radius of a sphere, so check the actual code for context.


List of Simulations

These are added to effects typically to add a time element. They can move the canvas(es), change the colors, fade the effect in and out.


Changes to this page

  • Oct 17, 2007 - Added links to SetTargetToGo function, and AlphaChange, ApplyForceAlongTargetVector, ApplyGravity, ApplyReistance, and SpawnParticles simulations.
  • Oct 18, 2007- Added links to AttachSimulation(f), DetachSimulation, MovewithVelocity, SetQuadRendering, SetEffectTexture, SetTargetDependence, Create(Timed)Target, and CreateParticleEffect. Updated SetTargetToGo to include bone/AP.
  • Oct 21, 2007- Updated SetTargetToGo, added AddOffsetToTarget function and PositioninSphere, SpawnParticlesRamp sims.
Lara 3