Creating your own mod files

Modding discussion.
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Creating your own mod files

Postby Wise Windu » Sat 13 Jun, 2015 10:43 am

This is a guide on how to create your own mods if you're interested, specifically how to extract and pack .sga files. It doesn't seem to be a well documented process, so hopefully this post will make editing them easy to understand. Hopefully. I'll be using the Elite mod 2.4 .sga files to demonstrate.

~~~~~~~~~

Update:

I put together a little tool that I think makes packing up mods much simpler and intuitive. Everything I've tested it with has worked well, but if you have any issues, let me know here. The .sga extraction process below still applies, so if that's what you're having trouble with, skip ahead.

DataPacker.rar
(1.34 KiB) Downloaded 19 times

AttribPacker.rar
(1.12 KiB) Downloaded 15 times


Instead of a small program with a UI, this tool is just a set of 4 files that you can place in a folder, double-click one of them, and then you're done. This will be a quick explanation on how it should be set up, and how you can modify it to suit your needs.

The first thing to do is download the above DataPacker.rar and AttribPacker.rar files and place them in the proper folders. Within your Dawn of War ii Retribution installation folder, go to the GameAssets/Mods folder and create two additional folders within the Mods folder: "Data" and "DataAttrib". They don't have to have those names, but it does make it more obvious what types of files you're working with. Now, unpack the DataPacker files within the Data folder, and unpack the AttribPacker files within the DataAttrib folder. It should look like this:

Image
Image

The DataPacker is used to create the Data .sga Archive type; the AttribPacker is used to create the DataAttrib .sga Archive type. So then, all you have to do is place the files you want to pack into one of those two folders. If you're creating a Data Archive, it would look something like this:

Image

DataAttrib would just have a simulation folder:

Image

Then you just run the AttribPacker.bat or DataPacker.bat, and the .sga file will be output in the GameAssets/Mods/Archives folder. The default file name for a Data archive will be Elite_config.sga and for DataAttrib it will be Elite_attrib_test.sga. These can be changed in the append_bot.txt file by changing the following line (identical location in files for Data and DataAttrib):

Image

Finally, if you want to change the file types added into the .sga file, you'll have to open up the AttribPacker.bat or DataPacker.bat and edit the 5th line in this format:

Image

Simply add another file type in the format: *.filetype before the ">". You'll also have to change the append_top.txt file and add a new, identical line with the highlighted part changed to the new file type:

Image

I'm planning on automating this last part soon. edit: I made a version that automates the creation of the append_top.txt, but it takes longer to run because it has to interact with every file path and determine its file type before it starts packing. Probably not going to post it here, but if you're interested in it for some reason, let me know. It can be useful for smaller mods, but mods with a large number of files can take more time.

I think all of the necessary file types should be there by default, but it's always possible I missed something. That should be all there is to know, and if you find any issues, please let me know.

~~~~~~~~~

*This used to be a guide on how to edit the army scheme colors for Elite, but hakon came up with an easier way to do it, wizard that he is.

First, you'll need to download these two applications:

SGA Reader 2: http://www.mediafire.com/download/6l6g3 ... 150209.rar

DK SGA Archive GUI: http://www.mediafire.com/download/y42ic ... .4.1.0.rar

Install them wherever you want. All you have to do to install is extract the files.

Next, check the files in your Dawn of War II - Retribution\Elite\ installation folder. Within the Elite folder, you'll find an Archives folder, and within that are the game files packed as .sga files. The file you want to edit is called Elite_config.sga.

Go back to the folder in which you installed the SGA Reader 2 and open the application.

Image

From the top left corner of the application, File > Open, navigate to your Elite\Archives\ folder and open the Elite_config.sga file. You'll see a drop down tree to the left of the application that has Data at the top, with a config folder below it. Within the config folder are two files, defaultchaptercolours.lua and armypaintercolours.lua. On the top of the screen is a dropdown that says "Default directory action". Click the dropdown and make sure it is set to Extract.

Image

Then double click both of the files to extract them. It will ask for a destination folder, and you can make it whatever you want. But if you don't change it, it will just extract the files into your Elite\Archives\ folder, which is fine and probably easier. You should now be able to see a Data folder within your Archives folder. Within that are both of the files you just extracted, which you can edit as you like.

When you are finished editing the files you want, you'll need to repack them into a .sga file using the DK SGA Archive GUI you downloaded above.

Image

You may have to do some editing of settings if you do not have Elite installed to your standard C drive, so I'll go through that.

The application should look like this

Image

