Special Aircraft Service

Please login or register.

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

Author Topic: Problems installing a new FM model  (Read 965 times)

0 Members and 1 Guest are viewing this topic.

redbaron96

  • member
  • Offline Offline
  • Posts: 298
Problems installing a new FM model
« on: May 19, 2022, 06:13:03 AM »

I am trying to set up a new flight model in a cloned version of the 109L4C3 called the '109L5C3'. This is so that I can use the new aircraft as a base to learn about how different flight modifications would work, perhaps eventually creating a new aircraft.

109L5C3 class file
Code: [Select]
package com.maddox.il2.objects.air;

import com.maddox.rts.Property;

// Referenced classes of package com.maddox.il2.objects.air:
//            BF_109LXX4, PaintSchemeFMPar06, NetAircraft, Aircraft

public class BF_109L5C3 extends BF_109LXX4
{

    public BF_109L5C3()
    {
    }

    static Class _mthclass$(String s)
    {
        try
        {
            return Class.forName(s);
        }
        catch(ClassNotFoundException classnotfoundexception)
        {
            throw new NoClassDefFoundError(classnotfoundexception.getMessage());
        }
    }

    static
    {
        Class class1 = com.maddox.il2.objects.air.BF_109L5C3.class;
        new NetAircraft.SPAWN(class1);
        Property.set(class1, "iconFar_shortClassName", "Bf109");
        Property.set(class1, "meshName", "3do/plane/Bf-109L/hier.him");
        Property.set(class1, "PaintScheme", new PaintSchemeFMPar06());
        Property.set(class1, "yearService", 1945.9F);
        Property.set(class1, "yearExpired", 1955F);
        Property.set(class1, "FlightModel", "FlightModels/BF109L5C3_FM.fmd:BF109L5C3_FM");
        Property.set(class1, "cockpitClass", new Class[] {
            com.maddox.il2.objects.air.CockpitBF_109LEZ42.class
        });
        Property.set(class1, "LOSElevation", 0.7498F);
        Property.set(class1, "IgnoreCodWeapon", 1);
        Aircraft.weaponTriggersRegister(class1, new int[] {
            0, 0, 1, 1, 1, 1, 1, 9, 9, 9,
            9, 3, 2, 0, 0
        });
        Aircraft.weaponHooksRegister(class1, new String[] {
            "_MGUN01", "_MGUN02", "_CANNON01", "_CANNON02", "_CANNON03", "_CANNON04", "_CANNON05", "_ExternalDev01", "_ExternalDev01", "_ExternalDev02",
            "_ExternalDev03", "_ExternalBomb01", "_ExternalBomb01", "_CANNON02", "_CANNON03"
        });
    }
}

However, I have had a 60% crash to desktop error, with this log.
Code: [Select]
[2022-05-19 11:54:29.228 UTC +1] dT:    0 Error loading FM called 'flightmodels/bf109l5c3_fm.fmd'!
[2022-05-19 11:54:29.228 UTC +1] dT:    0 It Cannot be Loaded from 'bf109l5c3_fm' File
[2022-05-19 11:54:29.228 UTC +1] dT:    0 *** This was the Reason of your 6011226131060r 70TD ***
[2022-05-19 11:54:29.229 UTC +1] dT:    0 FM Loading General Exception!
[2022-05-19 11:54:29.229 UTC +1] dT:    0 Warning, the "FlightModels/BF109L5C3_FM.fmd:BF109L5C3_FM" cannot be loaded from "bf109l5c3_fm" File
[2022-05-19 11:54:29.229 UTC +1] dT:    0 null
[2022-05-19 11:54:29.229 UTC +1] dT:    0 java.lang.NullPointerException
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.ai.AirportCarrier.clsBigArrestorPlane(AirportCarrier.java:548)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.ai.AirportCarrier.isPlaneContainsArrestor(AirportCarrier.java:518)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.gui.GUIQuick.fillArrayPlanes(GUIQuick.java:2577)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.gui.GUIQuick.<init>(GUIQuick.java:3679)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.gui.GUI.create(GUI.java:199)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.game.Main3D.beginApp(Main3D.java:1779)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.game.Main3D.beginApp(Main3D.java:1475)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.game.MainWin3D.beginApp(MainWin3D.java:212)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.game.Main.exec(Main.java:405)
[2022-05-19 11:54:29.230 UTC +1] dT:    0 at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)
[2022-05-19 11:54:29.668 UTC +1] dT:    0 Error loading FM called 'flightmodels/bf109l5c3_fm.fmd'!
[2022-05-19 11:54:29.668 UTC +1] dT:    0 It Cannot be Loaded from 'bf109l5c3_fm' File
[2022-05-19 11:54:29.668 UTC +1] dT:    0 *** This was the Reason of your 6011226131060r 70TD ***
[2022-05-19 11:54:29.669 UTC +1] dT:    0 Main begin: null
[2022-05-19 11:54:29.669 UTC +1] dT:    0 java.lang.NullPointerException
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.gui.GUIQuick$ItemAir.<init>(GUIQuick.java:978)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.gui.GUIQuick.fillArrayPlanes(GUIQuick.java:2571)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.gui.GUIQuick.<init>(GUIQuick.java:3679)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.gui.GUI.create(GUI.java:199)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.game.Main3D.beginApp(Main3D.java:1779)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.game.Main3D.beginApp(Main3D.java:1475)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.game.MainWin3D.beginApp(MainWin3D.java:212)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.game.Main.exec(Main.java:405)
[2022-05-19 11:54:29.669 UTC +1] dT:    0 at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)

