Copernicus
5th May 10, 9:23 AM
Your First Dawn of War II Mod using Cope's Tool
Welcome to this tutorial!
I'm glad to introduce you to the fascinating world of modding Dawn of War II (including Chaos Rising). In this tutorial you will learn how to create a basic Dawn of War II modification. Our first goal is to make some simple changes: We will increase the squad size of the Space Marines' Scout squad while keeping it's original requisition cost.
This tutorial does not only aim at teaching you some basic modding skills but also at giving you some more insight into Dawn of War II and using my tool.
Getting the right tool
Since the release of Dawn of War 2 the community created a variety of tools (http://forums.relicnews.com/showthread.php?t=216965) for modding the game. Starting with Corsix' RBFConv (http://forums.relicnews.com/showthread.php?t=216883) (which still works but is somewhat more complicated to use) people modded the game, later on MartinNJ's DoW2 Mod Studio (http://forums.relicnews.com/showthread.php?t=235306) was released. This tool allowed to easily create new mods and combines multiple other tools (like the afore mentioned RBFConv). This guide will use my own tool as I'm most familiar with it. However, it's not totally perfect yet and might still crash sometimes. If you experience a crash make sure to post the log.txt from the tool's directory in the tool's thread (http://forums.relicnews.com/showthread.php?t=244248).
You can download the most recent version here (http://forums.relicnews.com/showthread.php?t=244248).
Installing and configuring the tool
Installing the tool is simple: Extract all the files from the archive you downloaded to any destination and run CopeModToolDoW2.exe. Up on the first start of the application it might ask you to specify your Dawn of War II directory. You shall then first check your options: Click on Tools->Options to open the Options dialog (Figure 1). I recommend not changing anything besides unchecking the Use Chaos Rising checkbox if you do not own Chaos Rising. You should also check that the Steam Executable path points to your steam.exe. Both of the mentioned settings are relevant for quickly starting your mod from the tool.
http://img718.imageshack.us/img718/5066/fig1t.png (http://img718.imageshack.us/i/fig1t.png/)
Figure 1 - The Options dialog.
Creating a new mod
After you've double-checked your settings we'll proceed with the next step:
Click on Start in the upper left corner of the tool and select New DoW2 Mod from the menu. You'll see a new dialog (Figure 2). First, click the Browse button and search for a file called DoW2.module which should be in your Dawn of War 2 directory. We'll get to so called module files in a second. Now enter your mod's name into the second text box. We'll just go with z_MyFirstMod this time. I like using the z_ prefix to keep all my mods grouped but you really don't need to use it at all ;).
The Displayed Mod Name, the Description and the Mod Version are optional, we will just leave them blank. Hit OK. The tool will now take some time to load all the files required to continue, this may take some time. For me it's usually a few seconds.
http://img687.imageshack.us/img687/4766/fig2v.png (http://img687.imageshack.us/i/fig2v.png/)
Figure 2 - The New DoW2 Mod dialog.
Module files and file management
Every mod for Dawn of War 2 needs a so called module file. This file should be placed in the Dawn of War 2 directory. A module file provides basic information about a mod like which files to load, what this mod is called etc.. It's essential! Module files can easily be edited with notepad or something similar.
I recommend taking a look into your module file which the tool created for you when you used the New DoW2 Mod dialog (it also created a folder with your mod's name in the Dawn of War 2 directory). It's name is just the same as the name of your mod. Having opened it you'll see different sections, the most interesting ones for us are global, attrib:common and data:common which usually is at the end of the file.
Global contains general information, it's pretty much self explanatory. Attrib:common and data:common both list archive (called SGA) files and directories. The game will normally only load the archives (using the -dev command line parameter it will also load the files from the directories). Everything from the attrib:common section contains attribute information for the game, e.g. how strong a certain unit is, in which way an ability works etc.; things listed under data:common contain data like textures, models, scripts, maps, sound-containers and similar things.
If there are duplicate files in the archives of directories the one with the highest priority is used. Files from folders always have a higher priority than those from archives and the archive (or folder) entry with the lowest index has the highest priority among archives (or folders).
For the sake of simplicity your mod shall only use one folder for the data:common section and one for the attrib:common section. My tool does not support mods with more than one directory specified (which is not really a limitation).
You might also notice that your mod has a seperate folder for attrib and data while the original DoW2.module does not. This is also a limit set by my tool which will help you to keep the overview at all times. Changing that might crash the tool, so always ensure to have a dedicated directory for attrib and data.
The user interface
By now the tool should have finished loading your newly created mod :). It's time to take a closer look at the GraphicalUserInterface (GUI, Figure 3). At the left hand side there's the Directory View, you'll notice that there's a tree view with two main nodes: ATTRIB and DATA. These nodes contain all the directories and files specified in the module file. Blue nodes represent virtual files (files from the archives) whereas red nodes represent local files.
Using the Mode Selector right above the Directory View you can switch between a virtual only tree view and a combined tree view which shows both local and virtual files. The virtual only tree view comes in handy when there's a local file with the same name and position as a virtual file and you still want to access the virtual one. Right clicking a node other than ATTRIB and DATA will open up a drop down menu using which you can extract files.
Double clicking a file from the Directory View will try to open it. If there's a suitable plugin found for the file type you're trying to open a new tab will be created in the File Application View. The content of the tab depends on the file type. You can use the buttons from the File Tab Control to close a tab or even all tabs at once.
There also is a quick way for testing your mod: Click Tools in the main menu at the upper left and select Test Mod. The tool will then start Dawn of War 2 using your mod and -dev (so the game loads all the files from the directories in addition to those from the archives). The latter one is important because you can not edit any files from the archives; as soon as you save the file the tool will extract the file and save the modified version locally.
http://img39.imageshack.us/img39/7185/fig3p.png (http://img39.imageshack.us/i/fig3p.png/)
Figure 3 - The Main GUI.
Modding the Space Marines' Scout squad
Now that you know about the basic theory and the tool it's time to get modding!
We'll need to change some attrib files in order to achieve our goals. Those files' type is usually RBF (Relic Binary File) and fortunately my tool already ships with a custom made RBF-Editor. Navigate to ATTRIB\\simulation\\attrib\\spbs\\pvp\\race_marine\\troops using the Directory View and double click sm_scout_marine.rbf to open that file (Figure 4). All the files in the SBPS folder represent SquadBluePrints[I], the [I]PVP folder indicates that the files it contains are used in PVP matches. As you can see on the right hand side of the tool, RBF files have a tree-like structure. They're basically XML files burnt to some binary format.
You'll need to change a few values in that file (marked in red in Figure 4): squad_loadout_ext contains the information about what the squad consists of, it's got an entry called unit_list which itself has an entry for every different entity in that squad. max and num of that entry control how many instances of the specified entity (type, marked in green in Figure 4) the squad starts with (num) and can have at maximum (max). Set both values to 4.
http://img294.imageshack.us/img294/6756/fig4.png (http://img294.imageshack.us/i/fig4.png/)
Figure 4 - sm_scout_marine.rbf (SBP) opened with Cope's RBF-Editor plugin.
Searching the SquadBluePrint for any way to control the squad's cost we'll notice that there is none. Prices in Dawn of War 2 are calculated dynamically, each entity stores information about it's cost and the SquadBluePrint just sums it all up. Thus we need to edit the EBP (EntityBluePrint) of the Space Marines' scout. Navigate to the EBP specified by type (green marking in Figure 4) and open it. Hit Save As RBF (marked in pink in Figure 4) and close the SBP file.
In the EBP search for cost_ext\\time_cost\\cost and set requisition to 52.5 (4 * 52.5 = 3 * 70 = 210). Save and close the file.
http://img576.imageshack.us/img576/1223/fig5.png (http://img576.imageshack.us/i/fig5.png/)
Figure 5 - sm_scout_marine.rbf (EBP) opened with Cope's RBF-Editor plugin.
Testing the changes
Having made our exciting changes we'd certainly like to see them ingame. Select Tool->Test Mod to start the game with the mod and start a new PVP match. I recommend playing against any AI enemy as you can only play with other players if they've got the exactly same mod installed and running. Let's see the changes ingame:
http://img203.imageshack.us/img203/1084/fig6.jpg (http://img203.imageshack.us/i/fig6.jpg/)
Figure 6 - Our changes ingame.
Distributing your mod
Before even thinking about distribution you should ensure that (if you have any third-party files e.g. from other mods in your mod) you own the right to publish anything shipping with your mod.
Currently there's no way to pack the mod into archives using my tool but later versions will include such a feature. If you decide to pack your mod using some other tool (like the SGA Archive GUI (http://forums.relicnews.com/showthread.php?t=233155) or Mod Packer (http://forums.relicnews.com/showthread.php?t=233145)), don't forget to add the new archives to the module file of your mod. For the start I recommend not packing your mod.
You need to distribute two things: Your mod's module file and it's folder (which can be found in the Dawn of War 2 directory). Installing your mod means putting the module file and the folder in one's Dawn of War 2 directory and using -dev -modname <your_mod's_name> as a command line parameter for Dawn of War 2. If your mod comes packed into SGA archives you don't need the -dev parameter.
Closing words
Congratulations, you've successfully created your first Dawn of War 2 modification - yet there still is a lot to learn, much more than I can cover in this tutorial. You should now try to learn about UCS as you'll certainly need it in the near future, advanced RBF-editing will come in handy as well and SCAR scripting is interesting for anyone who likes to really change the game instead of just changing some numbers.
Further Reading
Most of the other tutorials available refer to Corsix' RBFConv but are still worth reading:
Dawn of War 2 modding wiki (incomplete) (http://www.modsrus.com/wiki/doku.php?id=dow2:start) hosted by Clonesa
An Attribute Modding Guide for Beginners (http://forums.relicnews.com/showthread.php?t=233969) by Miguel
How to create your own squad and customize it (http://forums.relicnews.com/showthread.php?t=230972) by smeckma
Create new wargear for the SP campaign (http://forums.relicnews.com/showthread.php?t=219779) by Gorb
Creating Mixed-Unit Squads (http://forums.relicnews.com/showthread.php?t=217865) by Croaxleigh
Create your own mod and load it (http://forums.relicnews.com/showthread.php?t=216142) by darkelf
-cope.
Welcome to this tutorial!
I'm glad to introduce you to the fascinating world of modding Dawn of War II (including Chaos Rising). In this tutorial you will learn how to create a basic Dawn of War II modification. Our first goal is to make some simple changes: We will increase the squad size of the Space Marines' Scout squad while keeping it's original requisition cost.
This tutorial does not only aim at teaching you some basic modding skills but also at giving you some more insight into Dawn of War II and using my tool.
Getting the right tool
Since the release of Dawn of War 2 the community created a variety of tools (http://forums.relicnews.com/showthread.php?t=216965) for modding the game. Starting with Corsix' RBFConv (http://forums.relicnews.com/showthread.php?t=216883) (which still works but is somewhat more complicated to use) people modded the game, later on MartinNJ's DoW2 Mod Studio (http://forums.relicnews.com/showthread.php?t=235306) was released. This tool allowed to easily create new mods and combines multiple other tools (like the afore mentioned RBFConv). This guide will use my own tool as I'm most familiar with it. However, it's not totally perfect yet and might still crash sometimes. If you experience a crash make sure to post the log.txt from the tool's directory in the tool's thread (http://forums.relicnews.com/showthread.php?t=244248).
You can download the most recent version here (http://forums.relicnews.com/showthread.php?t=244248).
Installing and configuring the tool
Installing the tool is simple: Extract all the files from the archive you downloaded to any destination and run CopeModToolDoW2.exe. Up on the first start of the application it might ask you to specify your Dawn of War II directory. You shall then first check your options: Click on Tools->Options to open the Options dialog (Figure 1). I recommend not changing anything besides unchecking the Use Chaos Rising checkbox if you do not own Chaos Rising. You should also check that the Steam Executable path points to your steam.exe. Both of the mentioned settings are relevant for quickly starting your mod from the tool.
http://img718.imageshack.us/img718/5066/fig1t.png (http://img718.imageshack.us/i/fig1t.png/)
Figure 1 - The Options dialog.
Creating a new mod
After you've double-checked your settings we'll proceed with the next step:
Click on Start in the upper left corner of the tool and select New DoW2 Mod from the menu. You'll see a new dialog (Figure 2). First, click the Browse button and search for a file called DoW2.module which should be in your Dawn of War 2 directory. We'll get to so called module files in a second. Now enter your mod's name into the second text box. We'll just go with z_MyFirstMod this time. I like using the z_ prefix to keep all my mods grouped but you really don't need to use it at all ;).
The Displayed Mod Name, the Description and the Mod Version are optional, we will just leave them blank. Hit OK. The tool will now take some time to load all the files required to continue, this may take some time. For me it's usually a few seconds.
http://img687.imageshack.us/img687/4766/fig2v.png (http://img687.imageshack.us/i/fig2v.png/)
Figure 2 - The New DoW2 Mod dialog.
Module files and file management
Every mod for Dawn of War 2 needs a so called module file. This file should be placed in the Dawn of War 2 directory. A module file provides basic information about a mod like which files to load, what this mod is called etc.. It's essential! Module files can easily be edited with notepad or something similar.
I recommend taking a look into your module file which the tool created for you when you used the New DoW2 Mod dialog (it also created a folder with your mod's name in the Dawn of War 2 directory). It's name is just the same as the name of your mod. Having opened it you'll see different sections, the most interesting ones for us are global, attrib:common and data:common which usually is at the end of the file.
Global contains general information, it's pretty much self explanatory. Attrib:common and data:common both list archive (called SGA) files and directories. The game will normally only load the archives (using the -dev command line parameter it will also load the files from the directories). Everything from the attrib:common section contains attribute information for the game, e.g. how strong a certain unit is, in which way an ability works etc.; things listed under data:common contain data like textures, models, scripts, maps, sound-containers and similar things.
If there are duplicate files in the archives of directories the one with the highest priority is used. Files from folders always have a higher priority than those from archives and the archive (or folder) entry with the lowest index has the highest priority among archives (or folders).
For the sake of simplicity your mod shall only use one folder for the data:common section and one for the attrib:common section. My tool does not support mods with more than one directory specified (which is not really a limitation).
You might also notice that your mod has a seperate folder for attrib and data while the original DoW2.module does not. This is also a limit set by my tool which will help you to keep the overview at all times. Changing that might crash the tool, so always ensure to have a dedicated directory for attrib and data.
The user interface
By now the tool should have finished loading your newly created mod :). It's time to take a closer look at the GraphicalUserInterface (GUI, Figure 3). At the left hand side there's the Directory View, you'll notice that there's a tree view with two main nodes: ATTRIB and DATA. These nodes contain all the directories and files specified in the module file. Blue nodes represent virtual files (files from the archives) whereas red nodes represent local files.
Using the Mode Selector right above the Directory View you can switch between a virtual only tree view and a combined tree view which shows both local and virtual files. The virtual only tree view comes in handy when there's a local file with the same name and position as a virtual file and you still want to access the virtual one. Right clicking a node other than ATTRIB and DATA will open up a drop down menu using which you can extract files.
Double clicking a file from the Directory View will try to open it. If there's a suitable plugin found for the file type you're trying to open a new tab will be created in the File Application View. The content of the tab depends on the file type. You can use the buttons from the File Tab Control to close a tab or even all tabs at once.
There also is a quick way for testing your mod: Click Tools in the main menu at the upper left and select Test Mod. The tool will then start Dawn of War 2 using your mod and -dev (so the game loads all the files from the directories in addition to those from the archives). The latter one is important because you can not edit any files from the archives; as soon as you save the file the tool will extract the file and save the modified version locally.
http://img39.imageshack.us/img39/7185/fig3p.png (http://img39.imageshack.us/i/fig3p.png/)
Figure 3 - The Main GUI.
Modding the Space Marines' Scout squad
Now that you know about the basic theory and the tool it's time to get modding!
We'll need to change some attrib files in order to achieve our goals. Those files' type is usually RBF (Relic Binary File) and fortunately my tool already ships with a custom made RBF-Editor. Navigate to ATTRIB\\simulation\\attrib\\spbs\\pvp\\race_marine\\troops using the Directory View and double click sm_scout_marine.rbf to open that file (Figure 4). All the files in the SBPS folder represent SquadBluePrints[I], the [I]PVP folder indicates that the files it contains are used in PVP matches. As you can see on the right hand side of the tool, RBF files have a tree-like structure. They're basically XML files burnt to some binary format.
You'll need to change a few values in that file (marked in red in Figure 4): squad_loadout_ext contains the information about what the squad consists of, it's got an entry called unit_list which itself has an entry for every different entity in that squad. max and num of that entry control how many instances of the specified entity (type, marked in green in Figure 4) the squad starts with (num) and can have at maximum (max). Set both values to 4.
http://img294.imageshack.us/img294/6756/fig4.png (http://img294.imageshack.us/i/fig4.png/)
Figure 4 - sm_scout_marine.rbf (SBP) opened with Cope's RBF-Editor plugin.
Searching the SquadBluePrint for any way to control the squad's cost we'll notice that there is none. Prices in Dawn of War 2 are calculated dynamically, each entity stores information about it's cost and the SquadBluePrint just sums it all up. Thus we need to edit the EBP (EntityBluePrint) of the Space Marines' scout. Navigate to the EBP specified by type (green marking in Figure 4) and open it. Hit Save As RBF (marked in pink in Figure 4) and close the SBP file.
In the EBP search for cost_ext\\time_cost\\cost and set requisition to 52.5 (4 * 52.5 = 3 * 70 = 210). Save and close the file.
http://img576.imageshack.us/img576/1223/fig5.png (http://img576.imageshack.us/i/fig5.png/)
Figure 5 - sm_scout_marine.rbf (EBP) opened with Cope's RBF-Editor plugin.
Testing the changes
Having made our exciting changes we'd certainly like to see them ingame. Select Tool->Test Mod to start the game with the mod and start a new PVP match. I recommend playing against any AI enemy as you can only play with other players if they've got the exactly same mod installed and running. Let's see the changes ingame:
http://img203.imageshack.us/img203/1084/fig6.jpg (http://img203.imageshack.us/i/fig6.jpg/)
Figure 6 - Our changes ingame.
Distributing your mod
Before even thinking about distribution you should ensure that (if you have any third-party files e.g. from other mods in your mod) you own the right to publish anything shipping with your mod.
Currently there's no way to pack the mod into archives using my tool but later versions will include such a feature. If you decide to pack your mod using some other tool (like the SGA Archive GUI (http://forums.relicnews.com/showthread.php?t=233155) or Mod Packer (http://forums.relicnews.com/showthread.php?t=233145)), don't forget to add the new archives to the module file of your mod. For the start I recommend not packing your mod.
You need to distribute two things: Your mod's module file and it's folder (which can be found in the Dawn of War 2 directory). Installing your mod means putting the module file and the folder in one's Dawn of War 2 directory and using -dev -modname <your_mod's_name> as a command line parameter for Dawn of War 2. If your mod comes packed into SGA archives you don't need the -dev parameter.
Closing words
Congratulations, you've successfully created your first Dawn of War 2 modification - yet there still is a lot to learn, much more than I can cover in this tutorial. You should now try to learn about UCS as you'll certainly need it in the near future, advanced RBF-editing will come in handy as well and SCAR scripting is interesting for anyone who likes to really change the game instead of just changing some numbers.
Further Reading
Most of the other tutorials available refer to Corsix' RBFConv but are still worth reading:
Dawn of War 2 modding wiki (incomplete) (http://www.modsrus.com/wiki/doku.php?id=dow2:start) hosted by Clonesa
An Attribute Modding Guide for Beginners (http://forums.relicnews.com/showthread.php?t=233969) by Miguel
How to create your own squad and customize it (http://forums.relicnews.com/showthread.php?t=230972) by smeckma
Create new wargear for the SP campaign (http://forums.relicnews.com/showthread.php?t=219779) by Gorb
Creating Mixed-Unit Squads (http://forums.relicnews.com/showthread.php?t=217865) by Croaxleigh
Create your own mod and load it (http://forums.relicnews.com/showthread.php?t=216142) by darkelf
-cope.