Gabriel,
Did you try using the ENTIRE code I posted previously? If so, you will need this (which I placed just preceding the drawEffects() method, but which can be placed anywhere inside public class Gear):
private boolean bIsAboveCriticalSpeed; //NEW
private static final int UNINITIALIZED = -1; //NEW
private static final int BELOW_CRITICAL_SPEED = 0; //NEW
private static final int ABOVE_CRITICAL_SPEED = 1; //NEW
private int oldCriticalSpeedThreshold = UNINITIALIZED; //NEW
Below is the full stock 4.09 Gear.drawEffects() method. The new code for ONLY the crash splash effect under discussion here is the 7 lines bounded by the "//==============" lines. Copy just that small block into your existing code. If this works, and you want to proceed to adapting the additional effects, then add the 5 lines in the code window above. I haven't looked into the compatibility of the World.CAMOUFLAGE useage
here; does 4.09 require to use the number values? And are sand runway plates (via boolean bPlateSand) supported? Things to keep in mind.
private void drawEffects()
{
boolean flag = FM.isTick(16, 0);
for(int i = 0; i < 3; i++)
if(bIsSail && flag && isWater && clp[i] && FM.getSpeedKMH() > 10F)
{
if(clpGearEff[i][0] == null)
{
clpGearEff[i][0] = Eff3DActor.New(FM.actor, null, new Loc(new Point3d(Pnt[i]), new Orient(0.0F, 0.0F, 0.0F)), 1.0F, "3DO/Effects/Tracers/ShipTrail/WakeSmaller.eff", -1F);
clpGearEff[i][1] = Eff3DActor.New(FM.actor, null, new Loc(new Point3d(Pnt[i]), new Orient(0.0F, 0.0F, 0.0F)), 1.0F, "3DO/Effects/Tracers/ShipTrail/WaveSmaller.eff", -1F);
}
} else
if(flag && clpGearEff[i][0] != null)
{
Eff3DActor.finish(clpGearEff[i][0]);
Eff3DActor.finish(clpGearEff[i][1]);
clpGearEff[i][0] = null;
clpGearEff[i][1] = null;
}
for(int j = 0; j < pnti.length; j++)
{
//===============================NEW by WxTech; to generate a separate effect for water crashes, instead of sharing the float spray effect==========================================
if(isWater && !bIsSail && clp[j] && FM.Vrel.length() > 12.0D && !isUnderDeck())
{
if(clpEff[j] != null)
continue;
clpEff[j] = Eff3DActor.New(FM.actor, null, new Loc(new Point3d(Pnt[j]), new Orient(0.0F, 90F, 0.0F)), 1.0F, "Effects/Smokes/SmokeAirSplatCrash.eff", -1F); //NEW effect
continue;
}
//==================================================================================================================================================================================
if(clp[j] && FM.Vrel.length() > 16.66666667D && !isUnderDeck())
{
if(clpEff[j] == null)
{
if(isWater)
effectName = "EFFECTS/Smokes/SmokeAirSplat.eff";
else
if(World.cur().camouflage == 1)
effectName = "EFFECTS/Smokes/SmokeAirTouchW.eff";
else
effectName = "EFFECTS/Smokes/SmokeAirTouch.eff";
clpEff[j] = Eff3DActor.New(FM.actor, null, new Loc(new Point3d(Pnt[j]), new Orient(0.0F, 90F, 0.0F)), 1.0F, effectName, -1F);
}
} else
if(flag && clpEff[j] != null)
{
Eff3DActor.finish(clpEff[j]);
clpEff[j] = null;
}
}
if(FM.EI.getNum() > 0)
{
for(int k = 0; k < FM.EI.getNum(); k++)
{
FM.actor.pos.getAbs(Aircraft.tmpLoc1);
Pn.set(FM.EI.engines[k].getPropPos());
Aircraft.tmpLoc1.transform(Pn, PnT);
float f = (float)(PnT.z - Engine.cur.land.HQ(PnT.x, PnT.y));
if(f < 16.2F && FM.EI.engines[k].getThrustOutput() > 0.5F)
{
Pn.x -= f * Aircraft.cvt(FM.Or.getTangage(), -30F, 30F, 8F, 2.0F);
Aircraft.tmpLoc1.transform(Pn, PnT);
PnT.z = Engine.cur.land.HQ(PnT.x, PnT.y);
if(clpEngineEff[k][0] == null)
{
Aircraft.tmpLoc1.transformInv(PnT);
if(isWater)
{
clpEngineEff[k][0] = Eff3DActor.New(FM.actor, null, new Loc(PnT), 1.0F, "3DO/Effects/Aircraft/GrayGroundDust2.eff", -1F);
clpEngineEff[k][1] = Eff3DActor.New(new Loc(PnT), 1.0F, "3DO/Effects/Aircraft/WhiteEngineWaveTSPD.eff", -1F);
} else
{
clpEngineEff[k][0] = Eff3DActor.New(FM.actor, null, new Loc(PnT), 1.0F, "3DO/Effects/Aircraft/GrayGroundDust" + (World.cur().camouflage != 1 ? "1" : "2") + ".eff", -1F);
}
continue;
}
if(isWater)
{
if(clpEngineEff[k][1] == null)
{
Eff3DActor.finish(clpEngineEff[k][0]);
clpEngineEff[k][0] = null;
continue;
}
} else
if(clpEngineEff[k][1] != null)
{
Eff3DActor.finish(clpEngineEff[k][0]);
clpEngineEff[k][0] = null;
Eff3DActor.finish(clpEngineEff[k][1]);
clpEngineEff[k][1] = null;
continue;
}
Aircraft.tmpOr.set(FM.Or.getAzimut() + 180F, 0.0F, 0.0F);
clpEngineEff[k][0].pos.setAbs(PnT);
clpEngineEff[k][0].pos.setAbs(Aircraft.tmpOr);
clpEngineEff[k][0].pos.resetAsBase();
if(clpEngineEff[k][1] != null)
{
PnT.z = 0.0D;
clpEngineEff[k][1].pos.setAbs(PnT);
}
} else
{
if(clpEngineEff[k][0] != null)
{
Eff3DActor.finish(clpEngineEff[k][0]);
clpEngineEff[k][0] = null;
}
if(clpEngineEff[k][1] != null)
{
Eff3DActor.finish(clpEngineEff[k][1]);
clpEngineEff[k][1] = null;
}
}
}
}
}
The new crash splash effect to create: Effects/Smokes/SmokeAirSplatCrash.eff. Write into that new .eff file the contents in the code box below. My MatName is new. The MatName you will use for initial experimentation could be the same as found in SmokeAirSplat.eff, or as used by another water splash effect. I find that a good texture is a vertically oriented splash shaped rather like an onion; not too skinny!
[ClassInfo]
ClassName TParticlesSystemParams
[General]
MatName ../Materials/WaterCrash.mat // <----make this the same as for an existing splash effect for testing
Color0 0.9 0.9 0.9 0.6
Color1 0.7 0.7 0.7 0.0
nParticles 40
FinishTime -1
MaxR 0
PhiN 0
PsiN 0
LiveTime 5
EmitFrq 8
EmitVelocity 10 40
EmitTheta 0 180
GasResist 0.2
VertAccel -10
Wind 0
Size 7 80
Rnd 0.2
For quick reference, Here are the map CAMOUFLAGE names and equivalent numerical value:
// CAMOUFLAGE_SUMMER = 0;
CAMOUFLAGE_WINTER = 1;
CAMOUFLAGE_DESERT = 2;
CAMOUFLAGE_PACIFIC = 3;
CAMOUFLAGE_ETO = 4;
CAMOUFLAGE_MTO = 5;
CAMOUFLAGE_CBI = 6;