Guide: Siege University - 212: SiegeFX

== Introduction ==
This article is made to help you learn how to make SiegeFX. It provides some step by step instructions towards understanding how effects work in . This, along with the effects included with Dungeon Siege, should be enough to get you started on creating your own effects for your own worlds. 
===What You Need For This Tutorial ===
*Dungeon Siege, updated to version 1.09B or later 
*A text editor. 
*Untanked resource files, specifically Logic.dsres. Refer to Guide: Siege University - 201: Templates for instructions on untanking. 
===What This Tutorial Assumes You Have Already Learned ===
*How to mod content and view it in the game 
*A basic knowledge of Skrit or the template system 
===What This Tutorial Will Teach You ===
*How to use the SiegeFX language to create and manage effects 
*Parameters to change the visual look of your effects 
*How to hook up effects through skrit or through a GO's template 
==What is SiegeFX?==
SiegeFX is the particle effect system used in Dungeon Siege. SiegeFX was developed by Rick Saenz at GPG. SiegeFX, like everything in DS, is centered on the GO (Game Object) system. All effects have a Source, Target and owner GO. SiegeFX is stored in the form of effect scripts. These scripts are comprised of a series of effects that specify what effect to use, how it will look, and what it will run on. 
===Base Effects===
Each effect in a script is built from one of the 22 base effects, and has a set of properties that describe how it will look and act. The list of properties for the base effects can be found at the end of the doc. 
The 22 base effects are:
:Charge: Random spherically spawned particles coalesce to a larger version of themselves.
:Curve: A string of particles move along a random curve. 
:Cylinder: Texturable polygonal cylinder for creating tubes, funnels, and rings/coronas. 
:Decal: Creates a decal. 
:DiscPile: Unused, creates textureless disks. 
:Explosion: Particles start out in a random circular radius and outwards. Particles are affected by gravity. 
:Fire: Particles randomly appear within a circular radius and accelerate as they fade out and scale down. One of the most modifiable effects can be used for much more then just fires. 
:FireB: Similar to regular fire but creates a conical volume for simulating fire breathing/throwing. 
:Flurry: A bunch of particles moving in spherical polar coordinates with sinusoidal interference. 
:Lightsource: Dynamic light source. 
:Lightning: Simple fractal generated lightning/electricity effect that can be strung through numerous targets. 
:LineTracer: Leaves a tracer behind as the targets move through the world. 
:Orbiter: One single particle that orbits a target using spherical polar coordinates. 
:PointTracer: Pre-calculated trajectory tracer traces a single point using a line, textureless. Unused. 
:PolygonalExplosion: A bunch of textureless polygons start from a flat plane and explode out while rotating and stick into the ground. 
:Sparkles: Random spherically spawned particles alpha in and then out while never moving from the spawn point. 
:SPE: Used to create patterns with 
:Spawn: Object spawning effect. 
:Sphere: Textureless tessellated translucent sphere. 
:SRay: (Spinning Ray)Multiple spinning rays originate from a point on a sphere going straight out. 
:Steam: Particles randomly appear within a circular radius and accelerate upwards as they fade out and scale up. 
:Trackball: A single particle, which moves in a straight line or follows a target. 
===Where to Start===
You want to start making SiegeFX but don't know where to start? Crack open offensive.gas located in \world\global\effects. I would recommend just taking the effect script fireshot, it should be the second effect in the file, and modify that so you can easily see in game what effects your changes produce. 
Fireshot effect script after it has been cleaned out. Ready for playing around with. The messaging at the end of the script is used to notify the spell when it is finished, and clean up memory from casting the spell. 
[effect_script*]
{
 name	=fireshot;
 
 script=[[
 // place test effect here.
 worldmsg WE_SPELL_SYNC_END #OWNER_GOID #OWNER_GOID 
 #TARGET_GOID;
 ]];
}
There are a lot of effects in DS, over 1000 to look at. Sometimes the easiest way to learn is to try and take something that is already there and modify it to try to get what you want. 
==Creating Effects==
The primary purpose of a SiegeFX script is to create and play effects. To explain how the effects system works, I think that we need an analogy. Let's imagine that the effects system is a cookie store. A SiegeFX script is a recipe on how to create an effect. It tells you the ingredients to use and how to prepare them. The command sfx create is the equivalent of asking a cook to prepare the cookies for baking. You give him the specifications on what the cookies should look like, whether you want pink hearts or yellow stars, and he returns a sheet of cookies ready for baking. The cook takes the sheet of cookies and puts it on the counter, or the data stack in SiegeFX Terms. You can request the cook to prepare as many cookie sheets as you want, and he will just keep piling them up on the counter. Like wise you can have the SiegeFX system create effects, and the SiegeFX system will keep putting Effect IDs to manipulate them placed on the data stack. This Stack of cookies can't be eaten of course until you bake them. Creating an effect works the same way. You won't see an effect until you start it. First lets take a look at how we specify how an effect will look with the sfx create command. 
Command: sfx create 
Format: sfx create <Effect type> <Target> "<Params>";
Arguments: 
:Effect type: One of the 22 base effect types.
:Target: Target list to run the effect on. See "Macros" for a list of possible targets.
:Params: List of parameters for the effect. These can either be the parameters for the effect type, or the parameters common to all effects. See Appendix A for a list of the available effect parameters. 
Stack Use: Creates an effect ID and places it on the stack. Effect IDs can be used to start, stop, or modify how effects are run. 
Example 1: Uses the sfx create command to create a particle that rotates around the target. This will push the ID of the effect onto the stack. 
 sfx create orbiter #TARGET "color0(1,1,0)";
==The Data Stack==
Information when running a SiegeFX script is stored on a Stack. Stacks are a common way that computer programs store information. You can think of the stack like in the last analogy. The script is the recipe, and the Stack represents a place on the counter where we can pile prepared cookie sheets. You can take a sheet from the top of the stack, or put another sheet on the top of the stack. If you want you can also look at the sheet on the top. Unless you already know what's in the middle of the stack, the only way to get to the sheets underneath is to remove the sheets from the top. The typical operators that you can use on a stack are Push, Pop and Peek. Push puts an item on the top. Pop removes an item from the top. Peek looks at the top item. The SiegeFX system has some commands that will push data onto the stack. This is the only way that information gets placed on the stack. You can then view this data by using the macros Peek and Pop. You can find more information on macros under the "Macros" section.
:#PEEK - Macro that will return the value of the top item on the stack.
:#POP - Macro that will return the top value of the stack. Using #POP will also remove the item from the stack. 
Now lets say that we wanted to run the effect that we set up in the last section. We can use the sfx start command to run an effect by ID. Since the sfx create command places the ID of the effect it created on the stack we can look there for the ID of the effect we want to run. If we just wanted to look at the value we would use #PEEK. We don't need to reference the ID later though so we can just #POP it off. 
Command: sfx start 
Format: sfx start <Effect ID>;
Arguments: Effect ID: Effect ID of the effect to start. Once an effect has been created it's ID is pushed onto the stack. You never need to worry about entering a specific Effect ID. You will always just use an ID stored on the stack. You can start the effect by directly using the ID from the stack like in Example 2, or you can store it for use later like in Example 3. Example 2: Creates an effect composed of a yellow particle orbiting around the target. This will push the ID of the effect onto the stack. We then pop the ID off the stack and use it to start the effect.
 sfx create orbiter #TARGET "color0(1,1,0)";
 sfx start #POP;
==Variables==
You can create variables and give them values for use later. This is useful when trying to work with a lot of data; you can easily change the duration or color of a lot of different effects. Usually you don't need to worry about the type of variables, the exception being a few commands or when you pass parameters to an effect that you are calling from within another effect script. For more information about calling effect scripts, see Running SiegeFX Scripts. To create a variable all you need to do is use it. To set a value to the variable we use the set command. 
Command: set 
Format: set $<Variable> <Value>; 
Arguments: 
:Variable: Name that you can use to reference data later. Variable names must start with the symbol "$". You can use the variable anywhere that you could use the value.
:Value: Value to set the Variable to. It can be any string, and it will be substituted in place of the variable where ever it is used. 
Example 3: Creates a yellow orbiter around the target. This will push the effect ID onto the stack. We set the variable $orb to be the ID of the effect, and then remove the value from the stack. The ID stored in $orb is then used later to start the effect. 
 sfx create orbiter #TARGET "color0(1,1,0)";
 set $orb #POP;
 
 // do some stuff
 
 sfx start $orb;
Example 4: Creates an orange obiter around the target, and an orange flame on the target. Uses a variable to store the color parameter. SiegeFX will insert the entire string "1,.5,.3" into the parameter list for the effect. 
 set $color 1,.5,.3;
 
 sfx create orbiter #TARGET "color0($color)";
 sfx start #POP;
 
 sfx create fire #TARGET "color0($color)";
 sfx start #POP;