[May 19, 2022 11:54:29 AM UTC +1] -------------- END log session -------------

I understand that this means that the game cannot find the 'FM' file (which I coded with the NTRK 0.5. editor, then renamed from 'buttons' to 'BF109L5C3_FM') however I had added this file to my WAW modfolder.



I also had the same error when I tried placing the file in the WAW3/Classes-FMs folder.
Is this due to an error with the text of the actual FM file (text below) or is it how it is referenced in the aircraft class file?
Could it be related to how the class file as a 'daughter class' (L5) references the other files that are already part of the BAT install (the orgininal L-series files)?
Code: [Select]
[Aircraft]
  Type 1
  Crew 1
  Wingspan 9.918
  Length 9.01
  Seaplane 0
  Canard 0
  Jet 0
  JetHiV 0
[Mass]
  Empty 2580.0
  TakeOff 3400.0
  Oil 50.0
  Fuel 330.0
  Nitro 90.0
[Controls]
  CAileron 1
  CAileronTrim 1
  CElevator 1
  CElevatorTrim 1
  CRudder 1
  CRudderTrim 1
  CFlap 1
  CFlapPos 3
  CDiveBrake 0
  CInterceptor 0
  CEngine 1
  CVectoredThrust 0
  CUndercarriage 1
  CLockTailwheel 1
  CStabilizer 0
  CArrestorHook 0
  CWingFold 0
  CCockpitDoor 1
  CockpitDoorPeriod 2.0
  CAileronThreshold 700.0
  CRudderThreshold 600.0
  CElevatorThreshold 550.0
  DefaultAileronTrim 0.011
  DefaultElevatorTrim -0.05
  DefaultRudderTrim 0.065
[Squares]
  Wing 16.5
  Aileron 1.12
  Flap 2.00
  Stabilizer 1.90
  Elevator 1.20
  Keel 1.00
  Rudder 1.10
  Wing_In 3.00
  Wing_Mid 2.50
  Wing_Out 2.605
  AirbrakeCxS 0.00
[Arm]
  Aileron 4.03
  Flap 2.04
  Stabilizer 5.15
  Keel 5.18
  Elevator 5.35
  Rudder 5.45
  Wing_In 1.25
  Wing_Mid 2.50
  Wing_Out 4.10
  Wing_V 1.5
  GCenter 0.05
  GCenterZ 0.00
  GC_AOA_Shift 0.45
  GC_Flaps_Shift 0.20
  GC_Gear_Shift -0.45
[Toughness]
  AroneL 200
  AroneR 200
  CF 500
  Engine1 250
  Engine2 250
  Engine3 250
  Engine4 250
  GearL2 350
  GearR2 350
  Keel1 150
  Keel2 150
  Nose 300
  Oil 300
  Rudder1 200
  Rudder2 200
  StabL 200
  StabR 200
  Tail1 200
  Tail2 200
  Turret1 120
  Turret2 120
  Turret3 120
  Turret4 120
  Turret5 120
  Turret6 120
  VatorL 180
  VatorR 180
  WingLIn 200
  WingLMid 200
  WingLOut 200
  WingRIn 200
  WingRMid 200
  WingROut 200
  Flap01 200
  Flap02 200
  Flap03 200
  Flap04 200