Set the SGA Archive Name to "Elite_config", the Archive Type to "Data", the Input Directory to the 'Data' folder you extracted the files to (so if you extracted them to your C drive in the Elite\Archives\ folder it will be: 'C:\Program Files (x86)\Steam\steamapps\common\Dawn of War II - Retribution\Elite\Archives\Data'), and the Output Directory to your Elite\Archives\ folder.

Next, open the File > Settings window, shown below.

Image

You'll need to set up the Archive.exe location, which is in your Dawn of War II - Retribution folder: Dawn of War II - Retribution\Tools\Bin\Archive.exe

And make sure the dropdown on the top says SGA v5 (DoW2). That should be all you need to change. Save the settings and exit out of the Settings window.

Note that in the Settings window, there are a lot of file extensions listed. If you downloaded the files from the link above, all of the extensions you'll need should be included already (edit: You may need to add *.layers to the list if you're trying to pack map files). You can check them, as well as the file path for the Archive.exe, without opening the program, by opening the DK - SGA Archive.ini file in the installation folder.

In the main window, with everything filled in as explained above, click the Create SGA button.

And then you're done! Mod packed and ready to go. If you have any issues or questions, post them here and I'll try to help.

Keep in mind also that any files already present in the Elite mod will not be overwritten if placed in the Mods folder. To make any art files work, pack the files in with the Elite_config.sga. Files from .sga files other than Elite_data.sga will not be compatible with Elite_config.sga. If any files from the Elite_attrib.sga are changed, your game will not be compatible with other default installations.
Last edited by Wise Windu on Fri 10 Jul, 2015 7:22 pm, edited 1 time in total.
User avatar
David-CZ
Contributor
Posts: 365
Joined: Tue 28 May, 2013 1:41 pm
Location: Czech Republic
Contact:

Re: Creating your own mod files

Postby David-CZ » Wed 01 Jul, 2015 9:47 am

This might be a poitless question based on the last paragraph, but would it be possible to edit 'Elite.module' to something like this

[data:common]
folder.01 = Elite\Data
folder.02 = GameAssets\Data
...

so that I don't have to repack the archive everytime I want to test the models in game?


On a different note, I was trying to export a model but Max pops an error message every time I do so. A blank one at that, so I don't know what I'm doing wrong. I made sure to have all the textures and shaders exported so that the recourses are accessible to Max but it didn't solve anything. I also tried to export an old model of mine I know was working but I got the same error. Based on your answer to the first question I might end up exporting all the archives and try again if that helps.
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Wed 01 Jul, 2015 12:39 pm

David-CZ wrote:This might be a poitless question based on the last paragraph, but would it be possible to edit 'Elite.module' to something like this

[data:common]
folder.01 = Elite\Data
folder.02 = GameAssets\Data
...

so that I don't have to repack the archive everytime I want to test the models in game?
I tried it when we were getting the patch ready, and files in those folders never seemed to change anything in game.

Not sure about Max. Maybe sterling can help you out. He seems to still be able to make it work.

Also, if you'll be repeatedly testing the same model and art files, you can edit the update.bat file in the Elite\Config folder in Notepad or something to have it automatically update the .sga with the files you want. Here's the full .bat file code which adds the ability to pack .dds, .model, and .motiontree files onto hakon's original file. You can add any other file extensions you want by just copy/pasting one of those lines and adding a new Extension in quotes:

Code: Select all

pushd "%~dp0
@echo off

REM The following will create a SGA file with armypaintercolours.lua and
REM defaultchaptercolours.lua stored inside.
REM

(echo ^<Archive Name="" DefaultCompression="Stream"^>
 echo ^<IncludeRule Extensions="lua" MinSize="-1" MaxSize="-1" /^>
 echo ^<IncludeRule Extensions="dds" MinSize="-1" MaxSize="-1" /^>
 echo ^<IncludeRule Extensions="model" MinSize="-1" MaxSize="-1" /^>
 echo ^<IncludeRule Extensions="motiontree" MinSize="-1" MaxSize="-1" /^>
 echo ^<TOC Name="Data" Alias="Data" RelativeRoot="" /^>
 echo ^<File Name="config\armypaintercolours.lua" /^>
 echo ^<File Name="config\defaultchaptercolours.lua" /^>
 echo ^<File Name="art\race_eldar\troops_wargear\armour\avenger_armour\plug.dds" /^>
 echo ^</Archive^>) > sga.xml

..\..\tools\bin\Archive.exe -c -r .. -cf sga.xml -a Archives\Elite_config.sga
del sga.xml

The art\race_eldar\...\plug.dds at the end is just an example, but you get the idea. Create a folder in the Elite\ folder called "art", and then extend the file path from there, and add the files to the .bat file in the format