==Macros==
Macros are used to access certain information inside an effect script. These Macros are replaced by the SiegeFX system by the data that they represent. Besides the Macros #PEEK and #POP the most commonly used ones are the macros used to reference the script targets. When an effect is started you have the ability to set the source and the target of the script. The source and target can be the same or two different GOs. If the Script is run from skrit then the targets are specified. If the effect is called as a result of a trigger then the target and source are inferred from the message. You can find more information about starting effects under "Running SiegeFX Scripts". 
The following macros can be used to make target lists to hook effects to: 
:#TARGET - returns a target list based on the target of the script.
:#SOURCE - similar to #TARGET, but based on the source of the script.
:#TARGET_KB - returns a target list based on the kill bone of target of the script. Kill bones are typically located in the center of the chest of a model, they are chosen by the artist that made the model to be the best place for effects to be played.
:#SOURCE_KB - similar to #TARGET_KB, but based on the source of the script. 
Example 5: Creates a blue particle around the source kill bone, and a red one around the target kill bone. We use the macros #TARGET_KB and #SOURCE_KB to run the effect on a different part of the model. 
 sfx create orbiter #TARGET_KB "color0(1,.5,.25)";
 sfx start #POP;
 
 sfx create orbiter #SOURCE_KB "color0(.25,.5,1)";
 sfx start #POP;
==Effect Targets==
Each effect has a target that it is based on. This is used by the effect to determine where to draw the effect. The linetracer and curve effects need two effects to work. Some effects have a line mode where they can have two targets; these include fire, explosion, and steam. The lightning effect can be strung through two or more targets. You can add additional targets to an effect by using the sfx target command. 
:Target - Can be used instead of an effect id when specifying additional targets on an effect. References the same GO as #TARGET.
:Source - Can be used instead of an effect id when specifying additional targets on an effect. References the same GO as #SOURCE. 
Command: sfx target 
Format: sfx target <Effect ID 1> < Effect ID 2 or Script target>; 
Arguments: 
:Effect ID 1: ID of the effect script to add a target to.
:Effect ID 2: ID of the effect to use as a target for the effect specified by Effect ID 1
:Script target: Script target as explained above, can be either source or target. 
Example 6: Creates a line of golden fire between the target and the source. The fire effect is created with the line() parameter. With the line parameter set the fire effect can use two targets and draw a line between them. The second line of the example takes the effect ID stored on the top of the stack and adds an additional target to it, the source of the effect script to be exact. 
 sfx create fire #TARGET "line()color0(1,1,.7)";
 sfx target #PEEK source;
 sfx start #POP;
==Linking Effects==
Often when making effects we want a group of effects to move or act together. There are a couple of types of connections we can make. The first is a positional link. We can take an effect and remove it from its initial target and target it to another effect. The second type of connection we can make is a logical link. We can attach one effect to another such that when you do something to the parent effect it happens to both. 
===Positional Links===
To hook effects together we need to target one to another. The sfx target command is what we use to do this. If we don't want to use the initial target then we need to remove it from the effect. We can use the sfx rat command to remove all targets from an effect. 
Command: sfx rat 
Format: sfx rat <Effect ID>; 
Arguments: 
:Effect ID: Effect to remove the targets from. 
Example 7: Two orbs from Example 5 with purple fire between them. Using the sfx rat command to remove the original target from the fire. Then we can target it to both of the orbiters. 
 sfx create orbiter #TARGET_KB "color0(1,.5,.25)";
 set $orb1 #PEEK;
 sfx start #POP;
 
 sfx create orbiter #SOURCE_KB "color0(.25,.5,1)";
 set $orb2 #PEEK;
 sfx start #POP;
 
 sfx create fire #TARGET "line()color0(.75,.35,.75)";
 sfx rat #PEEK;
 sfx target #PEEK $orb1;
 sfx target #PEEK $orb2;
 sfx start #POP;
===Logical Links===
Using the sfx attach command you can make two effects act as one. When you start the effect then any attached effect will start as well, likewise when you end the parent then the attached effect will stop. 
Command: sfx attach 
Format: Sfx attach <Effect ID 1> <Effect ID 2>; 
Arguments: 
:Effect ID 1: This is the parent effect, changes to it will also affect the effect that is attached to it.
:Effect ID 2: This is the effect that you want to attach to Effect ID 1. After the attachment you can control both by what you do to Effect ID 1. 
Example 8: Creates a yellow orbiter with yellow fire on it. Note that since the fire is attached to the orbiter that we don't need to tell it to start. If we were to stop $orb1 then the fire would stop as well. 
	
 sfx create orbiter #TARGET_KB "color0(1,.75,.25)";
 set $orb1 #POP;
 	
 sfx create fire #TARGET "color0(.75,.55,.25)";
 sfx rat #PEEK;
 sfx target #PEEK $orb1;
 sfx attach $orb1 #PEEK;
 
 sfx start $orb1;
==Hooking Effects To Models==
We don't always just want to hook an effect to one of the default targets. Sometimes we want to base an effect off of a position, but we don't want it to move with the target. There are several commands that we can use to move effects around or attach them to different points of a model. 
===Bone Positions===
There are several ways to hook an effect to a model. DS uses a skeletal animation system. The default target in a model is the top-level bone of that model, this is the bone that is targeted if you use the #TARGET macro. You can also hook effects to specific bones in a model. Since models might not have any bone names in common it's a good idea to only use these bones in effects that go on a specific monster or group of monsters that you know for sure will have those bones. To allow people to name bones what ever they want we cam up with a bone translator, this maps a bone from a model to a common name that you can use from within a SiegeFX script. The bone translator names are kill_bone, weapon_bone, shield_bone, body_mid, body_anterior, and body_posterior. To attach to a bone or a bone_translator bone you can use the sfx attach_point command. 
Command: sfx attach_point 
Format: sfx attach_point <Effect ID> <Bone> <Effect target>; 
Arguments: 
:Effect ID: Effect the we want to move a target on.
:Bone: Either a Model Bone or a Bone translator bone, bone translator bone names are prefixed by a @ symbol. 
Example 9: Creates a line of fire. We target it to the source, then move the attach point to the specified bone translator bones. Note the @ symbol before the bone translator bone name. 
	
 sfx create fire #TARGET "line()color0(1,.65,.65)";
 sfx target #PEEK source;
 sfx attach_point #PEEK @weapon_bone source;
 sfx attach_point #PEEK @body_anterior target;
 sfx start #POP;
Example 10: Create a line of fire between the left foot of the source and the left clavicle of the target using the bones in the models. 
 sfx create fire #TARGET "line()color0(1,.65,.65)";
 sfx target #PEEK source;
 sfx attach_point #PEEK Bip01_L_foot source;
 sfx attach_point #PEEK Bip01_L_Clavicle target;
 sfx start #POP;
===Freezing Effect Positions===
By default, effects will derive their position from their target. When the target moves then the effect will move with it. If the effect is of a type that spawns particles then new particles will be spawned at the target as it moves. Sometimes you want to have an effect start at a location, but then stay there even if the target moves. To do this you use the sfx freeze_targets command. 
Command: sfx freeze_targets 
Format: sfx freeze_targets <effect ID>; 
Arguments: 
:Effect ID: Effect ID to freeze in place. 
Example 11: Create a greenish yellow fire that will stay still even if the target moves. 
 sfx create fire #TARGET_KB "color0(.45,.75,.15)";
 sfx freeze_targets #PEEK;
 sfx start #POP;
===Playing Effects on the Terrain===
Since all effects are based on Gos it's sometimes difficult to get effects to play correctly with the terrain. To get an effect to sit on the terrain you can use the sfx snap_to_ground command. This command functions like freeze_targets except that the target moves vertically down to the ground. 
Command: sfx snap_to_ground 
Format: sfx snap_to_ground <effect ID>; 
Arguments: 
:Effect ID: Effect ID to snap to the ground. 
:Example 12: Makes a light blue cylinder that rests on the ground. The effect will not move with the target. 
 sfx create cylinder #TARGET_KB "color0(.25,.25,.45)";
 sfx snap_to_ground #PEEK;
 sfx start #POP;