[Engine]
  Engine0Family DB606:BF109L_FM
  Engine0SubModel DB606C3
[Gear]
  H 1.663372
  Pitch 12.850
  SinkFactor 800.0
  SpringsStiffness 0.3
  TailStiffness 0.3
[Params]
  CriticalAOA 35.00
  CriticalCy 01.82
  CxCurvature 00.80
  CxStraightness 00.00
  CriticalAOAFlap 35.00
  CriticalCyFlap 02.10
  SpinTailAlpha 17.00
  SpinCxLoss 0.06
  SpinCyLoss 0.03
  Vmin 160.0
  Vmax 650.0
  VmaxAllowed 930.0
  VmaxH 735.0
  HofVmax 8900.0
  VminFLAPS 137.0
  VmaxFLAPS 260.0
  Vz_climb 24.0
  V_climb 380.0
  T_turn 18.0
  V_turn 330.0
  K_max 16.0
  Cyo_max 0.25
  FlapsMult 1.0
  FlapsAngSh 3.0
  VmaxH1 733.0
  HofVmax1 9800.0
  VmaxH2 728.0
  HofVmax2 11500.0
  G_class_coeff 20.0
  G_class 12
  Range 560.0
  CruiseSpeed 550.0
  SensYaw 0.47
  SensPitch 0.68
  SensRoll 0.36
[Polares]
  lineCyCoeff 0.092
  AOAMinCx_Shift 0.8
  Cy0_0 0.14999999
  AOACritH_0 21.0
  AOACritL_0 -16.0
  CyCritH_0 1.48
  CyCritL_0 -1.0230048
  CxMin_0 0.01
  parabCxCoeff_0 7.0E-4
  Cy0_1 0.63184977
  AOACritH_1 17.0
  AOACritL_1 -19.0
  CyCritH_1 1.72
  CyCritL_1 -0.7
  CxMin_1 0.11768502
  parabCxCoeff_1 8.6E-4
  Decline 0.006
  parabAngle 6.0
  Decline 0.008
  maxDistAng 38.0
  draw_graphs 0
[SOUND]
  Engine bf_109
  Start e_start
  Turbine bf_turbo
  FeedType HYDRAULIC
Logged

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9441
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here
Re: Problems installing a new FM model
« Reply #1 on: May 19, 2022, 09:46:05 AM »

-1-
I don't know how BAT really works... I therefore give you no guarantees! But I find this "WAW" file very suspicious!
In the BAT that I use to make rare tests, there are not all these files in the "#WAW3\STD" folder !
There are just subfolders, com...font...gui...i18n...icons...
The day I added something to this pack I created in the "#WAW" folder a sub-folder "06__blablabla".
In which I placed the hash files and the 3do folder... like you would do in any other pack...

-2-
In your code you call the following FM:
"FlightModels/BF109L5C3_FM.fmd:BF109L5C3_FM"
Ok !
But at the end in the FMD you have the line:
[Engine]
  Engine0Family DB606:BF109L_FM

That's not right... in my opinion!
It's very messy!
You should post your external FM as I'm afraid it's badly coded!
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -

redbaron96

  • member
  • Offline Offline
  • Posts: 298
Re: Problems installing a new FM model
« Reply #2 on: May 19, 2022, 10:35:29 AM »

Question 1: The other files in the WAW folder are related to other mods that I have already installed in my game and use as part of my BAT install.

Question 2: The reason that I have
Code: [Select]
[Engine]
  Engine0Family DB606:BF109L_FM

Is because when I went to clone the 'BF109L4C3', to allow me to create a version where I could experiment with the flight model, I wanted to keep the engine/'EMD' file the same and just create a separate flight model/FMD folder.