Code: Select all

echo ^<File Name="art\race_eldar\troops_wargear\armour\avenger_armour\plug.dds" /^>
from above.

Obviously might be a bit too much to do if you're just going to test them one or two times each.
User avatar
David-CZ
Contributor
Posts: 365
Joined: Tue 28 May, 2013 1:41 pm
Location: Czech Republic
Contact:

Re: Creating your own mod files

Postby David-CZ » Wed 01 Jul, 2015 12:59 pm

Thanks. Will ask sterling about the exporting issue.
KanKrusha
Level 3
Posts: 201
Joined: Tue 09 Apr, 2013 9:10 am

Re: Creating your own mod files

Postby KanKrusha » Sun 23 Aug, 2015 9:29 am

Hi, I been away a while. Does cope's toolbox not work anymore or is it just something special about this mod that you need the other programs?

Thanks
KK
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Sun 23 Aug, 2015 1:28 pm

It works, but because of the way the mod is packaged now, it won't open in Cope's. You'll have to open the .sga files individually rather than opening the mod.
KanKrusha
Level 3
Posts: 201
Joined: Tue 09 Apr, 2013 9:10 am

Re: Creating your own mod files

Postby KanKrusha » Mon 23 Nov, 2015 6:25 am

Hi Windu,

sorry I havent worked much with bat files. If I want to add a file from the attrib folder will that work?

I see there is echo ^<TOC Name="Data" Alias="Data" RelativeRoot="" /^>

Can i therefore use
echo ^<TOC Name="Data" Alias="Attrib" RelativeRoot="" /^>

If i do that can i do it in the same bat file?
Does echo ^</Archive^>) > sga.xml need to come after each section ?

Sorry for the questions.

thanks
KK
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Mon 23 Nov, 2015 1:54 pm

Yeah, you can do it all in one .bat file if you copy and paste the whole thing after the last line, and change the line to " echo ^<TOC Name="Attrib" Alias="Attrib" RelativeRoot="" /^>"

and change the second to last line to have the name of the Attrib .sga (..\..\tools\bin\Archive.exe -c -r .. -cf sga.xml -a Archives\Elite_config.sga) so the two don't have the same name. So, example:

Code: Select all

pushd "%~dp0
@echo off

REM The following will create a SGA file with armypaintercolours.lua and
REM defaultchaptercolours.lua stored inside.
REM

(echo ^<Archive Name="" DefaultCompression="Stream"^>
 echo ^<IncludeRule Extensions="lua" MinSize="-1" MaxSize="-1" /^>
 echo ^<TOC Name="Data" Alias="Data" RelativeRoot="" /^>
 echo ^<File Name="config\armypaintercolours.lua" /^>
 echo ^<File Name="config\defaultchaptercolours.lua" /^>
 echo ^</Archive^>) > sga.xml

..\..\tools\bin\Archive.exe -c -r .. -cf sga.xml -a Archives\Elite_first.sga
del sga.xml

pushd "%~dp0
@echo off

REM The following will create a SGA file with armypaintercolours.lua and
REM defaultchaptercolours.lua stored inside.
REM

(echo ^<Archive Name="" DefaultCompression="Stream"^>
 echo ^<IncludeRule Extensions="lua" MinSize="-1" MaxSize="-1" /^>
 echo ^<TOC Name="Attrib" Alias="Attrib" RelativeRoot="" /^>
 echo ^<File Name="config\armypaintercolours.lua" /^>
 echo ^<File Name="config\defaultchaptercolours.lua" /^>
 echo ^</Archive^>) > sga.xml

..\..\tools\bin\Archive.exe -c -r .. -cf sga.xml -a Archives\Elite_second.sga
del sga.xml


Ran it and it worked fine.
Deflaktor
Level 2
Posts: 119
Joined: Mon 20 Jul, 2015 7:03 pm

Re: Creating your own mod files

Postby Deflaktor » Tue 01 Dec, 2015 12:48 pm

If I change how some DLCs look like, e.g. swap models here and there and/or change textures, will it be visible in multiplayer by other players?
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Tue 01 Dec, 2015 2:50 pm

No, it will only be visible to you.
Absynth.81
Level 0
Posts: 4
Joined: Thu 22 Jun, 2017 4:16 am

Re: Creating your own mod files

Postby Absynth.81 » Thu 22 Jun, 2017 9:29 am

