Overview
The first steps into Prototype modding.(What I wish I knew before I started modding)
Setting up your modding tools
First make sure you have installed a set of tools to make modding in Aggressors easier.
If you plan to go into scripting, make sure you install any Visual Studio environment:
[link]You can also use your own favorite XML editor or Notepad++ (But it’s not recommended for scripting since you can’t use the Aggressors SDK in there).
[link]Make sure if you use Notepad++ anyway, you download the XML tools plugin for it:
https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/
Common file extensions to open with VS (Visual Studio) are:
.AG (mod and scenario file) and .CS (script file)
Install a paint program to edit your custom flags, tribes and UI elements eventually.
Paint.net and GIMP are both free alternatives for Photoshop.
Common file extensions to open with Paint.net are:
.png (mostly textures and UI elements) and .jpeg (library pictures and ingame grpahics etc).
Most of the other files you can simply open in any of the editors that can read XML files.
If you start modding Aggressors, one of the most important parts is to organize your work flow and environment. Some tools to help you with file management and also to compare original script files with your own files are Total Commander or Unreal Commander:
[link] [link]The first steps
A very good video tutorial that is a MUST to watch before you get into modding will answer a lot of your questions at forehand. It’s made by the developer himself:
NOTE: One important change is made since the video. The mod.ag and scenario.ag always are called “mod.ag” and “scenario.ag”. Don’t rename them inside your scenario or mod folder.
The game itself is actually a MOD on it’s own. The Ancient_Rome directory:
c:SteamLibrarysteamappscommonAggressors Ancient RomeBinMods
actually has all the files you need for modding.
!But you don’t EDIT the files in this folder. NEVER!
You actually make your own MOD files from scratch in a new folder in Mods and inside you keep the same file and folder structure as in the original mod. That is named MOD prototyping.
You populate your own files with ONLY the changes you make.
For example you only want to ADD an extra resource you don’t need to copy the whole resource folder with icons and the whole mod and script file from the original mod. You create your own.
In the original mod file you find (and this you have to know by experience) all files related to the extra resource. In our case that is the mod.ag file, the scenario.ag file and the image to show the UI element for the new resource.
You create your new mod folder “ancient_rome_modprototyping” in the BIN folder where the original mod folder is located. You use ancient_rome in the name of the folder since this is the MOD file you use as the prototype.
It should look like this and ancient_rome_modprototyping is an empty folder.
Now you COPY and PASTE the original image that contains the UI resources from the Ancient Rome mod to your new mod since we are going to change this file (keep in mind, this is only for images. For XML files we do not copy the whole SC and AG file, but just parts of it to our own SC and AG files).
We are going to add the image of our new PROTOTYPE resource now.
Your directory should now look like this:
Creating a Resource
Open the gameResources.png file in your image editor.
Imagine (or create a raster layer) a raster with coordinates. (there are 10 images, the first is always 0, the file is 512 pixels width. 10 : 512 = 51.2 is the size of the raster).
We place our new Prototype resource at location horizontal 0 and vertical 1 like in the following image:
You save the file (same name and .png) and you have your own custom image in your mod folder added to the resources.
We now have to ADD the resource to our MOD AG file.
But since we do not have a MOD AG file yet, we have to create our own.
Create a new XML document in either Visual Studio or Notepad++ and name it mod.ag
Inside it’s empty, except the parts we change in the mod and the first few lines of the original mod file where we also set the name of our mod.
Now save the file as mod.ag inside your MOD directory
c:SteamLibrarysteamappscommonAggressors Ancient RomeBinModsancient_rome_modprototyping
Your mod directory should now look like this:
Using the prototype mod
Now in the original mod we have to find how resources are threated and how to activate them in our own mod.
First we need to make sure Visual Studio can handle XML files >10 MB.
To do this in VS 2017 Community first find the Developer Command prompt in Windows search:
Run it as administrator and type (or copy paste) the following line:
VsRegEdit set “C:Program Files (x86)Microsoft Visual Studio2017Community” HKLM XmlEditor MaxFileSizeSupportedByLanguageService string 250
If you use Enterprise or any other version make sure you use “Enterprise” instead of Community.
The max file size for XML files in VS2017 now is 250 MB
If we open the original mod file in Visual Studio we can minimize all the XML code to get a clear overview of categories like this:
Now expand the resources category.
For me the easiest way is to copy the whole category at once as shown in the picture:
Using the prototype mod part II
When we paste it in our own mod we will delete the existing resources (since they are already in the prototype mod we don’t need them) but we can use one of them as an example and what is VERY IMPORTANT is that in the mod file we have always the right categories specified.
<resources> (those are important!)
<resources> (those are important!)
HERE COMES YOUR CONTENT
</resources> (those are important!)
</resources> (those are important!)
When you paste the content in your own mod file and delete all resources except one, we have one we can modify to our liking as an example.
For example:
We can change all kind of values now in our mod file for the new resource type:
ORIGINAL LINE:
<GameResourceMemento id=”1″ name=”Resources.Gold” bitmapFile=”Resources-Gold.png” attributes=”15″ scripting=”DefaultResourceBehavior” gameResourceType=”0″ expirationPercentage=”0″ notAllowedResourcePanelAttributes=”0″ horizontalIndex=”0″ verticalIndex=”0″ lowerScaleDescription=”Texts.MapScaleMoreConsumption” averageScaleDescription=”Texts.MapScaleAverageProduction” highestScaleDescription=”Texts.MapScaleMoreProduction” resourceText=”Texts.ResourceValue” />
MODIFIED LINE:
<GameResourceMemento id=”12″ name=”Resources.Prototype” bitmapFile=”Resources-Prototype.png” attributes=”15″ scripting=”DefaultResourceBehavior” gameResourceType=”0″ expirationPercentage=”0″ notAllowedResourcePanelAttributes=”0″ horizontalIndex=”0″ verticalIndex=”1″ lowerScaleDescription=”Texts.MapScaleMoreConsumption” averageScaleDescription=”Texts.MapScaleAverageProduction” highestScaleDescription=”Texts.MapScaleMoreProduction” resourceText=”Texts.ResourceValue” />
As you can see we named our resource ID=12, we named it Prototype, we have to create the Prototype bitmap we link to and not to forget the vertical index for the image we set to 1 now (we use the first image in the resource table we created).
Your mod file now looks like this:
Now we have to create one more folder in our mod directory named Resources:
Inside we have to put our 160 x 160 .png file (Resources-Prototype.png) we can create simple in the image editor:
Adding names to our resources and tooltips
We practically finished our first mod. We can load the prototype mod we just created and start a generated map and you will see your resource in game!
As you can see your new resource is not named correctly and there are no entry texts for the hints, mouseovers, library etc.
This time we make a new folder in our mod directory called ResourceTexts and inside we make a new XML file called ResourceTexts. When we save this file we give it the .RESX extension.
Make sure that you start with an empty file as you did with the mod, but make sure you copy the header files from the original ResourceTexts.resx file.
So you actually copy EVERYTHING between:
<?xml version=”1.0″ encoding=”utf-8″?>
<root>
<!–
Microsoft ResX Schema
And this:
</resheader>
<resheader name=”writer”>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
And his has to end with this:
</root>
The datafiles itself are the only ones you add for your mod. It contains all the info and texts as you want them to displayed in the game:
Your ResourceTexts.resx file looks somewhat like this now:
And in the game the library has a correct entry now:
Make our new resource of use
Now there are of course multiple ways how to use such resources in the game. It’s actually unlimited since you can write your own scripts as well.
Most common resource is added by a mine or a terrain tile. But also Happiness and Citizens are resources so there mechanism is different.
Let’s make our first step to make our resource at use and simply add the resource to a terrain tile.
Let’s make the mountains on the map produce the Prototype resource when in range of a city.
First we have to find the terrain extension in the original mod.
Now again the VERY IMPORTANT step to have the right ELEMENT in your mod file.
So you copy the whole TerrainPropertiesMemento for mountain but must not forget to place it in the right element:
<terrainAttributes>
<terrainProperties>
<terrainProperties>
<TerrainPropertiesMemento id=
</TerrainPropertiesMemento>
</terrainProperties>
</terrainProperties>
</terrainAttributes>
You add the terrain properties memento for MOUNTAIN to your mod between those elements.
Now you can also add the extra lines to let the mountain tile procude our new resource. You can set your own parameters. For example if the resource is given every turn and what the amount is.
<production>
<products>
<ProductMemento id=”12″ perTurns=”1″ value=”2.7″ />
</products>
</production>
your mod file now should look like this:
And the end of the mod file like this:
This will be the result in the game. Every mountain give 2.7 resources every turn if in range of a city:
Empty Faction
<PlayerMemento id=”1″ name=”EMPTY001″ realName=”EMPTY001″ isTerminated=”1″ playerType=”0″ playerJoinType=”1″ playerParameters=”0″ color=”-1″ aiDifficulty=”1″ holdOffResearchPrompt=”false” inBuild=”0″ administrationId=”1″ currentlyResearchedTechnologyId=”0″ canBeReplaced=”false” notifyServerAboutSelectedUnit=”false” notifyServerAboutDeselectedUnit=”false” canBeClosed=”true” politicalMasterId=”0″ economicalMasterId=”0″ sizeIncreaseGrant=”0″ moralStability=”1″ willingnessOfSubordination=”1″ loyaltyIncrease=”0.0333″ minLoyalty=”0″ moralStabilization=”1.1″>
<aiSettings algorithmId=”2″ />
<resources>
<resources>
<PlayerResourceMemento id=”1″ />
<PlayerResourceMemento id=”2″ />
<PlayerResourceMemento id=”3″ />
<PlayerResourceMemento id=”4″ />
<PlayerResourceMemento id=”5″ />
<PlayerResourceMemento id=”6″ />
<PlayerResourceMemento id=”8″ />
<PlayerResourceMemento id=”9″ />
<PlayerResourceMemento id=”10″ />
<PlayerResourceMemento id=”11″ />
</resources>
</resources>
<technologies>
<technologies>
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”1″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”2″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”3″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”4″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”5″ />
<PlayerTechnologyMemento timeLeft=”5″ technologyId=”6″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”7″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”8″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”9″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”10″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”11″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”12″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”13″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”14″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”15″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”16″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”17″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”18″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”19″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”20″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”21″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”22″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”23″ />
<PlayerTechnologyMemento timeLeft=”5″ technologyId=”24″ />
<PlayerTechnologyMemento timeLeft=”4″ technologyId=”25″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”26″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”27″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”28″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”29″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”30″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”31″ />
<PlayerTechnologyMemento timeLeft=”5″ technologyId=”32″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”33″ />
<PlayerTechnologyMemento timeLeft=”4″ technologyId=”34″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”35″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”36″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”37″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”38″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”39″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”40″ />
<PlayerTechnologyMemento timeLeft=”4″ technologyId=”41″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”42″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”43″ />
<PlayerTechnologyMemento timeLeft=”10″ technologyId=”44″ />
<PlayerTechnologyMemento timeLeft=”5″ technologyId=”45″ />
<PlayerTechnologyMemento timeLeft=”8″ technologyId=”46″ />
<PlayerTechnologyMemento timeLeft=”5″ technologyId=”47″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”48″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”49″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”50″ />
<PlayerTechnologyMemento timeLeft=”5″ technologyId=”51″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”52″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”53″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”54″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”55″ />
<PlayerTechnologyMemento timeLeft=”9″ technologyId=”56″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”57″ />
<PlayerTechnologyMemento timeLeft=”6″ technologyId=”58″ />
<PlayerTechnologyMemento timeLeft=”4″ technologyId=”59″ />
<PlayerTechnologyMemento timeLeft=”7″ technologyId=”60″ />
<PlayerTechnologyMemento timeLeft=”4″ technologyId=”61″ />
</technologies>
</technologies>
<playerArmyMoral playerArmyMoralCoefficient=”1″ additionalCoefficient=”0.01″ />
<relations />
<futureRelations />
<reports />
<playerChartVisibility playerId=”1″>
<visibility>
</visibility>
</playerChartVisibility>
<myOwnChartVisibility playerId=”1″>
<visibility>
</visibility>
</myOwnChartVisibility>
<playerAttitudeMap minValue=”0″ maxValue=”0″ defaultMoral=”0″ resourceSufficiencyImpact=”0″ militarySizeImpact=”0″ attitudeChange=”0″ militarySizeImpactAdditionalInfo=”0″ />
</PlayerMemento>