===Positioning Trackballs===
The trackball effect has one target, but it still has a start position and an end position. You need to tell the trackball where to come from. You can set the initial position of a trackball to a bone using the sfx position_at command. The trackball will then move towards it's target as its parameters describe. 
Command: sfx position_at 
Format: sfx position_at <Effect ID> <Bone Name> <Script Target>; 
Arguments: 
:Effect ID: Effect ID to move.
:Bone Name: Bone to move the effect to.
:Script Target: Script target to move the effect to. This can be either target or source. 
Example 13: Creates an orange trackball at the weapon bone of the source. The trackball will the move towards the target. Note the use of the sfx friendly command. You will want to make all of your trackball attacks friendly to the party. This command prevents the effect from colliding with other party members, or the caster. For more information about trackballs, see "Doing Damage Through Effects". 
 sfx create trackball #TARGET_KB "color0(1,.3,0)";
 sfx position_at #PEEK @weapon_bone source;
 sfx friendly party #PEEK;
 sfx start #POP;
==Timing Effects==
Part of making effects is choreographing when the different effects will start and stop. There are a few different methods for timing effects. You can accomplish this by using the pause command to halt the execution of a script for a set amount of time, or by using delays on the effects themselves. You can also set the duration of a particular effect. 
===Pausing Scripts===
Pause will cause the script to stop executing until the specified time has elapsed. Effects before a pause will function normally, but the parts after the pause won't be run until after the pause has finished. 
Command: Pause 
Format: Pause <Time>; 
Arguments: Time: Time to halt the execution of the effect script. Example 14: This will create two orbiters around the target. The first orbiter will continue to run while the script is paused. The second orbiter will be created 1.57 seconds after the first. This is the amount of time it takes an orbiter with default values to make half a revolution.
 sfx create orbiter #TARGET "color0(1,.8,.8)";
 sfx start #POP;
 
 pause 1.57;	
 
 sfx create orbiter #TARGET "color0(.8,.8,1)";
 sfx start #POP;
===Delaying Effects===
Another way to time effects is to put delays in the effects themselves instead of pausing the whole script. Delays will result in more accurate timing. These are actually a parameter of the effect, and must go inside an effect parameter list. Delays can't be run as a stand-alone command. 
Command: Delay 
Format: Delay(<Time>) 
Arguments: 
:Time: Amount of time to delay before starting this specific effect. 
Example 15: Creates two orbiters, one is delayed so it won't start until after the first. Note the delay (1.57) in the second parameter list. 
 sfx create orbiter #TARGET "color0(1,.8,.8)";
 sfx start #POP;
 
 sfx create orbiter #TARGET "delay(1.57)color0(.8,.8,1)";
 sfx start #POP;
==Setting the Duration of Effects==
The Dur command can be used to set the duration of a particle effect. You set the duration like you set a delay in an effect, as part of the parameter list. 
Parameter: Dur 
Format: Dur() 
Arguments: 
:Time: Duration of the effect in seconds. Most effects without a specified duration will last until they are stopped. 
Example 16: Creates two orbiters that will fade out after they make one revolution together. 
 sfx create orbiter #TARGET "color0(1,.8,.8)dur(4.71)";
 sfx start #POP;
 
 sfx create orbiter #TARGET "delay(1.57)color0(.8,.8,1)dur(3.14)";
 sfx start #POP;
==Stopping Effects==
Once you have created an effect you might want to stop it after something happens. To do this you can use the sfx finish command, or the sfx stop command. Finishing an effect normally looks better, but not all effects can be finished. Stop works on everything, but can cause a pop when an effect disappears. If you know how long an effect needs to play for then it's usually better to use a dur parameter then using stop or finish. 
Command: 
 Sfx Stop
 Sfx Finish 
Format: 
Sfx stop <effect ID>;
Sfx finish <effect ID>; 
Arguments: 
:Effect ID: Effect ID to finish or stop. 
Example 17: Creates a flurry of particles around the target, then stops it after pausing for two seconds. 
 
 sfx create flurry #TARGET_KB "color0(.25,.25,.45)";
 sfx freeze_targets #PEEK;
 set $flur #PEEK; 
 sfx start #POP;
 
 pause 2;
 
 sfx stop $flur;
==Camera Effects==
Effect scripts consist of more then just particle effects. You can start camera effects from effect scripts. We have two types of camera effects: 
*Camera_stomp - Shake starts at max displacement, then rapidly falls off. 
*Camera_shake - More consistent shake effect. 
Command: camerashake 
Format: camerashake <Camera Effect> s<<Property List>>; 
Arguments: 
:Camera Effect: Tells which type of camera effect to use. Can be either camera_stomp or camera_shake.
:Property List: List of properties that describe how the camera effect works. The properties are listed in a continuous string and are separated by the & character. The entire list is enclosed in S< >. This tells the SiegeFX system that the list should be treated as a string. 
Example 18: Creates a camera stomp. This will be centered around the target of the effect. 
 camerashake camera_stomp <frequency=40&magnitude_x=0.0
 &magnitude_y=0.6&magnitude_z=0.0&duration=1
 &epicenter=#TARGET_GOID>;
==Sounds==
The visual part of an effect is only half the effect. Most effects also have associated sounds. Luckily you can play sounds from an effect script, making it easy to sync the sound and effect. To start a sound you use the sound play command. Starting an effect will push an ID for that sound onto the stack that you can use to stop the sound later. You can stop a sound with the sound stop command. Sound falloff is at full volume from zero distance to the min distance of the sound. After that it starts to fall off till the max distance. 
Command: sound play 
Format: sound play < Filename > [ at < Target Position > [ dist <min max> ] ][ loop ]; 
Arguments: 
:Filename: Name of the sound file to play.
:Target Position: Position to center the sound around. Sound will fall off the further a character is from this position. Optional argument.
:Min: minimum falloff distance. Optional argument.
:Max: maximum falloff distance. Optional argument.
:Loop: if loop is specified then the sound will loop when it gets to the end. Best used with sounds that are made to loop. Optional argument. 
Stack Use: Creates a sound ID and places it on the stack. Sound IDs can be used to stop effects later in the script. 
And the sound stop command works like this. 
Command: sound stop 
Format: sound stop < Sound ID >; 
Arguments: 
:Sound ID: ID of the sound sample to stop. 
Example 19: Plays a looping burning sound. The Sound ID is put on the stack when we play the sound. The ID is stored in the $burning variable which is used to stop it later. 
 sound play s_e_burning_large at #TARGET_POSITION dist 3 30 loop;
 set $burning #POP;
 
 pause 2;
 
 sound stop $burning;
==Doing Damage Through Effects==
Besides looking pretty effects in DS can also do damage. The spell fireshot is actually a simulated projectile flying through the air. The spell won't do any damage unless the projectile hits. The effects that can do damage include: Lightning, Fire, Fireb, and trackball. If you look though the SiegeFX scripts then you won't find the properties in the spell effects. None of the effects specify the damage directly. Damage properties are all passed in as a parameter from the skrit that runs the effect. This make tuning the spell much easier since the damage that the spell does can be set in the spell's template. 
===Trackballs===
Trackballs will automatically try to do damage with what they collide with. When a trackball hits a go that it isn't friendly to, the SiegeFX system will look at the owner GO of the effect that contains the trackball. If the owner is a spell then damage will be done accordingly. The sfx friendly command like that used in example 13 can be used to specify if a trackball will collide with the party or not. You will probably always want to use this command when using trackballs. 
===Fire===
The Fire effects fire and fireb can be used to make a damage volume. The names are a little misleading, because you can create more effects then just fire. Since you can set the color and texture of the particles you can make effects that look like anything. Since these are mostly used for visual effects damage must be done on a per effect basis. The volume that these effects do damage in is determined by where the particles that compose the effect are located. The parameters that describe how the effect does damage are "fdamage", "damage", and "ignite". "Fdamage" describes the damage done, and "damage" or "ignite" specifies if the target can catch fire from the effect. To use "damage" or "ignite" you just place them followed by an empty set of parenthesis in the parameter list for an effect. 
Parameter: fdamage 
Format: fdamage(<Min>,<Max>,<Particle Fit>) 
Arguments: 
:Min: Minimum damage per second the effect should do.
:Max: Maximum damage per second the effect should do.
:Particle Fit: Minimum alpha level of particle to include in the damage area calculation. Value is a floating-point number from 0 - 1. Set closer to 0 for a larger area, and closer to 1 for a smaller area. 
Example 20: Creates a fire effect that does damage when run as part of a spell. 
 sfx create fireb #TARGET_KB
 "color0(.2,1,.1)fdamage(2,3,.2)damage()dur(1)velocity(0,0,50)";
 sfx start #POP;
===Lightning===
Lightning is strung between targets, it does damage to each target in the list. Lighting damage is specified though a damage parameter. 
Parameter: damage 
Format: damage(<Min>,<Max>,0) 
Arguments: 
:Min: Minimum damage done by the effect.
:Max: Maximum damage done by the effect. 
Note: The last argument in lightning's damage property is unused. 
Example 21: Creates a damaging lightning effect that stretches from the weapon bone of the source to the kill bone of the target. 
 Sfx create lightning #TARGET_KB
 "damage(10,12,0)dur(.5)";
 sfx target #PEEK source;
 sfx attach_point #PEEK @weapon_bone source;
 sfx start #POP;