I adapted the 'For Modders' folder that came with the Bf-109L (https://www.sas1946.com/main/index.php/topic,61422.0.html) download, using an older version of the Bf-109L4C3 FM that was apparently slightly faster (from the earlier 'v02052020' pack) and then increased the armour values as well.

I would have hoped that the existing EMD file in my game for the BAT BF-109Ls could simply been referenced by new aircraft class file, without creating a new EMD file as well as a new FMD file.

In relation to the 'external FM', what is that since the text that I posted is the entire content of the 'decompiled' FM before I ran it through the NTRK editor/what shows when I open the fmd files in the for modders folder.


Logged

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9441
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here
Re: Problems installing a new FM model
« Reply #3 on: May 19, 2022, 11:26:58 AM »

The flight model (FMD) is contained in the buttons or in an external FM (example BF109L5C3_FM).
The EMD is called by the FMD and is contained in the buttons or in an external FM (the same as the one the FMD calls it) !

I can't help you with BAT.
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -

FL2070

  • Modder
  • member
  • Offline Offline
  • Posts: 1130
  • FAC #87
Re: Problems installing a new FM model
« Reply #4 on: May 19, 2022, 06:09:19 PM »

I think this is your problem. You have
Code: [Select]
Property.set(class1, "FlightModel", "FlightModels/BF109L5C3_FM.fmd:BF109L5C3_FM");
Notice you called for an FMD file called "BF109L5C3_FM.fmd".

But, your FMD file is called "BF109L5C3.fmd", with no "_FM" in its name.

So, your game cannot find the FMD file "BF109L5C3_FM.fmd". Try instead:
Code: [Select]
Property.set(class1, "FlightModel", "FlightModels/BF109L5C3.fmd:BF109L5C3_FM");
Logged
On average, the average average averages, averagely, the average average of all averages.

redbaron96

  • member
  • Offline Offline
  • Posts: 298
Re: Problems installing a new FM model
« Reply #5 on: May 20, 2022, 05:56:32 AM »

I tried to make the edits that you suggested, however, I did not have any luck in relation when I first renamed the file in the class file as you suggested, instead I had the same error as before, with the log showing that the flight model could not be located.

I also tried re-compiling the .fmd file in ntrak, by calling it 'BF109L5C3_FM.fmd'. instead, with the 60% CTD error.

I noticed that the code: Property.set(class1, "FlightModel", "FlightModels/BF109L5C3_FM.fmd:BF109L5C3_FM");
read "FlightModels/BF109L5C3_FM.fmd:BF109L5C3_FM".

I then created a folder called 'FlightModels' inside the WAW/STD folder and put the FM files inside it.


When I did this, I found that the game loaded without a CTD, but that when I went to FMB, the L5 showed with a grey screen instead of the image of the plane and no option to select anything in the 'weapons' section.

Is that simply because I did not have a 'weapons' section coded in the java file?
Or does placing the FM files in the 'FlightModels' folder mean that the aircraft is simply ignored by the game completely, even though I left the class file for the aircraft inside the STD folder?
Logged

redbaron96

  • member
  • Offline Offline
  • Posts: 298
Re: Problems installing a new FM model
« Reply #6 on: May 20, 2022, 09:49:36 AM »



Logged

FL2070

  • Modder
  • member
  • Offline Offline
  • Posts: 1130
  • FAC #87
Re: Problems installing a new FM model
« Reply #7 on: May 21, 2022, 02:54:59 AM »

No, the FlightModels/ folder is correct. All buttons and DiffFM folder structures are that way. If the game couldn't load the flight model because it was in the FlightModels/ folder, then it would just CTD at 60%.

There are no weapon loadouts, probably, because you have not made any, and if I remember correctly, BF109Ls use COD-encoding for their weapon loadouts, so there will be no weapon loadouts coded in the Java classfile that will copy over to the new plane. See PMs for more details on this issue.
Logged
On average, the average average averages, averagely, the average average of all averages.

redbaron96

  • member
  • Offline Offline
  • Posts: 298
Re: Problems installing a new FM model
« Reply #8 on: May 22, 2022, 11:48:35 AM »

I have been able to get the BF109L5C3 to load as an object QMB and FMB, with the aircraft displaying an image (no more grey square) as well as displaying the weapon loadouts that were added/with the options for selecting country/squadron e.t.c.
The skin folder also links correctly to the aircraft.

However, when I try to actually fly the aircraft, I get a 'null' error and this error code. If I set the AI to fly the aircraft, with myself in a different aircraft, then the mission will load, but the AI L5 flight will simply not appear.
Code: [Select]
[2022-05-22 18:31:43.397 UTC +1] dT:    0 Mission error, ID_04: java.lang.RuntimeException: Error loading params from FlightModels/BF109L5C3.fmd:BF109L5C3_FM
[2022-05-22 18:31:43.397 UTC +1] dT:    0 java.lang.RuntimeException: Error loading params from FlightModels/BF109L5C3.fmd:BF109L5C3_FM
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.fm.FlightModelMain.load(FlightModelMain.java:335)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.fm.FlightModelMain.<init>(FlightModelMain.java:1225)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.fm.FlightModel.<init>(FlightModel.java:137)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.fm.AIFlightModel.<init>(AIFlightModel.java:20)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.ai.air.Maneuver.<init>(Maneuver.java:618)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.ai.air.Pilot.<init>(Pilot.java:107)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.fm.RealFlightModel.<init>(RealFlightModel.java:89)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.objects.air.Aircraft.setFM(Aircraft.java:1689)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.objects.air.Aircraft.setFM(Aircraft.java:1677)
[2022-05-22 18:31:43.397 UTC +1] dT:    0 at com.maddox.il2.objects.air.Aircraft.load(Aircraft.java:2079)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.Mission.loadAir(Mission.java:1324)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.ai.Wing.load(Wing.java:143)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.Mission.loadWings(Mission.java:1095)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.Mission._load(Mission.java:667)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.Mission.access$600(Mission.java:124)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.Mission$BackgroundLoader.run(Mission.java:412)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.rts.BackgroundTask.doRun(BackgroundTask.java:155)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.MainWin3D.loopApp(MainWin3D.java:108)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.Main.exec(Main.java:422)
[2022-05-22 18:31:43.398 UTC +1] dT:    0 at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)
[2022-05-22 18:31:43.789 UTC +1] dT:    0 null
[2022-05-22 18:31:43.789 UTC +1] dT:    0 java.lang.NullPointerException
[2022-05-22 18:31:43.789 UTC +1] dT:    0 at com.maddox.il2.game.order.OrdersTree.getSection(OrdersTree.java:627)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.order.OrdersTree.missionLoaded(OrdersTree.java:567)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.order.OrdersTree.missionLoaded(OrdersTree.java:531)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.Mission._load(Mission.java:776)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.Mission.access$600(Mission.java:124)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.Mission$BackgroundLoader.run(Mission.java:412)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.rts.BackgroundTask.doRun(BackgroundTask.java:155)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.MainWin3D.loopApp(MainWin3D.java:108)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.Main.exec(Main.java:422)
[2022-05-22 18:31:43.790 UTC +1] dT:    0 at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)