Hey guys,
I'm new to this forum. Been working on a textures mod for vanilla DOW2:Retribution. I thought the Eldar needed some love :lol: since their color schemes were way off codex out of all the factions. Basically I'm trying to make codex friendly craftworld colors selectable and be compatible with vanilla pvp. Obviously my "codex correct" craftworld colors and craftworld decals/designs will only be visible in game for those who use my mode. The end result should be fully distinctive craftworlds, with Biel-Tan sporting the thorns motif on their units, Alaitoc will have thier camo pattern etc... People who don't have the mod will just see the standarded vanilla scheme but not new schemes I've added.

Going ok so far since it's just adding new .dds files and some creative alpha channels mixing to get the 5th and 6ths colors to appear. Got the idea from the old TC_mod (think by hangar8 but can't remember for sure) on the old relicnews.com forum back when it was still running. Anyway that's some background on what I'm working on.

Whilst I was working on my mod I came across a rather annoying bug on the Ulthwé DLC, the warlock leader of the wraithguard squad seems to be displaying both the vanilla tier 1 "common" warlock and the ulthwe seercouncil models/textures at the same time and clipping through each other...

Ulthwe DLC guardian squad warlock uses the vanilla warlock model and scheme (I'm only rank lvl 34 so it's using the tier 2 "rare" armour)

[The extension jpg has been deactivated and can no longer be displayed.]



Then the ulthwe DLC seercouncil

[The extension jpg has been deactivated and can no longer be displayed.]



The DLC wraithguards squad warlock leader

[The extension jpg has been deactivated and can no longer be displayed.]



As you can see the wraithguard squad warlock is a wierd hybrid of both... :shock:

Anyone know how to fix this? it's really bugging me :cry: Think it was meant to use the vanilla model like the guardian warlock but somehow the DLC seercoucil model is also showing up... It's not the .adp I'm thinking it's one of the .rdf but I've not messed around with those before so would't know how to begin :?

Also on the none dlc ones I would love to swap the autarch head for the winged helmet from the campaign (not the ulthwe dlc one). Someone already did it but I can't seem to find a link to that mod since relicnews.com went byebye... If someone can link to that mod or teach me how to recreate It would be much appreciated. Also the link for the TC_mod I mentioned earlier as well would be great. I seem to have deleted it by mistake :P

Anyway a little teaser for my own texture mod. (please note these are work in progress so it maybe subject to change)

Alaitoc teir3 guardian

[The extension jpg has been deactivated and can no longer be displayed.]



Biel-Tan teir3 guardian

[The extension jpg has been deactivated and can no longer be displayed.]



Thinking of changing the face plate to black since the biel-tan warlocks and farseer ghosthelm will have black face plates. As far as I'm aware the face plates needs to be the same color for everyone in the same battlehost according to lore... well at least the 7th edition codex anyway.

Lastly I'm planning to tweak the colors of the DLC ulthwe to have white/bone face plates along with other scheme/texture rework for the ulthwe DLC. It will still use the DLC models but with new .dds files. Will this fall foul of copyright issues? I'm thinking since it technically doesn't give access to the "as intended" ulthwe DLC it would be permissible?... I noticed some of those ulthwe DLC models were used by the Elite mod so I'm hoping it will be OK as long as I replaced the original DLC color scheme/textures with something new. The aim is to have the "texture replaced" Ulthwe DLC look like the classic ulthwe from the 3rd to 6th editions codices and have the standard ulthwe look like ones in the 7th edition codex with turquoise sashes/soulstones as oppose to the red of the previous version.

Well that was way longer than I expected. Hope someone can help. Thanks in advanced 8-)
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Mon 26 Jun, 2017 3:51 am

Absynth.81 wrote:Whilst I was working on my mod I came across a rather annoying bug on the Ulthwé DLC, the warlock leader of the wraithguard squad seems to be displaying both the vanilla tier 1 "common" warlock and the ulthwe seercouncil models/textures at the same time and clipping through each other...
You would have to go into the .rbf files. If you go in the .rbf files through Cope's Toolbox, and open up the eld_warlock_wraithguard.rbf file under ebps, you'll be able to see that the Warlock, in addition to its entity blueprint, has a wargear equipped that adds another armour model over the first one for no real reason. That's the issue. Delete that wargear, and the issue should be fixed.

Absynth.81 wrote:Also on the none dlc ones I would love to swap the autarch head for the winged helmet from the campaign (not the ulthwe dlc one). Someone already did it but I can't seem to find a link to that mod since relicnews.com went byebye... If someone can link to that mod or teach me how to recreate It would be much appreciated. Also the link for the TC_mod I mentioned earlier as well would be great. I seem to have deleted it by mistake
You'd also have to go into the .rbf files for that. In the entity_blueprint of the Autarch's ebps file. You have to know the file path of the model, and that's all. Not too difficult.

