Editing a DDS file?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
cbssecman
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 49
Joined: Tue Feb 12, 2013 6:08 pm

Editing a DDS file?

Post by cbssecman »

I'm using a Mac.

I'm trying to convert an existing DDS file (GERMAN_PARA_MG34) to give myself a custom unit (WAFFEN_SS_LMG).

I created a test campaign folder called AAATEST
I copied the SQUADS.CSV file and pasted it to AAATEST campaign folder
I edited the squads.CSV to create a new unit and stats for "WAFFEN_SS_LMG"
I gave it Name = Waffen SS LMG; ID = 1000; IconID = WAFFEN_SS_LMG; AssetFilename = WAFFEN_SS_LMG (I made it a three-man unit so it's easy to tell in BA2 editor that it's the new unit)
I copied the german para mg34 DDS file and renamed it "WAFFEN_SS_LMG"
I created a AAATEST/DATA/BATTLE/UNITTEXTURES folder and placed the WAFFEN_SS_LMG.dds file in it
I created a AAATEST/DATA/BATTLE/UNITS folder
I copied the german_para_mg34_0.S4F file, renamed it WAFFEN_SS_LMG_0.S4F and placed it in the UNITS folder
I copied the german_para_mg34.txt file, renamed it WAFFEN_SS_LMG.TXT and placed it in the UNITS folder
I created a text file in my campaign folder (AAATEST/TEXT9.txt) to add a unit name: IDS_UNITNAME1000,"Waffen SS LMG",
I opened BA2 editor, selected the AAATEST campaign, and opened a new scenario file
The unit appears in the pick list in editor as WAFFEN SS LMG, and when I select it and place it on the map it comes up just fine looking exactly like a german para MG34, except with 3 men.
So far so good...

I opened the WAFFEN_SS_LMG.DDS file using Graphics Converter 9, changed the color of the pants from blue to khaki, and saved the file.
I closed Graphics Converter, then reopened the WAFFEN_SS_LMG.DDS file from my campaign folder, just to make sure the changes were actually saved. They were.

I opened BA2, went to editor, opened the campaign, selected WAFFEN_SS_LMG from the unit pick list and placed it on the map, but it still comes up with paras in blue pants.

What am I doing wrong?
~ ad Triarios redisse
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Editing a DDS file?

Post by pipfromslitherine »

The texture names are built into the graphics file (the .s4f). The simplest solution is to edit your version of the s4f with a binary editor to change the (easily findable) texture name - you would just need to make sure your texture name was the same length as the existing one.

Cheers

Pip
follow me on Twitter here
cbssecman
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 49
Joined: Tue Feb 12, 2013 6:08 pm

Re: Editing a DDS file?

Post by cbssecman »

Thanks Pip! That did the trick!
I fumbled it all at first, but I figured out what I had forgotten to do.
~ ad Triarios redisse
makigono1
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 93
Joined: Sat Jun 06, 2015 2:30 am

Re: Editing a DDS file?

Post by makigono1 »

Wanted to thank you both for this thread, as it was very helpful to me also! :)
makigono1
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 93
Joined: Sat Jun 06, 2015 2:30 am

Re: Editing a DDS file?

Post by makigono1 »

UPDATE: Never mind. I'm an idiot. Re-read Pip's post. I forgot that the new DDS file has to have the same number of characters in it as the original. (Duh!) Everything's fine now.


Running into a problem here.
I want to take an existing building object, rename the S4F file, rename and edit the DDS files, edit the S4F file so that it points to the newly renamed DDS files. However, trying to load map into the game's editor, it crashes with the "can't find a texture" error. I've checked the obvious stuff of the spelling and case, but no success. What needs to be changed? Basically, I've created a new object subfolder in my campaign, edited the objects.txt file with the name I want to use for my object, took an existing building and renamed the S4f file and all the DDS files to match each other and the objects.txt file, and edited the S4F to point at the renamed DDS file. Crash.
Post Reply

Return to “Battle Academy 2: Modders Corner”