[May 22, 2022 6:31:48 PM UTC +1] -------------- END log session -------------

This suggests that it is linked to the new FM that I have tried to create for the plane (Error loading params from FlightModels/BF109L5C3.fmd:BF109L5C3_FM)
However, I also renamed the 'stock' FM for the 109L4 and tried to compile and load that for the L5, but I had the exact same error code.

Code: [Select]
2022-05-22 11:58:51.913 UTC +1] dT:    0 java.lang.RuntimeException: Error loading params from FlightModels/BF109L5C3.fmd:BF109L5C3_FM
[2022-05-22 11:58:51.913 UTC +1] dT:    0 at com.maddox.il2.fm.FlightModelMain.load(FlightModelMain.java:335)

  (FlightModelMain.java:335) j = sectfile.get(s2, "CDiveBrake", 0);
        if(j != 0 && j != 1)

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.fm.FlightModelMain.<init>(FlightModelMain.java:1225)

       (FlightModelMain.java:1225) if(flag && this.actor != World.getPlayerAircraft() && ((Aircraft)this.actor).FM.turret.length > 0)

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.fm.FlightModel.<init>(FlightModel.java:137)

(FlightModel.java:137)
            case 2: // '\002'
                SensRoll *= 0.88F;
                        SensPitch *= 0.92F;
                SensYaw *= 0.9F;
                break;

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.fm.AIFlightModel.<init>(AIFlightModel.java:20)

(AIFlightModel.java:20) ?????????

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.ai.air.Maneuver.<init>(Maneuver.java:618)

