Beta mod text of the GO-229 class file.
I am attempting to create a beta mod of the Go-229A3NJ class file, that I can use to create a new aircraft based on it, experimenting with a new FM/weapons.
Beta File text.
package com.maddox.il2.objects.air;
import com.maddox.JGP.Point3d;
import com.maddox.JGP.Tuple3d;
import com.maddox.il2.ai.*;
import com.maddox.il2.ai.air.Maneuver;
import com.maddox.il2.ai.air.Pilot;
import com.maddox.il2.engine.*;
import com.maddox.il2.fm.*;
import com.maddox.il2.game.*;
import com.maddox.il2.objects.bridges.BridgeSegment;
import com.maddox.il2.objects.humans.Soldier;
import com.maddox.il2.objects.sounds.Voice;
import com.maddox.il2.objects.weapons.*;
import com.maddox.rts.*;
import java.io.IOException;
import java.io.PrintStream;
import com.maddox.rts.Finger;
import com.maddox.rts.Property;
import com.maddox.util.HashMapInt;
import java.util.ArrayList;
// Referenced classes of package com.maddox.il2.objects.air:
// GO_229, PaintSchemeFMPar05, TypeFighterAceMaker, TypeBNZFighter,
// TypeX4Carrier, TypeStormovik, TypeRadarLiSN2Carrier, NetAircraft,
// Aircraft
public class GO_229A3NJbeta extends GO_229
implements TypeFighterAceMaker, TypeBNZFighter, TypeX4Carrier, TypeStormovik, TypeRadarLiSN2Carrier
{
public GO_229A3NJbeta()
{
radarGain = 50;
radarMode = 0;
tX4Prev = 0L;
deltaAzimuth = 0.0F;
deltaTangage = 0.0F;
X4check = false;
missilesList = new ArrayList();
homing = false;
X7 = false;
IR = false;
k14Mode = 0;
k14WingspanType = 0;
k14Distance = 200F;
k14Auto = 0;
k14IFFmode = 1;
}
public void onAircraftLoaded()
{
super.onAircraftLoaded();
missilesList.clear();
createMissilesList();
}
public void createMissilesList()
{
for(int i = 0; i < FM.CT.Weapons.length; i++)
if(FM.CT.Weapons[i] != null)
{
for(int j = 0; j < FM.CT.Weapons[i].length; j++)
if(FM.CT.Weapons[i][j] instanceof RocketGunX4)
{
if((FM.CT.Weapons[i][j] instanceof RocketGunX4homing) || (FM.CT.Weapons[i][j] instanceof RocketGunX7homing))
homing = true;
if(FM.CT.Weapons[i][j] instanceof RocketGunX7)
X7 = true;
if(FM.CT.Weapons[i][j] instanceof RocketGunX4R)
IR = true;
missilesList.add(FM.CT.Weapons[i][j]);
}
}
}
public void launchMsl()
{
if(missilesList.isEmpty())
{
return;
} else
{
((RocketGunX4)missilesList.remove(0)).shots(1);
return;
}
}
public void update(float f)
{
super.update(f);
if(this == World.getPlayerAircraft())
typeFighterAceMakerRangeFinder();
}
public void rareAction(float f, boolean flag)
{
super.rareAction(f, flag);
if((FM instanceof RealFlightModel) && ((RealFlightModel)FM).isRealMode() || !flag || !(FM instanceof Pilot))
return;
if(missilesList.isEmpty())
return;
if(Time.current() > tX4Prev + (!homing && !IR ? 500L : 10000L))
{
Pilot pilot = (Pilot)FM;
if((pilot.get_maneuver() == 27 || pilot.get_maneuver() == 62 || pilot.get_maneuver() == 63) && ((Maneuver) (pilot)).target != null)
{
Point3d point3d = new Point3d(((FlightModelMain) (((Maneuver) (pilot)).target)).Loc);
point3d.sub(FM.Loc);
FM.Or.transformInv(point3d);
if(homing && !X7)
{
if(pilot.get_maneuver() != 63 ? point3d.x > (FM.CT.Weapons[0][1].countBullets() <= 20 ? 350D : 800D) && point3d.x < 3500D + 500D * (double)FM.Skill : point3d.x > 7000D && point3d.x < 10000D || point3d.x > 350D && point3d.x < 9000D && World.Rnd().nextFloat() < 0.33F)
{
double d = Math.pow(point3d.x / 5000D, 2D) * 5000D;
if(point3d.y < d && point3d.y > -d && point3d.z < d && point3d.z > -d && (pilot.get_maneuver() != 63 || point3d.x < 7000D || point3d.y * 2D < point3d.x && point3d.y * 2D > -point3d.x && point3d.z * 2D < point3d.x && point3d.z * 2D > -point3d.x))
{
Orientation orientation2 = new Orientation();
Orientation orientation3 = new Orientation();
FM.getOrient(orientation2);
((Maneuver) (pilot)).target.getOrient(orientation3);
float f3 = Math.abs(orientation2.getAzimut() - orientation3.getAzimut()) % 360F;
f3 = f3 <= 180F ? f3 : 360F - f3;
f3 = f3 <= 90F ? f3 : 180F - f3;
float f4 = Math.abs(orientation2.getTangage() - orientation3.getTangage()) % 360F;
f4 = f4 <= 180F ? f4 : 360F - f4;
f4 = f4 <= 90F ? f4 : 180F - f4;
double d2 = (point3d.x * (double)(5 - FM.Skill)) / (double)(((Maneuver) (pilot)).target.getSpeed() + 1.0F);
if((double)f3 < d2 && (double)f4 < d2)
{
launchMsl();
tX4Prev = Time.current();
Voice.speakAttackByRockets(this);
}
}
}
} else
if((pilot.get_maneuver() != 63 ? point3d.x > (FM.CT.Weapons[0][1].countBullets() <= 20 ? 350D : 800D) && point3d.x < 2000D + 1000D * (double)FM.Skill : point3d.x > 4000D && point3d.x < 5500D || point3d.x > 100D && point3d.x < 5000D && World.Rnd().nextFloat() < 0.33F) && (point3d.y * 1.5D < point3d.x && point3d.y * 1.5D > -point3d.x && point3d.z * 2D < point3d.x && point3d.z * 2D > -point3d.x))
{
Orientation orientation = new Orientation();
Orientation orientation1 = new Orientation();
FM.getOrient(orientation);
((Maneuver) (pilot)).target.getOrient(orientation1);
float f1 = Math.abs(orientation.getAzimut() - orientation1.getAzimut()) % 360F;
f1 = f1 <= 180F ? f1 : 360F - f1;
f1 = f1 <= 90F ? f1 : 180F - f1;
float f2 = Math.abs(orientation.getTangage() - orientation1.getTangage()) % 360F;
f2 = f2 <= 180F ? f2 : 360F - f2;
f2 = f2 <= 90F ? f2 : 180F - f2;
double d1 = (point3d.x * (4.5D - (double)FM.Skill)) / (double)(((Maneuver) (pilot)).target.getSpeed() + 1.0F);
if((double)f1 < d1 && (double)f2 < d1)
{
double d3 = FMMath.RAD2DEG(Math.atan(Math.sqrt(Math.pow(Math.tan(FMMath.DEG2RAD(f1)), 2D) + Math.pow(Math.tan(FMMath.DEG2RAD(f2)), 2D))));
com.maddox.JGP.Vector3d vector3d = ((Maneuver) (pilot)).target.getAccel();
double d4 = Math.sqrt(Math.pow(((Tuple3d) (vector3d)).x, 2D) + Math.pow(((Tuple3d) (vector3d)).y, 2D) + Math.pow(((Tuple3d) (vector3d)).z, 2D));
double d5 = (90D - d3) / (double)(9 + FM.Skill);
if(d4 < d5)
{
launchMsl();
tX4Prev = Time.current();
Voice.speakAttackByRockets(this);
}
}
}
} else
if(pilot.get_maneuver() == 43 && ((Maneuver) (pilot)).target_ground != null && (X7 || !IR && !homing) && (!(((Maneuver) (pilot)).target_ground instanceof Soldier) && !(((Maneuver) (pilot)).target_ground instanceof BridgeSegment) || !homing))
{
Point3d point3d1 = new Point3d();
((Maneuver) (pilot)).target_ground.pos.getAbs(point3d1);
point3d1.sub(FM.Loc);
FM.Or.transformInv(point3d1);
if(((Tuple3d) (point3d1)).x > 400D && ((Tuple3d) (point3d1)).x < (homing ? 4250D : IR ? 2250D : 1250D) + 250D * (double)FM.Skill)
{
if(!homing || !IR)
point3d1.x /= 2 - FM.Skill / 3;
if(homing ? ((Tuple3d) (point3d1)).y * 5D < ((Tuple3d) (point3d1)).x && ((Tuple3d) (point3d1)).y * 5D > -((Tuple3d) (point3d1)).x && ((Tuple3d) (point3d1)).z * 5D < ((Tuple3d) (point3d1)).x && ((Tuple3d) (point3d1)).z * 5D > -((Tuple3d) (point3d1)).x : ((Tuple3d) (point3d1)).y < ((Tuple3d) (point3d1)).x && ((Tuple3d) (point3d1)).y > -((Tuple3d) (point3d1)).x && ((Tuple3d) (point3d1)).z * 1.5D < ((Tuple3d) (point3d1)).x && ((Tuple3d) (point3d1)).z * 2D > -((Tuple3d) (point3d1)).x)
{
launchMsl();
tX4Prev = Time.current();
Voice.speakAttackByRockets(this);
}
}
}
}
}
public void typeX4CAdjAttitudePlus()
{
deltaTangage = 1.0F;
radarGain += 10;
if(radarGain > 100)
radarGain = 100;
}
public void typeX4CAdjAttitudeMinus()
{
deltaTangage = -1F;
radarGain -= 10;
if(radarGain < 0)
radarGain = 0;
}
public void typeX4CAdjSidePlus()
{
deltaAzimuth = 1.0F;
if(X4check)
X4check = false;
else
if((FM instanceof RealFlightModel) && ((RealFlightModel)FM).isRealMode())
typeFighterAceMakerAdjSideslipPlus();
radarMode++;
if(radarMode > 1)
radarMode = 0;
typeFighterAceMakerAdjSideslipPlus();
}
public void typeX4CAdjSideMinus()
{
deltaAzimuth = -1F;
if(X4check)
X4check = false;
else
if((FM instanceof RealFlightModel) && ((RealFlightModel)FM).isRealMode())
typeFighterAceMakerAdjSideslipMinus();
radarMode--;
if(radarMode < 0)
radarMode = 1;
typeFighterAceMakerAdjSideslipMinus();
}
public void typeX4CResetControls()
{
deltaAzimuth = deltaTangage = 0.0F;
tX4Prev = Time.current();
X4check = true;
radarGain = 50;
}
public float typeX4CgetdeltaAzimuth()
{
return deltaAzimuth;
}
public float typeX4CgetdeltaTangage()
{
return deltaTangage;
}
public boolean typeFighterAceMakerToggleAutomation()
{
k14Auto++;
if(k14Auto > 2)
k14Auto = 0;
k14Mode = k14Auto;
HUD.log(AircraftHotKeys.hudLogWeaponId, "K14AceMakerMode" + k14Auto);
return true;
}
public void typeFighterAceMakerAdjDistanceReset()
{
}
public void typeFighterAceMakerAdjDistancePlus()
{
k14IFFmode++;
if(k14IFFmode > 2)
k14IFFmode = 0;
HUD.log(AircraftHotKeys.hudLogWeaponId, "IFF " + k14IFFmodeStr[k14IFFmode]);
}
public void typeFighterAceMakerAdjDistanceMinus()
{
k14IFFmode--;
if(k14IFFmode < 0)
k14IFFmode = 2;
HUD.log(AircraftHotKeys.hudLogWeaponId, "IFF " + k14IFFmodeStr[k14IFFmode]);
}
public void typeFighterAceMakerAdjSideslipReset()
{
}
public void typeFighterAceMakerAdjSideslipPlus()
{
k14WingspanType--;
if(k14WingspanType < 0)
k14WingspanType = 0;
HUD.log(AircraftHotKeys.hudLogWeaponId, "AskaniaWing" + k14WingspanType);
}
public void typeFighterAceMakerAdjSideslipMinus()
{
k14WingspanType++;
if(k14WingspanType > 10)
k14WingspanType = 10;
HUD.log(AircraftHotKeys.hudLogWeaponId, "AskaniaWing" + k14WingspanType);
}
public void typeFighterAceMakerRangeFinder()
{
if(k14Auto == 0)
return;
if(k14IFFmode == 2)
{
if((trgt = Selector.look(true, false, Main3D.cur3D()._camera3D[Main3D.cur3D().getRenderIndx()], getArmy(), -1, this, false)) != null)
{
k14Mode = k14Auto;
k14Distance = (float)pos.getAbsPoint().distance(trgt.pos.getAbsPoint());
if(k14Distance > 800F)
k14Distance = 800F;
else
if(k14Distance < 100F)
k14Distance = 100F;
} else
{
k14Mode = 0;
}
} else
if((trgt = Selector.look(true, false, Main3D.cur3D()._camera3D[Main3D.cur3D().getRenderIndx()], -1, -1, this, false)) != null)
{
if(k14IFFmode == 1 && trgt.getArmy() == getOwner().getArmy())
{
k14Mode = 0;
} else
{
k14Mode = k14Auto;
k14Distance = (float)pos.getAbsPoint().distance(trgt.pos.getAbsPoint());
if(k14Distance > 800F)
k14Distance = 800F;
else
if(k14Distance < 100F)
k14Distance = 100F;
}
} else
{
k14Mode = k14Auto;
}
}
public void typeFighterAceMakerReplicateToNet(NetMsgGuaranted netmsgguaranted)
throws IOException
{
netmsgguaranted.writeByte(k14Mode);
netmsgguaranted.writeByte(k14WingspanType);
netmsgguaranted.writeFloat(k14Distance);
}
public void typeFighterAceMakerReplicateFromNet(NetMsgInput netmsginput)
throws IOException
{
k14Mode = netmsginput.readByte();
k14WingspanType = netmsginput.readByte();
k14Distance = netmsginput.readFloat();
}
public void setCurPilot(int i)
{
System.out.println("### Attempt to set Pilot Index on single crew plane!!! ###");
}
public int getCurPilot()
{
return 1;
}
public int getRadarGain()
{
return radarGain;
}
public int getRadarMode()
{
return radarMode;
}
static Class _mthclass$(String s)
{
try
{
return Class.forName(s);
}
catch(ClassNotFoundException classnotfoundexception)
{
throw new NoClassDefFoundError(classnotfoundexception.getMessage());
}
}
private int radarGain;
private int radarMode;
private long tX4Prev;
private float deltaAzimuth;
private float deltaTangage;
private boolean X4check;
private ArrayList missilesList;
private boolean homing;
private boolean X7;
private boolean IR;
public int k14Mode;
public int k14WingspanType;
public float k14Distance;
public int k14Auto;
public int k14IFFmode;
private static String k14IFFmodeStr[] = {
"NO check", "check FRIEND", "check FOE"
};
private static Actor trgt = null;
static
{
Class class1 = com.maddox.il2.objects.air.GO_229A3NJbeta.class;
new NetAircraft.SPAWN(class1);
Property.set(class1, "iconFar_shortClassName", "Go-229");
Property.set(class1, "meshName", "3do/Plane/Go-229A3NJbeta/hier.him");
Property.set(class1, "PaintScheme", new PaintSchemeFMPar05());
Property.set(class1, "yearService", 1946.5F);
Property.set(class1, "yearExpired", 1999F);
Property.set(class1, "FlightModel", "FlightModels/Ho-229A3NJ.fmd:Ho-229A3NJ_FM");
Property.set(class1, "cockpitClass", new Class[] {
com.maddox.il2.objects.air.CockpitGO_229A3NJ.class
});
Property.set(class1, "LOSElevation", 0.51305F);
// Property.set(class1, "IgnoreCodWeapon", 1);
Aircraft.weaponTriggersRegister(class1, new int[] {
0, 0, 1, 1, 9, 9, 9, 9, 2, 2,
2, 2, 2, 2, 2, 2, 9, 9, 9, 9,
2, 2, 2, 2
});
Aircraft.weaponHooksRegister(class1, new String[] {
"_CANNON01", "_CANNON02", "_CANNON03", "_CANNON04", "_ExternalDev01", "_ExternalDev02", "_ExternalDev03", "_ExternalDev04", "_ExternalRock01", "_ExternalRock01",
"_ExternalRock02", "_ExternalRock02", "_ExternalRock03", "_ExternalRock03", "_ExternalRock04", "_ExternalRock04", "_ExternalDev1", "_ExternalDev2", "_ExternalDev3", "_ExternalDev4",
"_ExternalRock05", "_ExternalRock05", "_ExternalRock06", "_ExternalRock06" });
try {
ArrayList arraylist = new ArrayList();
Property.set(class1, "weaponsList", arraylist);
HashMapInt hashmapint = new HashMapInt();
Property.set(class1, "weaponsMap", hashmapint);
byte byte0 = 24;
Aircraft._WeaponSlot a_lweaponslot[] = new Aircraft._WeaponSlot[byte0];
String s = "default";
a_lweaponslot = new Aircraft._WeaponSlot[byte0];
a_lweaponslot[0] = new Aircraft._WeaponSlot(0, "MGunMG213MGsi", 1000);
a_lweaponslot[1] = new Aircraft._WeaponSlot(0, "MGunMG213MGsi", 1000);
a_lweaponslot[2] = null;
a_lweaponslot[3] = null;
a_lweaponslot[4] = null;
a_lweaponslot[5] = null;
a_lweaponslot[6] = null;
a_lweaponslot[7] = null;
a_lweaponslot[8] = null;
a_lweaponslot[9] = null;
a_lweaponslot[10] = null;
a_lweaponslot[11] = null;
a_lweaponslot[12] = null;
a_lweaponslot[13] = null;
a_lweaponslot[14] = null;
a_lweaponslot[15] = null;
a_lweaponslot[16] = null;
a_lweaponslot[17] = null;
a_lweaponslot[18] = null;
a_lweaponslot[19] = null;
a_lweaponslot[20] = null;
a_lweaponslot[21] = null;
a_lweaponslot[22] = null;
a_lweaponslot[23] = null;
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "Empty";
a_lweaponslot = new Aircraft._WeaponSlot[byte0];
for (int i = 0; i < byte0; i++)
a_lweaponslot[i] = null;
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
} catch (Exception exception) {
}
}
}
Air.ini
Go-229A3NJbeta air.GO_229A3NJbeta 2 g01 SUMMER
The game will load correctly and I can select the aircraft in QMB, change between my two test loadouts and view the aircraft in the object viewer window.
However, when I try to load the game, the mission loader screen will freeze at 100%.
The log is extensive, but it seemed to suggest that the 3do model correctly.
I made sure that I copied all the 3do folders/files from the base Go-229A3NJbeta to my WAW folder.