Well, sorry for the 'hijacking' of the thread.
Here's the current working version of my Explosions.Fire_Flare() method. I've tested it out with ship destruction, which is currently the only event which calls this method. I had temporarily caused different flare colors to be invoked for different explosion sizes, as a means of verifying that I was passing the various variables correctly.
public static void Fire_Flare(Point3d point3d, int iColor, double dDelay, double dDelay2, float fLiveTime)
//NEW by WxTech; emergency flare fired from destroyed ships, with variable chance of occurrence by ship and explosion size
//called by BigshipGeneric.showExplode() and ShipGeneric.showExplode()
//iColor sets the flare burn color; dDelay is the earliest delay time; dDelay2 is the longest delay time
//fLiveTime is the duration of the burn effect
{
if (Config.isUSE_RENDER())
{
final Loc loc_1 = new Loc(point3d);
final Vector3d vf = new Vector3d();
String sColor = "3DO/Effects/Tracers/Piropatron/Flare_Burn_Red.eff";
if (iColor < 1)
iColor = 1;
if (iColor > 5)
iColor = 5;
if (iColor == 1)
sColor = "3DO/Effects/Tracers/Piropatron/Flare_Burn_White.eff";
if (iColor == 2)
sColor = "3DO/Effects/Tracers/Piropatron/Flare_Burn_Red.eff";
if (iColor == 3)
sColor = "3DO/Effects/Tracers/Piropatron/Flare_Burn_Green.eff";
if (iColor == 4)
sColor = "3DO/Effects/Tracers/Piropatron/Flare_Burn_Yellow.eff";
if (iColor == 5)
sColor = "3DO/Effects/Tracers/Piropatron/Flare_Burn_Orange.eff";
final String sCol = sColor;
double tim = TrueRandom.nextDouble(dDelay, dDelay2); //time to wait after invocation (15-45s for ship destruction)
final float f_1 = fLiveTime;
new MsgAction(tim)
{
public void doAction(Object obj)
{
vf.set((double) TrueRandom.nextFloat(-0.3F, 0.3F), (double) TrueRandom.nextFloat(-0.3F, 0.3F), 1.0);
vf.normalize();
vf.scale((double) TrueRandom.nextFloat(65.0F, 75.0F)); //speed scale factor, to get m/s
BallisticProjectile ballisticprojectile = new BallisticProjectile(loc_1.getPoint(), vf, f_1);
Eff3DActor eff3dactor = Eff3DActor.New(ballisticprojectile, null, null, 1.0F, sCol, f_1); //NEW effect
if (World.Sun().ToSun.z < 0.0F)
{
float scaleLight = MiscEffects.cvt(World.Sun().ToSun.z, -0.25F, 0.0F, 1.0F, 0.5F);
LightPointActor lightpointactor = new LightPointActor(new LightPointWorld(), new Point3d());
lightpointactor.light.setColor(1.0F, 0.1F, 0.0F);
lightpointactor.light.setEmit(1.0F * scaleLight, 30F * scaleLight);
eff3dactor.draw.lightMap().put("light", lightpointactor);
}
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Tracers/Piropatron/Flare_Smoke.eff", f_1); //NEW effect
}
};
}
}