Loading [MathJax]/extensions/Safe.js

Special Aircraft Service

Individual Mods and Packs for IL-2 1946 => Other Mods => ModWorx => Topic started by: WxTech on November 16, 2021, 10:34:03 PM

Title: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 16, 2021, 10:34:03 PM
UPDATE: Dec 29, 2022. Lowered the probability threshold for 18 planes whose gear was too easily damaged.

UPDATE: Nov 28, 2022. Fixed an oversight in P_40.class.

UPDATE: Nov 18, 2022. Fixed an oversight in SPITFIRE.class.

UPDATE: Nov 13, 2022. After receiving a report of odd behavior for the B-24, I went over all classes again and found some inconsistencies that warranted fixing. Almost all classes were worked on, with a more consistent approach being applied. Some of these problems derive from the old mod code I was working from. Hopefully there will now result better behavior.

UPDATE: Nov 21, 2021. Added 9 new plane classes, did some tweaking, and confirmed very nearly all working OK.



(https://i.imgur.com/xea07jd.jpg)

(https://i.imgur.com/LKLGqLa.jpg)


Get it here:

https://www.mediafire.com/file/zcc51axwr3o77dz/%2521%2521%2521_Gear_Damage_Mod_for_BAT.7z/file




From the included, updated readme file:

This is the Updated Gear Damage Mod adapted for BAT, Pacific planes edition, by WxTech.



This update: Dec 29, 2022
- Lowered the probability threshold for 18 plane classes whose gear was too easily damaged. (In some cases I had left the probability too high for testing purposes.)

Sixth update: Nov 28, 2022
- Fixed an oversight in P_40.class.

Fifth update: Nov 18, 2022.
- Fixed an oversight in SPITFIRE.class.

Fourth update: Nov 13, 2022.
- After receiving a report of odd behavior for the B-24, I went over all classes again and found some inconsistencies that warranted fixing. Almost all classes were worked on, with a more consistent approach being applied. Some of these problems derive from the old mod code I was working from. Hopefully there will now result better behavior.

Third update: Nov 9, 2022.
- 39 classes (plus 2) included. (Add the P_43xyz.class for completeness, even though included in its own separate plane fix.)
- Went through all classes to identify and fix cases where planes with no gear damage might still take the damage imparted to the previous affected plane.

Second update: Feb 18, 2022.
- Decreased chance of P-39 gear dropping.

First update: Nov 20, 2021.
- 38 classes (plus 2) included.
- Discovered wrong names (old error from way back) for gear collision boxes in code for C_47 and P_39; fixed.
- Added the A_26, B26, C_47A, C_47B, F4U, FM_1, P_43xyz, P_51 and SeaFury
- Checked out as OK very nearly all classes.
- Moved the gear collision boxes in the C-47AB plane folder, to be a little more exposed.

First release: Nov 16, 2021.
- 29 classes (plus 2) included.


This is a continuation of the fairly old Gear Damage Mod (introduced in the 4.09 days, if not before), designed to cause damaged gear, after sufficient hits, to drop partially or fully. Planes which use hydraulics to activate the gear are addressed, although numrous non-hydro gear equipped planes were also given this capability, which I've retained here. The list below identifies those which do not or seemingly do not have hydro gear; if you wish to remove the gear damage mod for any plane, simple remove its classfile.

Until now, the latest installment of this mod was for 4.12. It is not appropriate in B.A.T. for numerous planes because of the additional code added in many B.A.T. classes; functionality would be lost. Hence the need to completely re-visit this mod by building upon the B.A.T. classes specifically. My basis is B.A.T. 4.0. If there are differences in code for any later B.A.T. versions, let me know.

There are already some small number of planes in B.A.T. (4.0 and later, at least) which have incorporated this gear damage effect. For some, changes were warranted and so are now included here here.

Note that a class deals with all of the child classes for which it is the parent. For instance, class A6M applies for all models of the Zero (unless some other new slot mod class exists for mod variations). And so a lot of individual plane models are encompassed in this collection.

I have got round to checking out in the game just about all of these planes. I'd appreciate any reports on any 'anomalies' or failures. Or if it seems the effect is too rare or too common; this can be changed.


Here are the 38 (plus 2) plane classes provided in this mod, and which planes saw service in the Pacific theatre. I'm puzzled over the FM_1, as I can't determine which plane this applies to; I include it just in case... The two additions are the Spitfire and Bf-109, just because I happened to have worked on them.

(There remain scores of classes to be worked on for the many other planes, used in other theatres, not present here. I can't say if and when I will get around to tackling them in any focused way.)



* Seemingly not having hydraulically activated gear, based on B.A.T. 4.0 classes.
U Updated Java Nov 9, 2022, and successfully compiled.

A_20      350448AA0086D546 U
A_20XYZ      2907133A41085778 U
A_26      8BCA9BAE16EDDBBC U
A6M*      3153DABEBF24F2CA * U
B_17      067BE2DAD30D22D8 U
B_24      2E1ADF6EDF8A6C64 U
B_24D140CO   18D6AB82E49381EA U
B_25      BCD3A0D66ECCE7D4 U
B_29X      77B1B3A6E89CFC22 U
B26      381C0A8A41BECE1E U
BEAU*      2ED058C43BFC2C6C * U
C_47*      81793A002536EB40 * U
C_47A*      1890996E1AF4969A * U
C_47B*      0D68CF54301C7F1C * U
F2A*      BD1B2F5651EFA354 * U
F4U      12FD1410F9A95894 U (later toughening of fuel tank)
F4U_AR      0018FCF2F0608B38 U
F6F*      42AA9250FDDB73F0 * U
FM_1x      8118045016708032 U (not sure about this one; has manually cranked gear like Wildcat?)
G4M*      738B744EC10C5F40 * U
Hurricane*   E59248A20A60686C * U
J2M*      ADAA854CA64F3C52 * U
KI_100*      58315652EA3DBD2E * U
KI_43*      ABAA3036D3255152 * U
KI_46*      B1944DE676731296 * U
KI_61*      E237C9FEA2B9E868 * U
KI_84*      7BA5D07AE32E0690 * U
L2D*      51560CD02C83797E * U
N1K*      881D9F0C609D9ADE * U
P_36*      D0D3CEAC4DF9058A * U
P_38*      6AF90D0E6D025CD0 * U
P_39*      4608C16002CF9F8C * U
P_40*      183F83964B80AA1E * U
P_43xyz      81A5FB8435C699C4 U
P_47*      774325F298964D64 * U
P51      0550D61C9A6EC6A8 U
SeaFury      61C720B4D953600A
SBD*      95BCC252B73DD4A6 * U
TBF      4776A788FDC05430 U

   
BF_109*      F296DD26E1147102 * U
SPITFIRE*   00B509F2DD168B52 * U



As always, this work is made available for use by any and all, for any purpose, without restriction.


WxTech
Nov 16, 2021
November 20, 2021
Feb 18, 2022
Nov 9, 2022
Nov 13, 2022
Nov 18, 2022
Dec 29, 2022
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: SAS~Malone on November 16, 2021, 11:44:19 PM
Nice, thanks mate.
My first mod download since my return to the forum... :D
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Andy H on November 17, 2021, 12:40:47 AM
All those little touches adding up. Thanks yet again - much appreciated.   :)
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 17, 2021, 01:51:10 AM
Nice, thanks mate.
My first mod download since my return to the forum... :D

Eugene,
If I might be so bold, your second d/l should be my effects pack (found in the Effects sub-forum, naturally).  :D

Glenn
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Knochenlutscher on November 17, 2021, 02:24:00 AM
That's it exactly, well done here

good description, what I tested so far is running flawless.
no conflicts, didn't tested all,

Thanks a lot
Best wishes
Tobias




Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: SAS~Malone on November 17, 2021, 12:45:32 PM

Eugene,
If I might be so bold, your second d/l should be my effects pack (found in the Effects sub-forum, naturally).  :D


done  ;D
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 18, 2021, 12:31:39 AM
I got the F2A and G4M to work. An update of the full archive will be in the offing soon. I'll advise here when it's ready to grab...
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 21, 2021, 09:12:13 PM
I just made available an update, download link is the same, top page updated (including readme file contents).
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Atoka220 on November 07, 2022, 12:14:07 PM
Hey Glenn

Found a funny but bit infuriating bug
I started a B-24D campaign and when landing i was surprised why my gear wasn't down while the game confirmed it was
Checking out in qmb, i found that the wheels just rotate 90 degrees and clip through the wing

(https://i.postimg.cc/5Njw1CX0/image.png)

When near ground, the wheels just snap back to their retracted position while doors are open

Spawned in QMB on a crimea scramble mission
(https://i.postimg.cc/bvqry7mT/image.png)

Same with gear damage mod disabled
(https://i.postimg.cc/QtwWd69d/image.png)
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 07, 2022, 12:30:35 PM
Drat! Something to investigate, if I can make the time...


In the meantime, the Readme file indicates the classfile name for each plane. For any plane acting strangely, simply rename the classfile with a preceding "-" character, then restart the game.

Here's one good reason to supply the classfile names for all classes included in a mod.  ;)
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 09, 2022, 09:45:03 AM
I think I've found the issue that will be present in some planes.

Yesterday I was battling a gaggle of P-43s, where some suffered gear damage. The survivors, having no damage at all, when landing all partially dropped their gear to the same positions. I presume this represents the setting for the last plane to have been assigned gear damage, with all subsequent planes now being assigned the identical angles for their gear to descend to when lowered.

In the early days of using this mod (7-8 years ago?), I would sometimes find that if a certain type of flying plane suffered gear damage, even after starting a new mission that plane type when sitting on the ground would have its gear collapsed and be resting on its belly! I could have been led astray by using that deficient code (I've been playing with Java for just about 3 years now.)

I did a bit more code tweaking, augmented by my sloooowly accumulating Java pseudo knowledge.  ;)  I should mention that in previous gear damage mods--from which I have worked--there have been slightly differing approaches, with some odd oversights as best I can tell. Anywho, after my changes the P-43s gratifyingly all now behave properly on the gear damage front.

I'm currently going over all classes in this mod, so stay tuned for an update...
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Mick on November 09, 2022, 10:38:35 AM
... I have that bug, even in the next mission, in my 4.09 game version too ...  :-X
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 13, 2022, 03:35:34 PM
OK, I went back to the drawing board and re-worked most of the classes. I found what I see as some inconsistencies, some resulting from the original code I was working from present in the old mod. The full, updated mod can be downloaded from the same link in the top post.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Epervier on November 15, 2022, 01:18:27 PM
I'm puzzled over the FM_1, as I can't determine which plane this applies to; I include it just in case...
The online translator may have mistranslated your sentence...
So if I'm off topic, I apologise!
The FM-1 (Mod) and FM-2 (stock 409/UP2.01) are F4Fs built by General Motors.
Or see here : https://www.sas1946.com/main/index.php/topic,39097.msg435525.html
Note: FM-1 and FM-2 are included in BAT (***US_Navy) !
FM-1          air.F4F_FM1_GM         1 NOINFO   usa01   DESERT
FM-2          air.F4F_FM2            1          usa01   DESERT


FM-1
A version of the F4F-4, with only 4 machine guns and under-wing mounting points for various loads (2 x 110kg bombs or 6 rockets). 839 FM-1s were delivered to the US Navy and US Marine. 1490 were built in total.


FM-2
It featured a 1350 hp Wright R-1820-56 engine and an enlarged vertical stabilizer. It first flew on 8 November 1942. 4437 FM-2s were built by General Motors and Eastern Aircraft, well after 1943.


Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Epervier on November 17, 2022, 04:15:19 AM
In the Java code "SPITFIRE", I see :

    public static void moveGear(HierMesh hiermesh, float f) {
        hiermesh.chunkSetAngles("GearL2_D0", 0.0F, Aircraft.cvt(f * kl, 0.0F, 0.6F, 0.0F, -95F), 0.0F);
        hiermesh.chunkSetAngles("GearR2_D0", 0.0F, Aircraft.cvt(f * kr, 0.2F, 1.0F, 0.0F, -95F), 0.0F);
    }

    protected void moveGear(float f, float f1, float f2) {
        moveGear(hierMesh(), f);
//        if(FM.Gears.isHydroOperable())
        if(FM.CT.getGear() >= 0.997F) {
            kl = 1.0F;
            kr = 1.0F;
            kc = 1.0F;
        }
    }


I think it would make more sense to have :

    protected void moveGear(float f) {
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: JCC on November 17, 2022, 09:53:26 AM
Thanks for update Glenn

I think that there might be a bug though as my plane the F4F-4 had hydraulic landing gear. If my memory serves me well, it had landing gear handcrank. I did remap the letters F and G for for that, but it still did not work. I also tried the F4F-3 and it also had hydraulic landing gear.

It was however quite some time since I used those planes so I might be wrong about that, but if not, could you please see if that can be solved.

Cheers JC
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 18, 2022, 05:53:43 PM
UPDATE: Nov 18, 2022. Fixed an oversight in SPITFIRE.class.

Thanks to Gabriel for pointing out my oversight in SPITFIRE.class; now fixed.

My 'confusion' over the FM-1 was related to my understanding that it has the manually cranked gear, like the Wildcat generally. The BAT 4.0 class included most of the gear damage code, and I added the rest of the required elements. But it might be best to remove that class if dropping gear due to damage is not to your liking.  ;)
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Epervier on November 19, 2022, 03:40:14 AM
Thanks !

But, I am still confused about the P_40 code!
I don't see a multiplier (kc/kl/kr) in the "MoveGear"!  ;)

    public static void moveGear(HierMesh hiermesh, float f) {
        float f1 = Math.max(-f * 1100F, -90F);
        hiermesh.chunkSetAngles("GearC3_D0", 0.0F, f1, 0.0F);
        hiermesh.chunkSetAngles("GearC4_D0", 0.0F, f1, 0.0F);
        hiermesh.chunkSetAngles("GearC2_D0", 0.0F, 90F * f, 0.0F);
        hiermesh.chunkSetAngles("GearL2_D0", 0.0F, 92F * f, 0.0F);
        hiermesh.chunkSetAngles("GearL3_D0", 0.0F, -45F * f, 0.0F);
        hiermesh.chunkSetAngles("GearL4_D0", 0.0F, f1, 0.0F);
        hiermesh.chunkSetAngles("GearL5_D0", 0.0F, -99F * f, 0.0F);
        hiermesh.chunkSetAngles("GearR2_D0", 0.0F, 92F * f, 0.0F);
        hiermesh.chunkSetAngles("GearR3_D0", 0.0F, -45F * f, 0.0F);
        hiermesh.chunkSetAngles("GearR4_D0", 0.0F, f1, 0.0F);
        hiermesh.chunkSetAngles("GearR5_D0", 0.0F, -99F * f, 0.0F);
    }
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on November 27, 2022, 10:53:43 PM
Update, Nov 28, 2022: Back on Nov 20th I fixed(?) the P-40 code, as pointed out by Gabriel in the previous post, even though the gear damage seemed to have been working already. My change has caused no problem, and I've updated the archive just now...
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on December 29, 2022, 07:37:48 PM
Update, Dec 29, 2022. I've lowered the probability threshold for 18 planes whose gear was too easily damaged.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: GeraltNotRivia on March 07, 2025, 04:46:57 AM
Is there easy way to edit HUD messages this mod introduces? I want to edit them to my own localization, but can't find where they are stored?
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Epervier on March 07, 2025, 05:57:49 AM
Is there easy way to edit HUD messages this mod introduces? I want to edit them to my own localization, but can't find where they are stored?
Phrases (sentences) are written in Java code.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Frankiek on March 07, 2025, 06:16:50 AM
If you would like just to modify or translate the existing HUD messages you need to look into the STD/18n folder where you will find a number of properties file that are used to display the hard coded messages. The properties file can be edited by any basic text editor such as Notepad.
As mentioned by Epervier the content is hardcoded and in the properties files you can just modify the way the text will appear on screen.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: GeraltNotRivia on March 07, 2025, 07:09:33 AM
If you would like just to modify or translate the existing HUD messages you need to look into the STD/18n folder where you will find a number of properties file that are used to display the hard coded messages. The properties file can be edited by any basic text editor such as Notepad.
As mentioned by Epervier the content is hardcoded and in the properties files you can just modify the way the text will appear on screen.

Already done that, but this mod introduces it's own texts, which seems to be just hidden inside of java code or at least i can't find them anywhere.
No big problem of course, just asking.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: WxTech on March 07, 2025, 08:27:04 AM
In this matter of HUD messages I can mention this...

A while back I noted that among the fuel tank damage states the first two are simple leaks (the next two involve smoke and the last two involve smoke/fire.) Those two fuel leak states have differing rates of fuel loss (and the subsequent 4 damage states incur ever increasing rates of fuel loss/consumption in fire.) But the one and same fuel leak effect is used for both states. I therefore created an additional fuel leak effect, for flight and when on the ground, to visually differentiate netween the fuel quantity pouring out. And I created an additional HUD message which differentiates between the light and heavier leak.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Epervier on March 07, 2025, 09:14:49 AM
With NotePad from/for Windows you can view the text contained in Java code (hash files - files with very strange names).
In the middle of the cabalistic symbols in these files you'll find the “normal” texts.
Look for the “gear” text.
If you have a hexadecimal editor (e.g. HEdit) and respect the string length, you can modify the text.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: GeraltNotRivia on March 07, 2025, 09:24:00 AM
With NotePad from/for Windows you can view the text contained in Java code (hash files - files with very strange names).
In the middle of the cabalistic symbols in these files you'll find the “normal” texts.
Look for the “gear” text.
If you have a hexadecimal editor (e.g. HEdit) and respect the string length, you can modify the text.

Thanks! Nice to know!

If I found what lines java codes in this mod uses to show messages to screen, can I add them to hud_log.properties and change their language?
Like example:

Code: [Select]
FailedHydro                     Hydraulics: Leak
??FailedGear??                  Left Gear:  Hydraulic system Failed
??FailedGear2??                 Right Gear:  Hydraulic system Failed

Or is it just written to code as it is and it's impossible to change without your method?
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: Epervier on March 07, 2025, 09:45:44 AM
From memory... no.
Because in the code you see a coded sentence, not a variable or constant.
Title: Re: Gear Damage Mod For B.A.T., Pacific planes collection
Post by: GeraltNotRivia on March 07, 2025, 09:52:54 AM
Right!

Time to edit with HexEdit then.

Edit: Done! 8)