Special Aircraft Service

Battlefield - Airborne - Tactical (BAT) => BAT Tech Help => Topic started by: redbaron96 on May 08, 2022, 10:06:34 AM

Title: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: redbaron96 on May 08, 2022, 10:06:34 AM
Apologies in advance if this is posted in the wrong part of the forum (I am happy for a moderator to move the post to a different part of the site if they think that is more appropriate) but I was unsure which part of the 'modding' section would be most appropriate for this enquiry.

I have been learning more about how the game works and as a experiment, I downloaded the Taiho and Taiho Kai files and edited the ".tga" 'alpha' file to show the Soviet Navy flag instead of the Japanese one.

(https://i.postimg.cc/rphDFYTf/Image-1.jpg) (https://postimg.cc/SXMSgdJ9)

(https://i.postimg.cc/gJQr3XnR/Image-2.jpg) (https://postimg.cc/Ppbtjqbr)

I have BAT. 4.2 but have not yet tested this experiment in game.
Can I ask two questions?
One, if I made this edit to the Taiho/Taiho Kai in my game, would the carrier then display the Soviet Flag instead of the IJN one?
If not, what other edits would have to be made?

Additionally, what further changes would have to be made to create a new object (but a copy of the Taiho/Taiho Kai, just with the flag changed) so it would be a new object, appearing in game as a Russian ship?

I am asking this to see if I can create a Russian flagged carrier, that I could then use in the WAW module of my BAT installation.
Title: Re: Changing a ships flag experiement
Post by: Kopfdorfer on May 08, 2022, 10:22:35 AM
This is quite possible - emmett grogan and I managed to reflag several vessels for a campaign we are developing.
Sadly he is the brains and I am the dumb muscle , but I will mention it to him and see if he can post a simple step by step
procedure for this.
It has to do with going into the Files/3do/Ships/Ship in Question path and changing the flag.tga or f#.tga

Kopfdorfer
Title: Re: Changing a ships flag experiement
Post by: redbaron96 on May 08, 2022, 10:40:25 AM
Thanks Kopfdorfer.
Do you know what the procedure would be for creating a 'new' object, so that the ship with the changed flag be a separate object in FMB (e.g. with a default as a Red Army ship, if an Axis ship was given a new Allied flag).
Title: Re: Changing a ships flag experiement
Post by: Epervier on May 08, 2022, 11:41:29 AM
New Ship ?
===> new Java Class + all new lines in xxx.ini files !!
Title: Re: Changing a ships flag experiement
Post by: WxTech on May 09, 2022, 04:22:00 AM
When saving a .tga, first ascertain if it has an alpha channel. If so, save as a 32-bit image. 24-bit format is for images having no alpha channel.

I sometimes encounter images that have an alpha channel that is entirely white, meaning full opacity. This is superfluous, and such an alpha channel 8s unnecessary. I delete it and save as a 24-bit image, which reduces the file size by 25%. Such an alpha channel likely arose from the artist saving as a 32-bit image, thus creating a superfluous alpha channel.
Title: Re: Changing a ships flag experiement
Post by: redbaron96 on May 14, 2022, 11:50:45 AM
New Ship ?
===> new Java Class + all new lines in xxx.ini files !!

Hi Epervier, can I ask honestly, how much work/how hard is the creation of the new 'Java Class file', if you were 'cloning' the ship and working from the mod files for the ship be to cloned, in this case the Taiho and Taiho Kai?

Would the starting point be the original Taiho/Taiho Kai mod file? and is that the file that I have inserted below, from using Notepad ++ to search for 'Taiho'?

Code: [Select]
Search "taiho" (8 hits in 1 file of 8447 searched)
ClassDump_BAT_4.1.3_Blue_Edge_WAW_DJ_Decompiled\com\maddox\il2\objects\ships\Shipkdm3.java (8 hits)

Line 16:     public static class IJNTaihoCV extends BigshipGeneric
Line 20:         public IJNTaihoCV()
Line 24:         public IJNTaihoCV(String s, int i, SectFile sectfile, String s1, SectFile sectfile1, String s2)
Line 30:     public static class IJNKaiTaihoCV extends BigshipGeneric
Line 34:         public IJNKaiTaihoCV()
Line 38:         public IJNKaiTaihoCV(String s, int i, SectFile sectfile, String s1, SectFile sectfile1, String s2)
Line 63:         new BigshipGeneric.SPAWN(com.maddox.il2.objects.ships.Shipkdm3$IJNTaihoCV.class);
Line 64:         new BigshipGeneric.SPAWN(com.maddox.il2.objects.ships.Shipkdm3$IJNKaiTaihoCV.class);

Code: [Select]
/*  1:   */ package com.maddox.il2.objects.ships;
/*  2:   */
/*  3:   */ import com.maddox.il2.ai.ground.TgtShip;
/*  4:   */ import com.maddox.rts.SectFile;
/*  5:   */
/*  6:   */ public abstract class Shipkdm3
/*  7:   */   extends Ship
/*  8:   */ {
/*  9:   */   public static class IJNKaiTaihoCV
/* 10:   */     extends BigshipGeneric
/* 11:   */     implements TgtShip
/* 12:   */   {
/* 13:   */     public IJNKaiTaihoCV() {}
/* 14:   */     
/* 15:   */     public IJNKaiTaihoCV(String s, int i, SectFile sectfile, String s1, SectFile sectfile1, String s2)
/* 16:   */     {
/* 17:26 */       super(i, sectfile, s1, sectfile1, s2);
/* 18:   */     }
/* 19:   */   }
/* 20:   */   
/* 21:   */   public static class IJNTaihoCV
/* 22:   */     extends BigshipGeneric
/* 23:   */     implements TgtShip
/* 24:   */   {
/* 25:   */     public IJNTaihoCV() {}
/* 26:   */     
/* 27:   */     public IJNTaihoCV(String s, int i, SectFile sectfile, String s1, SectFile sectfile1, String s2)
/* 28:   */     {
/* 29:40 */       super(i, sectfile, s1, sectfile1, s2);
/* 30:   */     }
/* 31:   */   }
/* 32:   */   
/* 33:   */   static
/* 34:   */   {
/* 35:59 */     new BigshipGeneric.SPAWN(IJNTaihoCV.class);
/* 36:60 */     new BigshipGeneric.SPAWN(IJNKaiTaihoCV.class);
/* 37:   */   }
/* 38:   */ }


/* Location:           U:\IL2\DEV\ClassDumps\BAT\4.1.3 Blue Edge\ClassDump_BAT_4.1.3_Blue_Edge_WAW_Classes\ClassDump_BAT_4.1.3_Blue_Edge_WAW.jar

 * Qualified Name:     com.maddox.il2.objects.ships.Shipkdm3

 * JD-Core Version:    0.7.0.1

 */

Title: Re: Changing a ships flag experiement
Post by: Epervier on May 14, 2022, 01:58:15 PM
To answer one of your previous questions...
Code: [Select]
One, if I made this edit to the Taiho/Taiho Kai in my game, would the carrier then display the Soviet Flag instead of the IJN one?The answer is yes. You would have a Japanese ship with a Soviet flag!

Hi Epervier, can I ask honestly, how much work/how hard is the creation of the new 'Java Class file', if you were 'cloning' the ship and working from the mod files for the ship be to cloned, in this case the Taiho and Taiho Kai?
First create a new folder and copy the files of the Japanese ship with the new flag into it.

A new Mother Class must be created for the new ship.
Example: NewShipSoviet

Then give a name to this new ship.
Example: SU_Test

Then put in the minimum...
Example:

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

import com.maddox.il2.ai.ground.TgtShip;
import com.maddox.rts.SectFile;

public abstract class NewShipSoviet extends Ship {

public static class SU_Test extends BigshipGeneric implements TgtShip {

public SU_Test() {
}

public SU_Test(String s, int i, SectFile sectfile, String s1,
SectFile sectfile1, String s2) {
super(s, i, sectfile, s1, sectfile1, s2);
}
}

public NewShipSoviet() {
}

static {
new BigshipGeneric.SPAWN(SU_Test.class);
}
}


Then you have to make the lines for the "ini" files by taking the one of the Taiho and changing the names and the path for this new ship... in short the routine!

Nota : Standard code for Eclipse Java!

Nota 2 : If it is an aircraft carrier with radar or radio beacons... the code must be more complex... but as 409 is not the case, I cannot say anything more. We will have to see examples of code 412 or BAT!

Title: Re: Changing a ships flag experiement
Post by: redbaron96 on May 16, 2022, 05:58:23 AM
I have successfully been able to edit the java and create new class files, creating two extra Russian aircraft carrier ships (the Taiho and Kai-Taiho with Russian flags).
Many thanks to Epervier who advised me on how the java files should be edited.

These are both successfully working in my BAT 4.2.1.

https://www.mediafire.com/file/hcdnj1mjzqmyj45/Russian_Carrier_Leningrad_and_Stalingrad.zip/file

The zip file includes the two Russian carriers, the original Taiho files, and a single mission that I created using the two new ships and the existing 'Soviet Navy' aircraft in BAT.
(https://i.postimg.cc/gj7LvL5t/Image-1.jpg) (https://postimg.cc/0KpNvj97)

(https://i.postimg.cc/Dwk8nhKG/Image-2.jpg) (https://postimg.cc/svmV4txf)

(https://i.postimg.cc/cHbLjymr/Image-3.jpg) (https://postimg.cc/wyDzyrnp)

(https://i.postimg.cc/2jg4bPDk/Image-4.jpg) (https://postimg.cc/V5BS2Zvp)

(https://i.postimg.cc/8P86PMRs/Image-5.jpg) (https://postimg.cc/Yj39d4yw)
Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: Epervier on May 16, 2022, 07:14:59 AM
I see that you take pictures of your screen...
Don't you have any editing software?  ;)
Like "FastStone". It's free!
https://www.faststone.org/FSViewerDetail.htm
The rendering would be much better!  8)
Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: Wolfosito on May 16, 2022, 07:18:17 AM
Hey, Could you clarify the installation a bit? Can't find the "respective files" in the readme
Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: redbaron96 on May 16, 2022, 07:36:02 AM
The respective files are the 'ship ini', 'techni' and the other text files in the mod folder.

The text from them needs to be copied into the appropriate 'properties' file in the module/mod folder (these were made for BAT WAW and I have not tested them in a different module) that the mods are going to be used in.
Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: Wolfosito on May 16, 2022, 08:53:15 AM
Yeah that's the thing I can't find the properties files where I have to paste the code into
I'm also using BAT so could you tell me their actual location?
Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: redbaron96 on May 16, 2022, 09:24:47 AM
For BAT, they are in the module that you want to add the mod to (#WAW for World at War).
Best way to find them is to run a search on the module folder.
Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: bomberkiller on May 16, 2022, 09:34:05 AM
Hello Wolfosito,

you'll find the necessities files in your mods folder.

For example:

#WAW3\STD\com\maddox\il2\objects

Best regards

 ]cheers[

Gerhard

Title: Re: Changing a ships flag experiement: SUCCESSFUL 2 new ships
Post by: Wolfosito on May 16, 2022, 09:54:11 AM
Found them, thanks for the help