setSpeedMode(6);
            tmpOr.setYPR(Or.getYaw(), 0.0F, 0.0F);
            if(Or.getKren() > 0.0F)
        (Maneuver.java:618)          Ve.set(100D, -8D, 10D);
            else
                Ve.set(100D, 8D, 10D);
            tmpOr.transform(Ve);
            Or.transformInv(Ve);
            Ve.normalize();
            farTurnToDirection();
            if(Alt > 250F && mn_time > 8F || mn_time > 120F)

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.ai.air.Pilot.<init>(Pilot.java:107)

  if(Skill >= 2)
        {
            return true;
        } else
        {
          (Pilot.java:107)   vecDanger.set(((Aircraft)actor).FM.Loc);

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.fm.RealFlightModel.<init>(RealFlightModel.java:89)

            private void flutter()
        {
        if(Realism.Flutter_Effect)
            ((Aircraft)actor).msgCollision(actor, "CF_D0", "CF_D0");
    (RealFlightModel.java:89)     }

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.objects.air.Aircraft.setFM(Aircraft.java:1689)

(Aircraft.java:1689)
    public float getBayDoor()
    {
        return BayDoor_;
    }

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.objects.air.Aircraft.setFM(Aircraft.java:1677)

(Aircraft.java:1677)
    public void moveSteering(float f)
    {
    }

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.objects.air.Aircraft.load(Aircraft.java:2079)

 private void checkLoadingCountry()
    {
        _loadingCountry = null;
        if(loadingCountry == null)                       (Aircraft.java:2079)
            return;
        Class class1 = getClass();
        if(Property.value(class1, "PaintScheme_" + loadingCountry) != null && Property.stringValue(class1, "meshName_" + loadingCountry, null) != null)
            _loadingCountry = loadingCountry;
    }

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.Mission.loadAir(Mission.java:1324)

    private List loadWings(SectFile sectfile)
        throws Exception
    {
        int i = sectfile.sectionIndex("Wing");
        if(i < 0)
            return null;
        if(!World.cur().diffCur.Takeoff_N_Landing)
            prepareTakeoff(sectfile, !Main.cur().netServerParams.isSingle());
        NetChannel netchannel = null;
        if(!isServer())
            netchannel = net.masterChannel();
        int j = sectfile.vars(i);
        ArrayList arraylist = null;
        if(j > 0)
            arraylist = new ArrayList(j);
        for(int k = 0; k < j; k++)
        {
            LOADING_STEP(30 + Math.round(((float)k / (float)j) * 30F), "task.Load_aircraft");
            String s = sectfile.var(i, k);
            _loadPlayer = s.equals(player);
            int l = sectfile.get(s, "StartTime", 0);
            if(l > 0 && !_loadPlayer)
            {
                if(netchannel == null)
                {
                    double d = (long)l * 60L;
                    new MsgAction(0, d, new TimeOutWing(s)) {

                        public void doAction(Object obj)
                        {
                            TimeOutWing timeoutwing = (TimeOutWing)obj;
                            timeoutwing.start();
                        }

                    }
;
                }
            } else
            if(!World.cur().triggersGuard.listTriggerAvionAppar.contains(s))
            {
                NetAircraft.loadingCoopPlane = Main.cur().netServerParams != null && Main.cur().netServerParams.isCoop();
                Wing wing = new Wing();
                wing.load(sectfile, s, netchannel);
                if(netchannel != null && !Main.cur().netServerParams.isCoop())
                {
                    Aircraft aaircraft[] = wing.airc;
                    for(int i1 = 0; i1 < aaircraft.length; i1++)
                        if(Actor.isValid(aaircraft[i1]) && aaircraft[i1].net == null)
                        {
                            aaircraft[i1].destroy();
                            aaircraft[i1] = null;
                        }

                }
                arraylist.add(wing);
                prepareSkinInWing(sectfile, wing);
            }
        }

        LOADING_STEP(60F, "task.Load_aircraft");
        return arraylist; (Mission.java:1324)

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.ai.Wing.load(Wing.java:143)

        if(Actor.getByName(s) != null)
        {
            destroy(); (Wing.java:143)
            throw new Exception("Mission: dublicate wing '" + s + "'");
        }

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.Mission.loadWings(Mission.java:1095)

    public static void setDate(int i, int j, int k)
    {
        setYear(i);
        setMonth(j); (Mission.java:1095)
        setDay(k);
    }

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.Mission._load(Mission.java:667)

(Mission.java:667)
    private void _load(String s, SectFile sectfile, boolean flag)
        throws Exception
    {
        if(!sectfile.sectionExist("$$$record"))
            FMMath.initSeed();
        if(GUI.pad != null)
            GUI.pad.zutiPadObjects.clear();
        zutiResetMissionVariables();

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.Mission.access$600(Mission.java:124)

        {
            try
            {
                NetMsgGuaranted netmsgguaranted = new NetMsgGuaranted(1);
                netmsgguaranted.writeByte(i);
                NetMsgInput netmsginput = new NetMsgInput();
                netmsginput.setData(netchannel, true, netmsgguaranted.data(), 0, netmsgguaranted.size());
                MsgNet.postReal(Time.currentReal(), this, netmsginput);
                netmsgguaranted.close();
            }
            catch(Exception exception)
            {
                NetObj.printDebug(exception);
            } (Mission.java:124)
}

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.Mission$BackgroundLoader.run(Mission.java:124)

(Mission.java:124) ?????????????

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.rts.BackgroundTask.doRun(BackgroundTask.java:155)

   try
        {
            backgroundtask.run();
        } (BackgroundTask.java:155)

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.MainWin3D.loopApp(MainWin3D.java:108)

                    ((MainWin32)MainWindow.adapter()).loopMsgs();
                    ScreenMode screenmode = ScreenMode.readCurrent();
                    boolean flag = saveMode.width() != screenmode.width() || saveMode.height() != screenmode.height();
                    if(flag)
                        MainWindow.adapter().setMessagesEnable(true);
                    MainWindow.adapter().setPosSize(0, 0, screenmode.width(), screenmode.height());
                    ((MainWin32)MainWindow.adapter()).loopMsgs();
                    if(!flag)
                        MainWindow.adapter().setMessagesEnable(true);
                    RTSConf.cur.setUseMouse(saveMouseMode);
                    bChangedScreenMode = false;
                }
                RendersMain.setShow(true);
                RendersMain.bSwapBuffersResult = true; (MainWin3D.java:108)
                bTryChangedScreenMode = false;
            } else
            if(!RendersMai

[2022-05-22 11:58:51.914 UTC +1] dT:    0 at com.maddox.il2.game.Main.exec(Main.java:422)

        SectFile sectfile = new SectFile("com/maddox/il2/objects/air.ini", 0);
        int i = sectfile.sections();
        for(int j = 0; j < i; j++)
        {
            int k = sectfile.vars(j);
            for(int l = 0; l < k; l++)
            {
                String s = sectfile.value(j, l);
                StringTokenizer stringtokenizer = new StringTokenizer(s);
                if(!stringtokenizer.hasMoreTokens())
                    continue;
                String s1 = "com.maddox.il2.objects." + stringtokenizer.nextToken();
                Spawn.get(s1);
                try
                {
                    Class class1 = Class.forName(s1);
                    String s2 = sectfile.var(j, l).intern();
                    Property.set(class1, "keyName", s2);
                    Property.set(s2, "airClass", class1);
                    Aircraft.weapons(class1); (Main.java:422)
                    airClasses.add(class1);
                }
                catch(Exception exception) { }
            }
Logged

redbaron96

  • member
  • Offline Offline
  • Posts: 298
Re: Problems installing a new FM model
« Reply #9 on: May 22, 2022, 11:55:53 AM »

This is the Java code for the 109L5 that will load as an object/display in the FMB/QMB but not actually fly as a plane.
In case there was a problem with the wing mounted gunpods loading (which would not display at all in the QMB window, unlike on the 109L4) I did try creating a version with the gunpods taken out of the class file completely, but had the same error code.

Could this error be down to the FM file not being compiled properly?

Code: [Select]
package com.maddox.il2.objects.air;

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:
//            Scheme1, PaintSchemeBMPar03, TypeTransport, Aircraft,
//            NetAircraft

public class BF_109L5C3 extends BF_109LXX4 {

    public BF_109L5C3() {
    }
   
    static {
        Class class1 = com.maddox.il2.objects.air.BF_109L5C3.class;
        new NetAircraft.SPAWN(class1);
        Property.set(class1, "iconFar_shortClassName", "Bf109");
        Property.set(class1, "meshName", "3do/plane/Bf-109L/hier.him");
        Property.set(class1, "PaintScheme", new PaintSchemeFMPar06());
        Property.set(class1, "yearService", 1945.9F);
        Property.set(class1, "yearExpired", 1955F);
        Property.set(class1, "FlightModel", "FlightModels/BF109L5C3.fmd:BF109L5C3_FM");
        Property.set(class1, "cockpitClass", new Class[] {
            com.maddox.il2.objects.air.CockpitBF_109LEZ42.class });
        Property.set(class1, "LOSElevation", 0.7498F);
//        Property.set(class1, "IgnoreCodWeapon", 1);
        Aircraft.weaponTriggersRegister(class1, new int[] {
            0, 0, 1, 1, 1, 1, 1, 9, 9, 9,
            9, 3, 2, 0, 0 });
        Aircraft.weaponHooksRegister(class1, new String[] {
            "_MGUN01", "_MGUN02", "_CANNON01", "_CANNON02", "_CANNON03",
            "_CANNON04", "_CANNON05", "_ExternalDev01", "_ExternalDev01",
            "_ExternalDev02", "_ExternalDev03", "_ExternalBomb01",
            "_ExternalBomb01", "_CANNON02", "_CANNON03" });
try {
ArrayList arraylist = new ArrayList();
Property.set(class1, "weaponsList", arraylist);
HashMapInt hashmapint = new HashMapInt();
Property.set(class1, "weaponsMap", hashmapint);
        byte byte0 = 15;
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] = new Aircraft._WeaponSlot(1, "MGunMK213si", 500);
        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;

arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "2OMM_GUNPODS";
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] = new Aircraft._WeaponSlot(1, "MGunMK213si", 500);
        a_lweaponslot[3] = new Aircraft._WeaponSlot(1, "MGunMG213MGsih", 1000);
        a_lweaponslot[4] = new Aircraft._WeaponSlot(1, "MGunMG213MGsih", 1000);
        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;
       
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "3OMM_GUNPODS";
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] = new Aircraft._WeaponSlot(1, "MGunMK213si", 500);
        a_lweaponslot[3] = new Aircraft._WeaponSlot(1, "MGunMK213sh", 500);
        a_lweaponslot[4] = new Aircraft._WeaponSlot(1, "MGunMK213sh", 500);
        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;
       
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "MK214_Motorkanone";
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] = new Aircraft._WeaponSlot(1, "MGunMK214A", 100);
        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;
       
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "MK214_Motorkanone+MK214_gunpods";
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] = new Aircraft._WeaponSlot(1, "MGunMK214A", 100);
        a_lweaponslot[3] = new Aircraft._WeaponSlot(1, "MGunMK214Ah", 100);
        a_lweaponslot[4] = new Aircraft._WeaponSlot(1, "MGunMK214Ah", 100);
        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;
       
        arraylist.add(s);
        hashmapint.put(Finger.Int(s), a_lweaponslot);
        s = "none";
        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) {
}
    }
}
Logged

