Instead of this simple visual effect being based on the rocket class, how about making it a basic static object or vehicle calling a simple visual effect when a defined condition is met? I've already created a new method in Explosions.class for the firing of a flare from destroyed ships. It can be utilized by any object desired. Below is my method as currently constructed. It could be expanded upon so as to have passed to it a variable that sets the color. For example:
public static void Fire_Flare(Point3d point3d, int iColor)
Integer iColor could be set in the class calling this method as, say, 1 = white, 2 = red, 3 = green, etc...
The calling class could utilize code setting a 'danger' threshold when enemies are within a certain distance, when take-off is requested, etc.
My new method in my modded Explosions.class. The flare is a simple ballistic projectile, and has a smoke trail generated. The firing direction has a random departure from vertical, and there is a light source attached which illuminates the nearby surroundings (enabled when the Sun is below the horizon, but could be active all the time, if desired).
Incidentally, I've modded BallisticProjectile.class so that all ballistic projectiles make a splash/dust cloud upon contact with the water/ground (if not timed out before contact.) This causes them to also be immediately removed from the world, instead of remaining to fall under the surface until timed out.
public static void Fire_Flare(Point3d point3d)
//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()
{
if (Config.isUSE_RENDER())
{
final Loc loc_1 = new Loc(point3d);
final Vector3d vf = new Vector3d();
double tim = TrueRandom.nextDouble(15.0, 45.0); //time to wait after destruction; was 15, 45
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
float f_1 = 15F; //live time in seconds
BallisticProjectile ballisticprojectile = new BallisticProjectile(loc_1.getPoint(), vf, f_1);
Eff3DActor eff3dactor = Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Tracers/Piropatron/Flare_Burn_Red.eff", 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
}
};
}
}