Since I already wrote a fair bit in one of my posts, and considering there is a lack of a simple step-by-step guide to RBF editing and compiling it into a mod, I decided to write this. I hope it encourages the pretty small DoW2 modding community.
Tools
First you need to make sure you have the tools. Get the SGA unpacker, and the RBF converter from HERE. Next get the RBF Converter Helper from HERE and finally the SGA packer from HERE. Make sure you unzip the two into different folders though, and I recommend putting shortcuts to each on your desktop because you'll be using them a lot.
Setting Up
To get started modding, Make a new folder called anything you want (I'll call it <Modname> for now) and put it in the DoW 2 directory. Next, copy-paste the DoW 2.module file, but keeping it in the DoW 2 directory. Rename the module to <Modname>, then open it up using and text editor.
Now change the
ModFolder = GameAssets
to
ModFolder = <Modname>,
as well as changing
folder.01 = GameAssets\Data
to
folder.01 = <Modname>\Data
under the sub-headings of [attrib:common] and [data:common]. You should also fill in the spots up the top with a description etc. Finally, have a lot at the name section:
Name =
This name is the parameter you use to start DoW II with your mod.
I always find that you should name it whatever your module is called, for simplicity's sake.
RBF Info
RBF files are the blueprints to everything appearing in DoW 2. You cannot change everything in the game by modifying RBFs, but you can change all attributes, such as health, energy, abilities, weapons, squad members, sight range, movement speed, and hundreds of useful attributes.
Under the gameattrib archive, there are multiple folders. As a reference:
- Ebps means single unit (squad member) attributes. However it can also refer to an entity without a squad, IE a building (but vehicles have squads).
- Sbps means squads attributes.
- Racebps means all the data about each race.
- Upgrade refers to all upgrades any squad can get in multiplayer, including the hero items. However a lot of the effects of the hero wargear are stored in Wargear.
- Wargear refers to campaign as well as multiplayer wargear.
- Weapons contains all the weapon data. You should only have to fiddle with the stuff in the sub-folder also called "weapon".
- Tuning, finally, contains all sorts of useful data to tweak the whole game.
Within this file structure, you will come across the folders:
- campaign: which obviously only contains the campaign blueprints
- pvp: which refers only to multiplayer
- core: which refers to The Last Stand attributes.
If you want more data on individual extensions or blueprint types, have a look Here
Modifying RBFs
To mod RBFs (attribute files), open up the SGA extractor, and navigate to C:\Program Files (x86)\Steam\steamapps\common\dawn of war 2\GameAssets\Archives.
Open gameattrib.sga, and find the file you want by expanding the folders. Double click it, and look at the extraction path. Here, you should change the “Gameassets/Archives” in the extraction path to <Modname>. Do this for all files you want to modify.
OR
If you're not short of disk space, instead of extracting each RBF individually, you can extract them all at once, and then copy-paste the ones you want to mod into your modfolder. This is faster, and also gives you easy access to lots of RBFs by Relic to use as examples. I recommend opening up the Mod Packer, going to the extract tab, and browsing to Dawn of War 2/Gameassets/Archives/Gameattrib.sga. As the extraction path, select the same archive folder.
Now click extract, and you might have to wait a while. When its done, copy paste each of the files you want to mod into the exact same filepath, except using your modfolder as the base directory. E.G. Something in "GameAssets\Archives\Attrib\simulation\attrib\ability" should be copied to "<Modname>\Attrib\simulation\attrib\ability"
***
Browse to your extracted RBFs using the "batch" convert tool of the RBF converter and double click it.
Now browse using the RBF converter's "open", and open the text file.
You can now make changes to the file. Obviously you can change basic attributes like the movement speed, LOS etc. of an entity (found under EBPs) quite easily. Just make sure to keep the syntax, including an "f" after most numbers, and a semicolon to end each line.
To save your changes, press the "current" convert button.
Advanced Changes
To make more advanced changes, you might want to copy a certain extension from another unit that you have converted. An extension is the one of the parts of all blueprints that you can modularly add on to a blueprint. If you want to copy one, highlight between the line with one pipe "|" and "_ext" on the end, to the bit where the extension ends, where there is one pipe, and a curly bracket "{".
Code:
| entity_blueprint_ext: {
This is the start of an extension.
This is the end.
If you copied, for example, the spawner_ext from the sm_hq, and added it to the sm_listening post, then the listening post would be able to build new units and reinforce them.
Finally if you want to create new units, I recommend copying a similar unit's RBF and the converted text file, renaming it to whatever you're calling the new unit, and then editing it.
UCS Values
Another thing you'll need for RBF editing is knowing how to use UCS values. Basically, just browse to Gameassets>Locale>Yourlanguage and copy-paste the DoW2.ucs.
Rename it to exactly the same thing as your module file, and then open it and delete everything. Now you can add some of your own values, by choosing a number way higher than the ones in the DoW2.ucs, but not more than 9 digits (I think). Now add whatever text you are going to be using in your mod.
Example
As an example, if you were making a veteran marines squad, you'd probably copy the EBP of the tactical marines', both RBF and TXT, then edit both filenames to have a different name. You would also want to copy the SBP of the tactical marines squad.
You'd then go to UI_ext, and edit the screen name of the EBP to a UCS number with "Veteran Marine" next to it, and the screen name of the SBP to a UCS with "Veteran Marine Squad" and the help text to a number with "A squad hardened to battle that can decimate infantry" (or be more creative than me).
Then make sure under squad_loadout of the SBP, change the type to the filepath of the EBP of the veteran marines.
Then you can make changes to either of them. Obviously you might increase the HP (in the EBP) and energy (in the SBP).
Testing
To test your mod, make sure all the modified Text files have been batch converted back to RBFs. Finally, all you need to do to get DoW 2 to run the mod, is open steam, click My Games right click on Dawn of War 2, click Properties, click Launch Options, and type
Code:
-dev -modname <yourmodname>
The modname should be what you set in the module,
Name = <yourmodname>
Packing into an SGA
Well if you're making a mod for others to play, you'll need to compile the data into an SGA.
To do this, open the SGA archive tool, and then, if you only have attrib files in your mod, open the SGA Archiver, and browse to your simulation folder as the input. Choose archive type - attrib, choose a name like "MyModAttrib", and set the output to wherever.
Press create SGA. At this point you should probably back up the non-SGA data files somewhere.
Next copy the newly-created SGA into your modfolder and delete all the old files.
You will now have to change the directory in your module under attrib to "<Yourmodname>.sga" rather than <Yourmodname>/data/attrib or wherever you've set it.
Code:
[attrib:common] folder.01 = <Yourmodname>\Data\Attrib
to
Code:
[attrib:common] folder.01 = <Yourmodname>\MyModAttrib.sga
Finally to run the mod, take the -dev out of the launch properties in steam.
That's all. Thanks for reading. Feel free to tell me how to make it easier to understand/more correct.