Absynth.81 wrote:Lastly I'm planning to tweak the colors of the DLC ulthwe to have white/bone face plates along with other scheme/texture rework for the ulthwe DLC. It will still use the DLC models but with new .dds files. Will this fall foul of copyright issues? I'm thinking since it technically doesn't give access to the "as intended" ulthwe DLC it would be permissible?... I noticed some of those ulthwe DLC models were used by the Elite mod so I'm hoping it will be OK as long as I replaced the original DLC color scheme/textures with something new. The aim is to have the "texture replaced" Ulthwe DLC look like the classic ulthwe from the 3rd to 6th editions codices and have the standard ulthwe look like ones in the 7th edition codex with turquoise sashes/soulstones as oppose to the red of the previous version.
Probably fine.
Absynth.81
Level 0
Posts: 4
Joined: Thu 22 Jun, 2017 4:16 am

Re: Creating your own mod files

Postby Absynth.81 » Mon 26 Jun, 2017 9:26 am

Thanks for the tips Wise Windu. Do I need to change any other files if I edit those .rbf? at the moment I only have the "data" file that contains the subfolders for the art stuff. Would I need to make a seperate .sga for the .rbf folder chain or can I incorporrate it into my existing .sga?
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Mon 26 Jun, 2017 5:31 pm

You would have to have two separate .sga files for the Attrib files and the art files. They're referenced separately in the .module files. You shouldn't have to change anything else. Those changes shouldn't affect anything else in the game afaik.
Absynth.81
Level 0
Posts: 4
Joined: Thu 22 Jun, 2017 4:16 am

Re: Creating your own mod files

Postby Absynth.81 » Tue 27 Jun, 2017 12:37 pm

Cheers dude much appreciated.
ohmygeed
Level 0
Posts: 1
Joined: Wed 13 Dec, 2017 10:48 pm

Re: Creating your own mod files

Postby ohmygeed » Wed 13 Dec, 2017 11:09 pm

I've been having issues with modding Dawn of War 2 since I started a few days ago. I've followed your instructions, only difference is that im editing Elite's race files to change population cap, rather than using the .config files as a basis for modding.

I've got my imperialguard.rbf extracted into my directory, but when I go to modify it using Copes Tools, I get this ERROR...

"Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Error launching plugin RBFPlugin.RBFEditorPlugin: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name :index."


I've also tried just making a mod in Copes Tools, with the Elite files as a basis, but every time, it fails to load anything from the files. The ATTRIB and DATA folders are empty! They show up on the left side, but have no + sign to go into the folders themselves to edit anything! :(

Anyone know whats going on?
User avatar
Black Relic
Level 4
Posts: 844
Joined: Mon 29 Jul, 2013 3:05 am
Location: United States
Contact:

Re: Creating your own mod files

Postby Black Relic » Thu 21 Dec, 2017 6:53 am

All of Elites files are in an SGA format. You have to have the whole thing extracted and the Elite.module has to be modified. For it to work in copes tools box.
"...With every strike of his sword, with every word of his speech, does he reaffirm the ideals of our honored master..." -From the Teachings of Roboute Guilliman as laid down in the Apocrypha of Skaros. Space Marines Codex pg. 54
Absynth.81
Level 0
Posts: 4
Joined: Thu 22 Jun, 2017 4:16 am

Re: Creating your own mod files

Postby Absynth.81 » Thu 28 Feb, 2019 9:46 pm

I left working on my small mod for a while... (over a year) now I've completely forgotten where to find the .rbf files that handles which 3D models are linked to which units. Can't find an ebps folder in GameAssets .sga files either. All I found was the "attributes.rbf" in

Dawn of War II - Retribution\GameAssets\Archives\GameAttrib.sga - Attrib\simulations\attrib\attributes.rbf

Is this even the correct .rbf for changing 3D models linked to units? I thought it was just the one for unit stats not 3D models linkage

I'm working off vanilla files not Elite mod. I have a feeling the ebps folder I remember seeing was from when I was looking at Elite mod files when I had it installed? How would you get the ebps if you're just working off vanilla retribution files? where/how would I extract it?

Or I'm just being blind and stupid... probably both :cry: help
User avatar
Wise Windu
Moderator
Posts: 1178
Joined: Sat 14 Sep, 2013 2:22 am

Re: Creating your own mod files

Postby Wise Windu » Tue 15 Sep, 2020 12:42 am

Updated the original post with a tool I put together that I think makes packing .sgas a bit simpler.

Return to “Modding”



Who is online

Users browsing this forum: No registered users and 3 guests