Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3]   Go Down

Author Topic: The effect of flares being fired up from the airfield in SAS Modact 5.3  (Read 1727 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6010

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.

Code: [Select]
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
}
};
}
}
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

gunny0134

  • member
  • Offline Offline
  • Posts: 1117
  • no skill just simple, but seek the best beauty !!

It might be worthwhile to go back to v1.6 and tweak the file or files needing adjustment or do a swap.
Yes, I'll refer to it well.

Well, sorry for the 'hijacking' of the thread. ;) 
You can hijack this post as much as you want because it's not a thread that provides users with any practically available files by me.

Thank you.

Logged
Pages: 1 2 [3]   Go Up
 

Page created in 0.036 seconds with 25 queries.