Homeworld Effects Manual: createEffects()

createEffects(filename effectfile, int num, int numDist, [parameter list])

creates num effects, plus or minus numDist

num and numDist can be integer constants, or integer variables. Floating-point values are obviously illegal; creating 0.707 effects is meaningless. Using a floating-point constant or variable will cause a crash. Leaving out a parameter causes a run-time crash.

createEffects() creates num copies of the effect in the file effectfile, plus or minus numDist. Relative paths are acceptable, and the default directory is homeworld\etg\, so ..\myfx\multiboom.ebg refers to the file homeworld\myfx\multiboom.ebg. You do not need to put quotation marks around the file name. After the filename come num and numDist, like all the other create* commands, but after those parameters you can pass parameters to the file you are calling. For example, this is the startup line of damagecapitallight.ebg:

eventStart(float damage, float size)

And here is the command to create 5 of those effects, with a damage of 0.2 and a size of 50:

createEffects(damagelightcapital.ebg, 5, 0, 0.2, 50.0)

You can leave out parameters, or even pass extra ones. The extra ones will be ignored, and any missing parameters will use default values. If no default values are specified, as is the case in damagecapitallight.ebg, the variables will contain garbage.

If you want the same number of effects created every time, numDist should be zero. Otherwise, you'll end up with somewhere between (num + numDist) and (num - numDist) sprites.