FL2070

  • Modder
  • member
  • Offline Offline
  • Posts: 1130
  • FAC #87
Re: Problems installing a new FM model
« Reply #10 on: May 23, 2022, 01:36:52 AM »

Wait a second! There's something I didn't see originally:



This is not correct. All _FM files (i.e. BF109L_FM) should go in the same folder as the hashed classfiles.

The FlightModels/ folder is a part of the internal structure of the _FM file, not a folder for the _FM file to go in.

CORRECT folder structure
Code: [Select]
#WAW3/
    Bf-109L-5C3/
        3do/
            (3d files, etc)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        BF_109L5C3_FM ... contents: {
            FlightModels/
                BF_109L5C3.fmd
                DB606L5.emd
        }

INCORRECT folder structure
Code: [Select]
#WAW3/
    Bf-109L-5C3/
        3do/
            (3d files, etc)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
        (hashed classfile)
    STD/
        FlightModels/
            BF_109L5C3_FM ... contents: {
                FlightModels/
                    BF_109L5C3.fmd
                    DB606L5.emd
            }

When in doubt, copy other things that already work.



Also, the raw FMD file should not be in your mods; only the compiled _FM file should be.
Logged
On average, the average average averages, averagely, the average average of all averages.
Pages: [1]   Go Up
 

Page created in 0.074 seconds with 24 queries.