==LODFI==
Some effects are used very frequently. Torch effects for example are all over the place. For these commonly used effects we can trim them down to make the game run faster for slower machines. There are a few ways to accomplish this. Using the #LODFI macro and using the min_count effect parameter to decrease particle counts. 
:#LODFI - Macro that returns a floating point value that represents where the player has slid the Object Detail bar in the UI. You can make a comparison against this value to decide whether to draw an effect or not. 
The other way to speed up an effect when the object detail is lower is to decrease the number of particles that are drawn. Some effects have the min_count property that specifies how many particles draw at the lowest object detail setting. 
Parameter: min_count 
Format: min_count(<Particle Number>) 
Arguments: 
:Particle Number: Number of particles that will make up the effect when the object detail slider is at the bottom. The SiegeFX system will interpolate between count and min_count depending on where the slider is. 
Example 22: this is an example of a torch effect, uses the #LODFI macro and also decreases the particle counts. Note that the first fire effect will only run if the Object detail is above 0.5. 
	 
if ( #LODFI > 0.5 )
 {
 sfx create fire #TARGET 
 "flamesize(1)dark()grey_tex()color0(0,0,0)
 color1(0,0,0)min_displace(-.3)instant()
 offset(0,1.5,0)scale(.525)min_count(10)count(20)";
 sfx start #POP;
 }
 		
 sfx create fire #TARGET 
 "offset(0,1.1,0)instant()scale(.525)min_count(10)count(20)
 texture(b_sfx_fireball-01)flamesize(.5)color0(.75,.35,.24)
 color1(.2,0,0)max_radius(1.45)";
 sfx start #POP;
==Color and Alpha==
Color in DS is composed of four different properties, there are three color components and an alpha component. Color is made up of Red, Green, and Blue. These can be combined to make different colors. Alpha is a measure of transparency. A particle that is more transparent will draw less of its colors on top of what is already being drawn. 
The three components to color, Red, Green and blue can be combined to create different colors. 
:Red + Green = yellow
:Red + blue = purple
:Green + Blue = Cyan
:Red + Green + Blue = White
So if for example we had a red particle with RGB values 1,0,0 and we had a green particle RGB 0,1,0 then when we draw them on top of each other we would get 1,1,0, which is yellow. Some effects also have a dark blending mode. Dark effects use the color of the texture of the particle they don't blend with the color of what they are over. 
Dungeon Siege looks very good in 16-bit, but effects that use alpha will show banding. It's recommended that you run in 32-bit if you are creating effects. 
==Running SiegeFX scripts==
Now that we have talked about how to create SiegeFX we should probably talk about how to run them. SiegeFX can be run from lots of different places. Some of the most common are running effects from Skrit, from a template trigger, or from another effect. When running an effect it's important to make sure that it will work correctly in a MP game. There are a lot of special cases with MP because of the streaming world. 
===Running Scripts from Skrit===
You can run an effect from skrit in three different ways. They all have the same arguments. The difference is how the effects will work in a MP game. Effects created with RunScript are started locally and won't be passed to other machines in a MP game. If possible it's best to have each machine create effects locally with RunScript to cut down on the amount of data sent in a MP game. SRunScript will tell all of the machines in a MP game to start an effect, if the targets are valid on each of the clients then they will run the effects, if the targets aren't loaded on a particular client when they are told to run the effect then they will just not run the effect. SRunScript is useful for short effects that need to run on all clients, attack spell effects are a good example of this. SRunMPScript works similar to SRunScript except if the targets weren't valid when an effect was run, but became valid later then the effect will get run on the targets as soon as they are valid. SRunMPScript is useful for effects that last longer, persistent effects like those associated with stat-improvement spells are a case where running effects this way is needed. Running effects will return an effect ID that can be used to stop effects later. 
Commands: 
:SRunMPScript
:SRunScript
:RunScript
Format: RunScript(<Effect Name>,<Target>,<Source>,<Params>,<Owner>,<Event>); 
Arguments: 
:Effect Name: Name of the effect script to play.
:Target: Goid to use as the target of the effect script.
:Source: Goid to use as the source of the effect script.
:Params: String to pass to the script to use as parameters.
:Owner: Goid of the owner of the effect. Mainly used to handle effects that do damage. For example, the owner of a spell effect will be the spell. If an effect projectile collides with a target then the game knows where to look to find out how much damage to do.
:Event: Trigger event that caused the effect to play. This is used to determine when to automatically end scripts. Scripts started with the WE_DAMAGED event for example will stay when the actor they are targeted to dies. Effects started from other events will end if their target is killed. 
After you have run an effect you may want to stop it later. There are a few different commands that you can use to stop effects. StopScript and FinishScript both stop an effect locally. FinishScript looks a little better than StopScript, but StopScript will stop an effect immediately. SStopScript will stop effects on all of the clients in a MP game. You can either stop an effect by the Effect ID, or you can stop an effect by name on a specific GO. 
Commands: 
:SStopScript
:StopScript
:FinishScript
Format: StopScript(<Effect ID>); 
Arguments:
:Effect ID: ID of the effect to stop. 
Or you can stop effects using the effect script name. 
Commands: 
:SStopScript
:StopScript
Format: StopScript(<Target>,<Script Name>); 
Arguments: 
:Target: Goid to remove the effect from.
:Script Name: Effect to remove from the target. 
===Running Script from Templates===
You can set up simple triggers in templates to run an effect when a certain event happens. The main use for this is attaching effects to environmental objects. Template triggers are hooked up in the common block of a template. Each template can have any number of separate triggers, and any number of actions per trigger. Template triggers are used to do things like start a flame effect on a torch when it enters the world, or start some spell effects when a spell cast. The targets that the script is run on are inferred from the message the effect is triggered on. 
System: Template Triggers: 
Format: 
[common]
 {
 [template_triggers]
 {
 [*]
 {
 action* = call_sfx_script( "<Effect Script>
 [(Run Options)]"[,"<Target Bone>"][,"<Script Params>"] );
 condition* = receive_world_message("<World Event>");
 }
 }
 }
Arguments: 
:Effect Script: Effect to play when the trigger fires
:Run Options: The game tries to determine how to how to run an effect based on the type of object and the event that an effect is run from. You can use these options to override how the effect works in a MP game. This Argument is optional, and the possible options are listed below.
:Target Bone: Bone or Bone Translator Bone to use as a target for the effect script instead of the default target. Optional Argument.
:Script Params: Parameters to pass to the effect script when it is run. Optional Argument. 
Run options:
:s - only execute this script if we're the server 
:g - execute script as global 
:l - execute script as local 
:x - this script is xfer-able and gets sync'd as part of the clone request
Example 24: Taken from a spell in spl_spell.gas. This trigger will start sparkle effects on a a spell when it is dropped. 
 [common]
 {
 [template_triggers]
 {
 [*]
 {
 action* = call_sfx_script( "combat_spell_sparkle" );
 condition* = receive_world_message("we_dropped");
 }
 }
 }
===Running Scripts from Other Scripts===
You can start an effect from another script. This is useful for a couple of reasons. Since called effects use the same targets as the effects that called them, you could easily create multiple versions of an effect. You could create a base effect that takes parameters to define its color, scale, or other visual attributes, and then you could make several versions that call that base effect and pass it different parameters. Running a script from another script can also be useful for timing. When you use the call command The SiegeFX system pushes a Script ID onto the stack. You can then use the wait for command to pause the original script and do something as soon as the called script finishes. 
Command: call 
Format: call <Effect Script> <parameters> 
Arguments: 
:Effect Script: Name of the Effect script to run.
:Parameters: List of parameters to pass to the new effect being run. Parameters are in a list separated by spaces, each parameter must have a specified type. The order of the parameters is how they are referenced in the script being run. See the section below on how to use effect parameters.
Stack Use: Creates a script ID and places it on the stack. Script IDs can be used to wait for the termination of the called script. 
Types are defined by encasing the value in <> and putting an identifier in front of it. Types that can be used in an effect script: 
:I = string
:U = unsigned int
:F = float
:S = string
:V = vector
:P = position 
Example 25: Calls a test effect script and passes it some parameters. The first parameter will be the floating-point number 3.14.The second parameter will be a string containg a parameter to set the color of an effect. 
 Call test_script f<3.14> s<color0(0,1,0)>;
===Using Effect Parameters===
Parameters are useful for effects that need to be different depending on the situation. Attack spells for example need to do different amounts of damage based on the magic level of the caster. Using Parameters we can just pass in the damage an effect is supposed to do. Inside an effect script you can refer to parameters with the parameter number encased in []. The first parameter would be [0], the second [1], and so on. You can use the parameter anywhere you would use the data located inside of it. 
Example 26: Uses the values passed in from the previous example. This will create an orbiter using the color parameter passed in then pause for the amount of time passed in then stop the orbiter. 
 Sfx create orbiter #TARGET_KB "[1]";
 Set $orb #PEEK;
 Sfx start #POP;
 
 Pause [0];
 
 Sfx stop $orb;
==Examples==
Here are some examples of simple effects. There are some items in these examples that weren't covered in this doc, but you should be able to tell what is going on. The examples are full of comments, lines that have a // in front of them are comments and do not effect the functionality of the script. 
Example 27: This effect consists of an effect projectile that leaves sparkle trails. When the projectile hits it creates an explosion of particles. 
[effect_script*]
{
name	=gh_bolt;
script	=[[
 // create a trackball and point it at the killbone of the target.
 // we want a bright blue homing attack.
 sfx create trackball #TARGET_KB 
 "must_update()texture(b_sfx_sparkle01)scale(1.66)
 color0(.5,.5,1)dur(6)afterlife(2)homing()damped()kdamp(.1)";
 set $trackball #POP;
 // position the shot to come from the weaponbone of the source.
 sfx position_at $trackball @weapon_bone source;
 // set the trackball not to collide with friendlies
 sfx friendly party $trackball;
 	
 		
 // create a fire effect. This will look like trailing sparkles.
 sfx create fire #SOURCE
 "must_update()count(20)color0(.5,.5,1)alphafade(1.5)
 velocity(0,0,0)accel(0,-2,0)flamesize(2)max_displace(0)
 texture(b_sfx_sparkle01)scale(2.2)";
 set $fire #POP;
 // attach the fire to the trackball.
 sfx rat $fire;
 sfx target $fire $trackball;
 sfx attach $trackball $fire;
 
 // start the trackball, since the fire is attached it 
 // will start as well.
 sfx start $trackball;
 
 // wait until the trackball collides with something.
 // the type of collision will be pushed onto the stack
 waitfor collision $trackball #DEFAULT_TIMEOUT;
 
 // if we hit something then we want to play a hit effect.
 // POP the collision type off the stack and make sure we hit
 // something instead of hit our timeout.
 set $collision_type #POP;
 if ( $collision_type != #NO_COLLISION )
 {
 // make an explosion where the trackball hit.
 get collision point $trackball;
 sfx create explosion #POP 
 "texture(b_sfx_sparkle01)color0(.5,.5,1)
 radius(0)dur(2)omni_dir()";
 sfx start #POP;
 }
 
 // get rid of the trackball.
 sfx destroy $trackball;
 
 // message the spell that the effect is complete so 
 // it can delete itself
 worldmsg WE_SPELL_SYNC_END #OWNER_GOID #OWNER_GOID #TARGET_GOID;
 ]];
}
Example 28: This effect script makes lightning shoot from both hands of the source and hit the target in the kill bone. There are also a few explosions of particles where the effects come from, and where they hit. 
 
[effect_script*]
{
name	=gremal_zap;
script	=[[
 // create an explosion that originates from the source
 // of the effect.
 sfx create explosion #SOURCE 
 "vmin(1)vmax(2)ivel(0,1,0)rvel(1,1,1)scale_range(.13,.16,0)
 texture(b_sfx_sparkle01)color0(.5,.5,1)
 dur(.2)radius(.4)fade_range(0,1,0)count(25)omni_dir()
 scale(.66)";
 // move the explosion to the weapon bone of what 
 // the effect comes from.
 sfx attach_point #PEEK @weapon_bone target;
 sfx freeze_targets #PEEK;
 sfx start #POP;
 
 // string a bolt of lightning from the source to the target. 
 sfx create lightning #SOURCE 
 "must_update()scale(.75)bolt_life(1)
 mindisplace(-.1)maxdisplace(.1)
 color0(.5,.5,1)dur(.25)";
 set $bolt #POP;
 // make the bolt come from the weapon bone.
 sfx attach_point $bolt @weapon_bone target;
 // add another target for the lightning to hit. 
 // Make it the target of the script.
 sfx target $bolt target;
 // hit the target in the kill bone.
 sfx attach_point $bolt @kill_bone source;
 sfx start $bolt;
 
 // string a bolt of lightning from the source to the target. 
 sfx create lightning #SOURCE 
 "must_update()scale(.75)bolt_life(1)
 mindisplace(-.1)maxdisplace(.1)
 color0(.5,.5,1)dur(.25)";
 set $bolt2 #POP;
 // make the bolt come from the shield bone.
 sfx attach_point $bolt2 @shield_bone target;
 // string the lightning to the target of the script.
 sfx target $bolt2 target;
 // hit the target in the kill bone.
 sfx attach_point $bolt2 @kill_bone source;
 sfx start $bolt2;
 
 // create an explosion at the target where it is hit by the
 // lightning.
 sfx create explosion #TARGET_KB 
 "vmin(2)vmax(3)ivel(0,1,0)rvel(2,1,2)scale_range(.13,.16,0)
 texture(b_sfx_sparkle01)color0(.5,.5,1)
 dur(2)radius(.4)fade_range(0,1,0)count(25)omni_dir()";
 sfx freeze_targets #PEEK;
 sfx start #POP;
 
 // send a message to the skrit so it knows that the effect 
 // finished playing.
 worldmsg WE_SPELL_SYNC_MID #INVALID_GOID #OWNER_GOID #TARGET_GOID;
 ]];
}
==Conclusion==
Now you know the basics of SiegeFX, there are still some features of the language that haven't been covered, but you should be able to look at examples from the game and figure them out. Good luck making your own effects! 
==Appendix A: Effect Parameters==
===Global Effect Parameters===
These are common parameters that are usable by most of all the effects.
Mnemonic 	Format 	Description
dur 	(n) 	Duration - how long the effect will live in seconds
delay 	(n) 	Delay - how long to pause before the effect starts
pos 	(x,y,z)	Position - initial position relative to the world
dir 	(x,y,z)	Direction - initial direction relative to the object
offset 	(x,y,z)	Offset - positional offset relative to the model
ts 	(n) 	Time scalar - factor to scale time by
scale 	(n) 	Scale factor - factor to scale size of effect by
texture 	(text) 	Texture - Name of a texture file to use including the extension, if no extension is specified then it treats the name as a [tsd] block saved in a gas file for an animated texture.
sup 	() 	Static Update - if the effect doesn't move, specify this parameter
abs 	() 	Absolute coordinates - effect is not scaled to match targets size
use_wind 	() 	Effect uses wind information to change motion
world_orient	() 	Effect orients to the orientation of the world
bone_orient 	() 	Effect orients to the bone of the target it is attached to
===Base effect parameters===
====Charge====
Random spherically spawned particles coalesce to a larger version of themselves.
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.0,0.0,1.0)
radius 	(f) 	Set the radius of the area of effect 	(1.00)
count 	(n) 	Number of particles 	(16)
tout 	(f) 	Transition out time in seconds 	(1.0)
speed0 	(f) 	Random acceleration factor for a particle 	(1.0)
centersize	(f) 	Maximum size factor for center particle 	(0.75)
ialpha 	(f) 	Particle alpha increment amount to fade by	(4.00)
====Curve====
Generates a random curve. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.235,0.24,1.0)
size 	(f) 	Size of a single particle in the curve	(0.125)
step 	(f) 	Detail level of the curve 	(0.25)
curvature	(f) 	The higher the less straight 	(1)
model 	(n) 	Curve behavior 0,1, or 2 	(0)
tlength 	(f) 	Trail length 	(2.0)
velocity 	(f) 	The speed at which the curve is drawn 	(30.0)
spacing 	(f) 	The space between each particle 	(3.0)
====Cylinder====
Texturable polygonal cylinder for creating tubes, funnels, and rings/coronas.
Mnemonic	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(1.0,1.0,1.0)
segments	(f) 	Number of sides cylinder will be made of 	(16.0)
rp0 	(s,e,i)	Starting radius, ending radius, increment 	(0.5, 0.5, 0.0)
rp1 	(s,e,i)	Starting radius, ending radius, increment 	(0.5, 0.5, 0.0)
hp0 	(s,e,i)	Starting height, ending height, increment 	(2.5, 2.5, 0.0)
hp1 	(s,e,i)	Starting height, ending height, increment 	(0.0, 0.0, 0.0)
spin 	(f) 	How fast to spin the cylinder 	(0)
alpha 	(f) 	Starting alpha value to use 	(0.5)
tin 	(f) 	Transition in time in seconds 	(0.5)
tout 	(f) 	Transition out time in seconds 	(0.5)
dark 	() 	Uses an alternate blending mode to look opaque	
rotate 	(x,y,z)	Amount to rotate the cylinder by in degrees 	(0.0, 0.0, 0.0)
irotate 	(x,y,z)	Amount to increment rotation by in degrees 	(0.0, 0.0, 0.0)
 
====Decal====
Creates a decal. 
Mnemonic 	Format	Description 	Default
name 	(text)	The name of the texture including the extension	(b_d_blood.psd)
tin 	(f) 	Set the alpha in duration 	(1.0)
tout 	(f) 	Set the alpha out duration 	(1.0)
near 	(f) 	Set the near plane of the decal projection 	(0.1)
far 	(f) 	Set the far plane of the decal projection 	(1.1)
alpha 	(f) 	Limits the maximum alpha value to this amount 	(1.0)
save_texture	() 	After decal is gone it destroys the texture 	
====DiscPile====
Ugly pile of discs… was supposed to be used for showing coins, textureless. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.0,1.0,0.0)
radius 	(f) 	radius of the area of effect 	(0.45)
discradius	(f) 	radius of the disc 	(0.025)
thickness 	(f) 	disc thickness factor 	(0.1125)
count 	(n) 	Number of discs 	(100)
sides 	(n) 	Number of sides a single disc has	(10)
minvel 	(x,y,z)	Minimum initial velocity 	(-.75,1,-.75)
maxvel 	(x,y,z)	Maximum initial velocity 	(.75,5,.75)
 
====Explosion====
Particles start out in a random circular radius and explode in a set direction, fade out and bounce off the ground. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.6,0.7,1.0)
color1 	(r,g,b)	Particle variance color 	(0, 0, 0)
color2 	(r,g,b)	Splat color 	(1.0, 0.1, 0.1)
rebound 	(n) 	How elastic each particle is for bouncing 	(0.85)
fade_range 	(s,e,0)	Set the range of the fading start to end 	(0.5,1.0,0.0)
count 	(n) 	How many particles to use 	(32)
dark 	() 	Uses an alternate blending mode to look darker 	
radius 	(f) 	Spawn radius factor 	(0.5)
line 	() 	Uses target and source targets to generate a line to spawn particles from. 	
vmin 	(f) 	Minimum initial particle velocity scalar 	(3.0)
vmax 	(f) 	Maximum initial particle velocity scalar 	(6.5)
ivel 	(x,y,z)	Initial velocity vector 	(0, 0, 0)
rvel 	(x,y,z)	Initial random velocity vector 	(0.25, 0.25, 0.25)
min_theta 	(f) 	Theta range min - determines spawn point 	(0)
max_theta 	(f) 	Theta range max - determines spawn point 	(3.1415)
min_phi 	(f) 	Phi range min - for omni-directional mode 	(0)
max_phi 	(f) 	Phi range max - for omni-directional mode 	(6.283185)
cfreq 	(f) 	Collision frequency: 1 = 100% of particles 	(1.0)
collide 	() 	Causes particles bounce off of terrain polygons 	
omni_dir 	() 	Creates an omni-directional explosion 	
no_noise 	() 	Specifies global texture without noise 	
rand_scale 	() 	Specifies to use random scale per particle 	
splat 	() 	Causes particles to "splat" onto terrain polygon 	
splat_life 	(f) 	Duration a splat exists before it fades away 	(2.0)
splat_fade 	(f) 	Rate at which a splat fades away after expiring 	(0.25)
scale_range 	(s,e,0)	Random range of particle size from s to e 	(0.2, 0.7, 0)
grey_tex 	() 	Default texture is red, this is greyscale 	
srate 	(f) 	Spawn rate - duration in seconds 	(0)
stexture 	(text) 	Texture - Name of a texture file to use including the extension, to use for the splat texture	
alphastart 	(f) 	Alpha starting value for a splat 	(1.0)
splatscaleup	(f) 	Alpha starting value for a splat 	(2.275)
splatskip 	(n) 	Number of splats to skip before doing a splat 	(4)
 
====Fire====
Particles randomly appear within a circular radius and accelerate as they fade out and scale down. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b) 	Vertex color 	(0.8,0.5,0.0)
color1 	(r,g,b) 	Particle variance color 	(0.15,0.0875,0.0)
instant 	() 	Fire instantly has volume instead of burning slowly 	
velocity 	(x,y,z) 	Initial flame velocity before acceleration 	(0.0,8.0,0.0)
accel 	(x,y,z) 	Constant of acceleration 	(0.0,14.0,0.0)
flamesize 	(f) 	Size of individual flame relative to effect 	(1.75)
fctrl 	(min,max,i)	Controls for how a flame expands over time 	(-1.25, 1.75, 0.0)
alphafade 	(f) 	How fast to fade flame out 	(0.85)
count 	(n) 	The maximum number of particles to use 	(30)
min_count 	(n) 	The minimum number of particles to use 	(30)
min_radius 	(f) 	Inner spawn radius 	(0.0)
max_radius 	(f) 	Outer spawn radius 	(4.0)
min_iradius 	(f) 	Amount to increment inner spawn radius 	(0.0)
max_iradius 	(f) 	Amount to increment outer spawn radius 	(0.0)
radius_rmin 	(f) 	Range for min radius to not exceed from incrementation 	(0.0)
radius_rmax 	(f) 	Range for max radius to not exceed from incrementation 	(4.0)
radius 	(n) 	Radius additive - absolute scale 	(0.0)
cheap 	() 	Uses cheaper particle motion calculations 	
line 	() 	Uses target and source targets to draw a line of fire through. 	
rect 	() 	Uses object and subject targets to define a rectangular area to spawn the particles from.	
fdamage 	(min,max,f)	Flame damage min,max, alpha fit filter - fit >= 0.2 	(3.0,7.0,0.2)
ignite 	() 	Fire will do damage determined by fdamage and possibly cause victim to catch fire 	
damage 	() 	Flame particles will do damage to the victim but the victim will not catch fire 	
min_displace	(n) 	Random y displacement range min 	(0.0)
max_displace	(n) 	Random y displacement range max 	(1.25)
yorient 	() 	Orients fire to y-axis only 	
sinspeed 	(f) 	Amount to increment max_radius by using sine 	(0.0)
sinpos 	(f) 	Starting angle in radians 	(0.0)
linespeed 	(f) 	Amount to increment linepos by 	(0.0)
linepos 	(f) 	Starting point on line from 0-1 	(0.0)
 
====FireB====
Similar to regular fire but uses a conical volume specified by four radii to accelerate through for simulating fire Breathing/throwing. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b) 	Vertex color 	(0.8,0.5,0.0)
velocity 	(x,y,z) 	Initial flame velocity before acceleration 	(0.0,8.0,0.0)
accel 	(x,y,z) 	Constant of acceleration 	(0.0,14.0,0.0)
flamesize 	(f) 	Size of individual flame relative to effect 	(1.75)
fctrl 	(min,max,i)	Controls for how a flame expands over time 	(-1.25, 1.25, 0.035)
alphafade 	(f) 	How fast to fade flame out 	(0.85)
count 	(n) 	The maximum number of particles to use 	(90)
min_count 	(n) 	The minimum number of particles to use 	(90)
cheap 	() 	Uses cheaper particle motion calculations 	
flamesize 	(f) 	Size of individual flame relative to effect 	(1.75)
dark 	() 	Uses an alternate blending mode to look smoky 	
fdamage 	(min,max,f)	Flame damage min,max, alpha fit filter - fit >= 0.2 	(3.0,7.0,0.2)
obb_freq 	(f) 	How often to generate obb 	(0.1)
ignite 	() 	Fire will do damage determined by fdamage and possibly cause victim to catch fire	
damage 	() 	Flame particles will do damage to the victim but the victim will not catch fire 	
cvel 	() 	Turns off initial random velocity generation 	
velocity_s 	(f) 	Velocity scalar 	(1.0)
lower_r0 	(f) 	Inner cone radius nearest to spawn point 	(0.5)
lower_r1 	(f) 	Outer cone radius nearest to spawn point 	(1.25)
upper_r0 	(f) 	Inner cone radius furthest from spawn point 	(1.0)
upper_r1 	(f) 	Outer cone radius furthest from spawn point 	(3.25)
displace_min	(f) 	Min distance from r0 to r1 to determine cone 	(0)
displace_max	(f) 	Max distance from r0 to r1 to determine cone 	(0)
start_rate 	(f) 	How quickly to start burning 	(27.5)
end_rate 	(f) 	How quickly to stop burning 	(16.5)
light_spawn 	() 	Mixes in light sources with particles 	
light_freq 	(f) 	How many particles before light appears 	(50)
light_radius	(f) 	Radius to use for a lightsource particle 	(1)
 
====Flurry====
A bunch of particles moving in spherical polar coordinates with sinusoidal interference. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.0,0.0,1.0)
radius 	(f) 	Set the radius of the area of effect 	(1.0)
tin 	(f) 	Transition in time in seconds 	(1.0)
tout 	(f) 	Transition out time in seconds 	(1.0)
count 	(n) 	Number of particles 	(50)
iphi 	(f) 	Latitude angle increment 	(1.0)
itheta 	(f) 	Longitude angle increment 	(1.0)
iamp 	(f) 	Sinusoidal interference amplitude speed 	(1.0)
amplitude 	(f) 	Sinusoidal interference amplitude factor 	(1.0)
grow_params	(s,m,f)	Scaling factors at t for start, mid and end	(1.0,1.0,1.0)
 
====Lightsource====
Dynamic light source. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Light color 	(0.5,0.5,0.5)
color1 	(r,g,b)	Variance color 	(0.5,0.5,0.5)
iradius 	(f) 	Inner falloff radius 	(0)
radius 	(f) 	Outer falloff radius 	(5.0)
tin 	(f) 	Transition in time in seconds 	(1.0)
tout 	(f) 	Transition out time in seconds	(1.0)
frequency 	(f) 	Flicker frequency 	(0.025)
draw_shadow	() 	Draw a shadow or not 	FALSE
====Lightning====
Simple fractal generated lightning/electricity effect that can be strung through numerous targets. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b) 	Vertex color 	(0.6,0.7,1.0)
damage 	(min,max,0)	Damage range to apply if specified 	(5.0,10.0, 0)
bolt_life 	(f) 	How long a bolt lasts before fading out	(0.4)
subd 	(f) 	Level of bolt subdivision 	(0.4)
minsubd 	(f) 	Minimum level of subdivision 	(2.0)
mindisplace 	(f) 	Minimum distance to stray from center 	(0.100)
maxdisplace 	(f) 	Maximum distance to stray from center 	(0.165)
check_ground	() 	Prevents point generation below ground 	
====LineTracer====
Leaves a textureless tracer behind as the targets move though space. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	point a color 	(1.0,1.0,1.0)
color1 	(r,g,b)	point b color 	(1.0,1.0,1.0)
fade_rate	(f) 	How fast to fade the tracer after reaching target	(0.10)
tin 	(f) 	Transition in time in seconds 	(0.5)
tout 	(f) 	Transition out time in seconds 	(0.5)
lock 	() 	Locks to a third reference target 	
Point a and point b are the two points that make up a segment of a trace effect one being the outer point and one the inner.
The reference target is the third target that must be added to the linetracers target list last in order to preserve the target order and the lock() parameter must be specified.
====Orbiter====
One single particle that orbits a target using spherical polar coordinates. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.6,0.7,1.0)
radius 	(f) 	Radius of the effect 	(1.0)
theta 	(f) 	Longitude angle 	(0)
itheta 	(f) 	Longitude angle increment 	(0)
phi 	(f) 	Latitude angle 	(0)
iphi 	(f) 	Latitude angle increment 	(2.0)
tin 	(f) 	Transition in time in seconds 	(1.0)
tout 	(f) 	Transition out time in seconds 	(1.0)
scale 	(f) 	scale of the particle 	(1.0)
vdisplace 	(f) 	additive vertical displacer value 	(0)
radiusi 	(f) 	additive radial increment - makes spirals 	(0)
invisible 	() 	doesn't draw anything - use this for tracking 	
model 	(text) 	Template name of model to use for orbit 	
model_sin 	(f) 	Scale in duration 	(1.0)
model_sout	(f) 	Scale out duration 	(1.0)
model_smax	(f) 	Scale scalar 	(1.0)
rot_inc 	(x,y,z)	Model rotation incrementation amounts 	(0.0, 0.0, 0.0)
smooth 	() 	Base position on average of recorded positions	
shistory 	(f) 	History depth 	(16)
free 	() 	Uses own orientation instead of targets 	
====PointTracer====
Pre-calculated trajectory tracer traces a single point using a line, textureless. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(1.0,1.0,1.0)
fade_rate 	(f) 	How fast to fade the tracer after reaching target	(2.0)
decay_rate	(f) 	Controls tail length - smaller makes longer 	(0.08)
velocity 	(f) 	Velocity of the tracer - matches what its tracing	(17.0)
frequency 	(f) 	*Controls the level of detail 	(0.01)
period 	(f) 	*Controls the level of detail 	(3.0)
* Period/frequency determines the number of points sampled. If this value is greater than 400 the trajectory will truncate. The period is equal to the number of seconds the trajectory is in flight.
====PolygonalExplosion====
A bunch of textureless n-sided polygons start from a flat plane and explode out while rotating and stick into the ground, textureless. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.2,0.2,0.85)
fade_range	(s,e,0)	Set the range of the fading start to end 	(0.5,1.0,0.0)
poly_sides	(n) 	Set the max random sides for an n-sided poly	(9)
count 	(n) 	Set the maximum number of polygons used 	(200)
radius 	(f) 	Set the radius of the area of effect 	(0.75)
mag 	(f) 	Set the magnitude of the explosion 	(1.0)
rotrange 	(x,y,z)	Sets the rotation range for a particle 	(200.0,200.0,200.0)
displace 	(x,y,z)	Sets the displacement range from the origin 	(0, 0, 0)
 
====Sparkles====
Random spherically spawned particles alpha in and then out while never moving from the spawn point. 
Mnemonic	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.0,1.0,0.0)
radius 	(f) 	Set the radius of the area of effect	(1.00)
count 	(n) 	Number of particles 	(60)
psize 	(f) 	Particle size scalar 	(1.0)
yvel 	(f) 	Velocity of particle in Y 	(0)
 
SPE - Abbreviation for spatiotemporal pattern effect, I didn't really know what to call this one. Probably the most parameterizable effect out of all of them. Default characteristics make it look like a ring, which moves up and down. 
It is possible to generate a stupidly huge number of different looking effects from this effect using all the different parameters - however you need to understand how it works in order to control it. I will now make a feeble attempt to explain how it works - sorry about the trig but I don't really know another way to explain it. 
The calculation of a position for a single particle is determined by the function below and is done separately for each of the positions x, y, and z components as follows: 
 Position = (sin(index0) + sin(index1)) / 2 
So all this really does is just average the result of the sine of the two index values. If you want to simplify this further then just make both of the indices the same and it would mean that the position calculation would be: 
 Position = sin(index0) 
(It doesn't matter which index value we use since index0 = index1) 
How the actual movement of a particle occurs is the result of adding a value to the index, which is done by adding the values you specify in the speed0 and speed1 parameters. The larger the value the bigger the change and the faster the particle moves. 
The last parameters relating to the pattern generation are space parameters space0 and space1. They do just what they imply, they space the particles apart from each other. The larger the value the greater the distance is between each particle but, since we are basing all of our calculations off of sine we know the periodicity and can always calculate what would cause a group of particles to connect back up by dividing 2*PI by count which equals 0.09817477 for 64 particles - the default settings. 
If you look at the default settings for index, speed, and space now it should make a bit more sense why the default behavior for the SPE effect produces a ring that moves up and down because if you look at the default settings for speed you will notice that it only adds to 1.0 to Y and not X or Z and why the ring moves just like a sine. Looking at the values for index0 and index1 they are both the same value of 1.57 which is roughly PI/2 or 90 degrees which is what cosine is: sin( PI/2 + angle ) = cos( angle ). 
This is why the default pattern is circular since the parametric equation of a circle is: 
 x = cos(angle) y = sin(angle)
If you look at the spacing the values they are (0.098, 0.0, 0.098) which specifies that spacing only occurs for x and z and why it is drawn in the XZ plane. 
If you wanted the circle to be in another plane such as the XY plane you just transpose z with y for the indexes and spacing and get (0.0,1.57,0.0) and (0.098,0.098,0) respectively. Moving it left to right instead of up and down is done by changing both speed values to (1.0,0,0) 
Mnemonic	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.6,0.7,1.0)
radius 	(f) 	Radius of the effect 	(1.0)
scale 	(f) 	Scale of each particle 	(0.12)
index0 	(x,y,z)	First sinusoidal index for x, y, and z 	(0.0,0.0,1.57)
index1 	(x,y,z)	Second sinusoidal index for x, y, and z	(0.0,0.0,1.57)
speed0 	(x,y,z)	First speed value for x, y, and z 	(0.0,1.0,0.0)
speed1 	(x,y,z)	Second speed value for x, y, and z 	(0.0,1.0,0.0)
space0 	(x,y,z)	First space value for x, y, and z 	(0.098,0.0,0.098)
space1 	(x,y,z)	Second space value for x, y, and z 	(0.098,0.0,0.098)
count 	(n) 	Number of particles 	(64)
tin 	(f) 	Transition in time in seconds 	(1.0)
tout 	(f) 	Transition out time in seconds 	(1.0)
====Spawn====
Object spawning effect. 
Mnemonic 	Format 	Description 	Default
model 	(text) 	Template name of model to use for spawning	(frag_glb_bone_06)
spawn_int 	(f) 	Spawn interval 	(0.5)
spawn_count	(f) 	Spawn count 	(1)
count 	(f) 	Max objects to spawn 	(16.0)
sr_min 	(f) 	Starting radius -minimum 	(0.5)
sr_max 	(f) 	Starting radius -maximum 	(1.0)
er_min 	(f) 	Ending radius - minimum 	(1.0)
er_max 	(f) 	Ending radius - maximum 	(1.5)
lvel 	(x,y,z)	Linear velocity base 	(0.0, 8.0, 0.0)
lvel_var 	(x,y,z)	Linear velocity variance 	(0.0, 2.0, 0.0)
lacc 	(x,y,z)	Linear acceleration base 	(0.0, 0.0, 0.0)
lacc_var 	(x,y,z)	Linear acceleration variance 	(0.0, 0.0, 0.0)
avel 	(x,y,z)	Angular velocity base 	(0.0, 0.0, 4.0)
avel_var 	(x,y,z)	Angular velocity variance 	(0.0, 0.0, 5.0)
aacc 	(x,y,z)	Angular acceleration base 	(0.0, 0.0, 0.0)
aacc_var 	(x,y,z)	Angular acceleration variance 	(0.0, 0.0, 0.0)
====Sphere====
Textureless tessellated translucent sphere. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.25,0.0,0.5)
color1 	(r,g,b)	Line color 	(0.5,0.5,0.5)
subd 	(n) 	Level of subdivision 	(1)
grow_params	(s,m,e)	Scaling factors at t for start, mid and end	(1.0,1.0,1.0)
lines 	() 	Draws polygonal lines 	
cull 	() 	Backface cull 	
rotate 	(x,y,z)	rotational offset relative to the model 	(0.0,0.0,0.0)
irotate 	(x,y,z)	rotational offset increment 	(0.0,0.0,0.0)
sides 	(n) 	Number of side segments to draw 	(20)
tin 	(f) 	Transition in time in seconds 	(1.0)
tout 	(f) 	Transition out time in seconds 	(1.0)
====SRay====
Spinning Ray - multiple spinning rays originate from a point on a sphere going straight out. 
Mnemonic	Format 	Description 	Default
color0 	(r,g,b)	Starting color 	(0.9,0.9,1.0)
color1 	(r,g,b)	Ending color 	(0.2,0.2,1.0)
color2 	(r,g,b)	Randomness - color variance to apply to both ends	(0.0,0.0,0.0)
radius 	(f) 	Radius of sphere to originate rays from 	(0.0005)
count 	(n) 	Number of rays to draw 	(16)
lmin 	(f) 	Minimum length of a ray 	(10.0)
lmax 	(f) 	Maximum length of a ray 	(10.0)
wsmin 	(f) 	Minimum start width of ray 	(0.15)
wsmax 	(f) 	Maximum start width of ray 	(0.15)
wemin 	(f) 	Minimum end width of ray 	(0.15)
wemax 	(f) 	Maximum end width of ray 	(0.15)
theta 	(f,f,f)	Start, min increment, max increment 	(0.0,1.0,3.0)
phi 	(f,f,f)	Start, min increment, max increment 	(0.0,1.0,-3.0)
alpha 	(f,f,f)	Start, fade min, fade max 	(1.0,0.5,0.5)
srate 	(f) 	Spawn rate - period before next ray is spawned 	(0.015)
====Steam====
Particles randomly appear within a circular radius and accelerate upwards as they fade out and scale up. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(0.6,0.7,1.0)
dark 	() 	Uses an alternate blending mode to look smoky 	
velocity 	(x,y,z)	Initial wisp velocity 	(0.0,5.75,0.0)
accel 	(x,y,z)	Acceleration constant 	(0.0,4.0,0.0)
alphafade 	(f) 	Factor for fading out a wisp 	(0.55)
alphastart	(f) 	Alpha value to start wisp texture at 	(1.0)
wispsize 	(f) 	Factor for scaling an individual wisp 	(2.25)
instant 	() 	Steam instantly has volume 	
count 	(n) 	The maximum number of particles to use 	(96)
min_count 	(n) 	The minimum number of particles to use 	(96)
cheap 	() 	Uses cheaper particle motion calculations 	
line 	() 	Uses object and subject targets to draw a line of fire through. 	
rect 	() 	Uses object and subject targets to define a rectangular area to spawn the particles from.	
====Trackball====
A single particle which moves in a straight line or follows a target. 
Mnemonic 	Format 	Description 	Default
color0 	(r,g,b)	Vertex color 	(1.0,0.0,0.0)
radius 	(f) 	Radius of spiral interference 	(0.0)
spin 	(f) 	Spiraling spin speed 	(0.0)
accel 	(f) 	Rate of acceleration 	(2.5)
velocity 	(f) 	Initial velocity 	(5.0)
rvel_min 	(f) 	Random velocity min 	(0.0)
rvel_max 	(f) 	Random velocity max 	(0.0)
max_velocity 	(f) 	Maximum velocity 	(80.0)
kdamp 	(f) 	Coefficient of damping 0.0 - 1.0 	(0.45)
damped 	() 	Limits how sharp a turn can be 	
homing 	() 	Adjusts to hit target 	
theta 	(f) 	Radian angle to start spinning from 	*random
afterlife 	(f) 	Number of seconds to exist after a collision 	(0.0f)
hit_target_only 	() 	Checks for collision with intended target only	(false)
invisible 	() 	Effect is not drawn 	
no_collide 	() 	Does not perform a collision check 	
no_collide_objects	() 	Does not perform collision checks with objects	
==Appendix B: Camera Command Parameters==
====Camera quake====
Shakes the camera like Santa's belly. 
Property 	Description 	Default
magnitude_x 	Magnitude of x quake 	1.0
magnitude_y 	Magnitude of y quake 	1.0
magnitude_z 	Magnitude of z quake 	1.0
duration 	Duration for effect to last in seconds (0 for infinite) 	1.0
camera_space 	Shake in camera space, otherwise shake in object (node) space	false
self_destruct	Self-destruct on algorithm completion 	false
epicenter 	Goid of the object causing the quake 	
falloff 	How quickly the quake starts to fall off in magnitude 	12.0
====Camera stomp====
Shakes the camera. Sharp shake with quick falloff. 
Property 	Description 	Default
magnitude_x 	Magnitude of x stomp 	0.0
magnitude_y 	Magnitude of y stomp 	1.0
magnitude_z 	Magnitude of z stomp 	0.0
duration 	Duration for effect to last in seconds (0 for infinite) 	0.3
frequency 	Frequency of sine wave to apply to stomp per effect run 	3.0
camera_space 	Shake in camera space, otherwise shake in object (node) space	false
self_destruct	Self-destruct on algorithm completion 	false
epicenter 	Goid of the object causing the stomp 	
falloff 	How quickly the quake starts to fall off in magnitude 	12.0
==Appendix C: Bones in the Farm Girl Model==
The top bone in a biped is the Bip01_Pelvis bone. If you don't specify a different attach point then effects will start on the top bone in a model.
:Bip01_Pelvis 
:Bip01_L_Thigh 
:Bip01_L_Calf 
:Bip01_L_Foot 
:Bip01_L_Toe0 
:leftfoot_pin 
:Bip01_R_Thigh 
:Bip01_R_Calf 
:Bip01_R_Foot 
:Bip01_R_Toe0 
:rightfoot_pin 
:Bip01_Spine 
:Bip01_Spine1 
:Bip01_Spine2 
:Bip01_Neck 
:Bip01_Head 
:Bip01_Ponytail1 
:Bip01_Ponytail11 
:Bip01_Ponytail12 
:Bip01_Ponytail13 
:Bip01_L_Clavicle 
:Bip01_L_UpperArm 
:Bip01_L_Forearm 
:Bip01_L_Hand 
:Bip01_L_Finger0 
:Bip01_L_Finger01 
:Bip01_L_Finger1 
:Bip01_L_Finger11 
:shield_grip 
:Bip01_R_Clavicle 
:Bip01_R_UpperArm 
:Bip01_R_Forearm 
:Bip01_R_Hand 
:Bip01_R_Finger0 
:Bip01_R_Finger01 
:Bip01_R_Finger1 
:Bip01_R_Finger11 
:weapon_grip 
Category:Dungeon Siege Editor