[Modding] Creating my first scenario
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Part 2
Now in Blender make sure your model exist of a single MESH. You can select all meshes (or all different objects simply with shift click) and JOIN them together.
You can also GROUP them if you want your model to exist of different meshes but you have to make sure you name your GROUP like this:
merge.Group001 (to export it correctly).
Make sure in OBJECT mode everything is set to default Blender values:
Make sure when your SCALE your model you set Object Mode to Edit Mode.
Make sure the TEXTURE you will use is already in the same folder as your model or where you export your model to and make sure it's using the SAME NAME everywhere (for exporting reasons):
If you setup the exporter correctly as described in Part 1 of this guide you can now EXPORT your model to a OGRE mesh file. The format Aggressors work with.
Now in Blender make sure your model exist of a single MESH. You can select all meshes (or all different objects simply with shift click) and JOIN them together.
You can also GROUP them if you want your model to exist of different meshes but you have to make sure you name your GROUP like this:
merge.Group001 (to export it correctly).
Make sure in OBJECT mode everything is set to default Blender values:
Make sure when your SCALE your model you set Object Mode to Edit Mode.
Make sure the TEXTURE you will use is already in the same folder as your model or where you export your model to and make sure it's using the SAME NAME everywhere (for exporting reasons):
If you setup the exporter correctly as described in Part 1 of this guide you can now EXPORT your model to a OGRE mesh file. The format Aggressors work with.
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
There are now 3 files created. The MESH (XML file actually) is the most important one and contains texture coordinate and model information. You can open this is Visual Studio or Notepad++ to edit the texture eventually.
Copy the mesh file just created and paste it in the Command Tools directory where your OgreXMLConverter is located.
Grab the mesh (XML) file and mouse over the OgreXMLConverter.
It will create the actual MESH file Aggressors can work with.
The next step in chapter 3 is to bring the actual model into Aggressors.
Copy the mesh file just created and paste it in the Command Tools directory where your OgreXMLConverter is located.
Grab the mesh (XML) file and mouse over the OgreXMLConverter.
It will create the actual MESH file Aggressors can work with.
The next step in chapter 3 is to bring the actual model into Aggressors.
Re: [Modding] Creating my first scenario
Just great Cablenexus, thanks for the very valuable infos !
I got a question besides graphics. So you made in your mod fish as a resource and fishnet as terrain extension right? Do you know if its possible to have an effect on terrain through buildings as like through cities as well? At least buildings can affect other static units(buildings) on the map, as blacksmiths do with mines. If its possible, would it even work on a range of terrain tiles next to the building? Say you got a shipyard and build a shipyard improvement 'small Fishermans village' or somthing like that with a range of 1 hex with only water tiles are affected and food increases on these tiles? Its not that i think of alternatives of your way modding resources and terrain extensions, but i got an idea for my scenario/mod which may possible if all static units inherit this functionality. Ahh i need to read more the scripting files...
I got a question besides graphics. So you made in your mod fish as a resource and fishnet as terrain extension right? Do you know if its possible to have an effect on terrain through buildings as like through cities as well? At least buildings can affect other static units(buildings) on the map, as blacksmiths do with mines. If its possible, would it even work on a range of terrain tiles next to the building? Say you got a shipyard and build a shipyard improvement 'small Fishermans village' or somthing like that with a range of 1 hex with only water tiles are affected and food increases on these tiles? Its not that i think of alternatives of your way modding resources and terrain extensions, but i got an idea for my scenario/mod which may possible if all static units inherit this functionality. Ahh i need to read more the scripting files...
Re: [Modding] Creating my first scenario
It is very helpful indeed. I hope that Cablenexus's guide will encourage other modders to give it a try:)
In case you actually have a specific idea of what would you like to implement, just drop it in here and I will try to answer if it is possible and what is the easiest way (because usually there are number of different ways how to implement it).Chris36 wrote: ↑Thu Aug 16, 2018 11:53 pmDo you know if its possible to have an effect on terrain through buildings as like through cities as well? At least buildings can affect other static units(buildings) on the map, as blacksmiths do with mines. If its possible, would it even work on a range of terrain tiles next to the building? Say you got a shipyard and build a shipyard improvement 'small Fishermans village' or somthing like that with a range of 1 hex with only water tiles are affected and food increases on these tiles? Its not that i think of alternatives of your way modding resources and terrain extensions, but i got an idea for my scenario/mod which may possible if all static units inherit this functionality
In your specific example, you would do four things:
- Create new improvement and allow it for shipyards (this all can be done in mod.ag file).
- Create your improvement icon and picture.
- You add your own UnitExtensionBehavior in your own UnitBeheaviors.cs file (and set the right scripting name in the mod.ag).
- You override GetProduction method. In there you check the neighbourhood, find how many water tiles are around and multiply it by the yield of the tile (which you can specificy in the UnitBehaviorMemento properties in mod.ag (look for parameters->production->products->ProductMemento).
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
MOD Prototyping Essentials
The first steps:
(What I wish I knew before I started modding)
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:
https://visualstudio.microsoft.com/than ... ity&rel=15
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).
https://notepad-plus-plus.org/download/v7.5.8.html
Make sure if you use Notepad++ anyway, you download the XML tools plugin for it:
https://sourceforge.net/projects/npp-pl ... L%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.
https://www.getpaint.net/download.html
https://www.gimp.org/
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:
https://x-diesel.com/
https://www.ghisler.com/
The first steps:
(What I wish I knew before I started modding)
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:
https://visualstudio.microsoft.com/than ... ity&rel=15
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).
https://notepad-plus-plus.org/download/v7.5.8.html
Make sure if you use Notepad++ anyway, you download the XML tools plugin for it:
https://sourceforge.net/projects/npp-pl ... L%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.
https://www.getpaint.net/download.html
https://www.gimp.org/
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:
https://x-diesel.com/
https://www.ghisler.com/
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
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:
https://www.youtube.com/watch?v=OaGg_8YGGpM
The game itself is actually a MOD on it's own. The Ancient_Rome directory:
c:\SteamLibrary\steamapps\common\Aggressors Ancient Rome\Bin\Mods
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:
https://www.youtube.com/watch?v=OaGg_8YGGpM
The game itself is actually a MOD on it's own. The Ancient_Rome directory:
c:\SteamLibrary\steamapps\common\Aggressors Ancient Rome\Bin\Mods
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:
Last edited by Cablenexus on Fri Aug 17, 2018 11:23 am, edited 2 times in total.
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
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:\SteamLibrary\steamapps\common\Aggressors Ancient Rome\Bin\Mods\ancient_rome_modprototyping
Your mod directory should now look like this:
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:\SteamLibrary\steamapps\common\Aggressors Ancient Rome\Bin\Mods\ancient_rome_modprototyping
Your mod directory should now look like this:
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
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:\SteamLibrary\steamapps\common\Aggressors Ancient Rome\Bin\Mods\ancient_rome-modprototyping
Your mod directory should now look like this:
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 Studio\2017\Community" 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:
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:\SteamLibrary\steamapps\common\Aggressors Ancient Rome\Bin\Mods\ancient_rome-modprototyping
Your mod directory should now look like this:
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 Studio\2017\Community" 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:
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Now expand the resources category.
For me the easiest way is to copy the whole category at once as shown in the picture:
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:
For me the easiest way is to copy the whole category at once as shown in the picture:
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:
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
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:
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!
Inside we have to put our 160 x 160 .png file (Resources-Prototype.png) we can create simple in the image editor:
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!
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
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:
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:
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Some notes that maybe have to be mentioned in the guide:
- Always make sure you have the right way of writing into your mod file (and actually all script files)
You cannot add just a resource in the empty mod. You always have to write the definition right:
WRONG:
<resources>
<GameResourceMemento id="12" name="Resources.Cowhide" bitmapFile="Resources-Cowhide.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" />
<GameResourceMemento id="13" name="Resources.Fish" bitmapFile="Resources-Fish.png" attributes="15" scripting="DefaultResourceBehavior" gameResourceType="0" expirationPercentage="0" notAllowedResourcePanelAttributes="0" horizontalIndex="1" verticalIndex="1" lowerScaleDescription="Texts.MapScaleMoreConsumption" averageScaleDescription="Texts.MapScaleAverageProduction" highestScaleDescription="Texts.MapScaleMoreProduction" resourceText="Texts.ResourceValue" />
</resources>
</resources>
RIGHT:
<resources> (see this one is missing in the wrong one)
<resources>
<GameResourceMemento id="12" name="Resources.Cowhide" bitmapFile="Resources-Cowhide.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" />
<GameResourceMemento id="13" name="Resources.Fish" bitmapFile="Resources-Fish.png" attributes="15" scripting="DefaultResourceBehavior" gameResourceType="0" expirationPercentage="0" notAllowedResourcePanelAttributes="0" horizontalIndex="1" verticalIndex="1" lowerScaleDescription="Texts.MapScaleMoreConsumption" averageScaleDescription="Texts.MapScaleAverageProduction" highestScaleDescription="Texts.MapScaleMoreProduction" resourceText="Texts.ResourceValue" />
</resources>
</resources>
- Make sure B/W images are saved as 24 or 32 bit images in .PNG format if you use any. Otherwise you will not be able to use an indexed file.
- Always use the original MOD and SCENARIO file to view parts, copy parts. It's the best HELP document available.
- Make sure you make a BACKUP (I simply name the samefile_backup) from the last working version.
- Learn to work with Visual Studio. It's very helpfull to be able to expand and minimize the definitions. Also use the FIND or SEARCH function a lot.
- Make notes in your own edit file about everything you do and how you did it. For yourself and others.
- Always make sure you have the right way of writing into your mod file (and actually all script files)
You cannot add just a resource in the empty mod. You always have to write the definition right:
WRONG:
<resources>
<GameResourceMemento id="12" name="Resources.Cowhide" bitmapFile="Resources-Cowhide.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" />
<GameResourceMemento id="13" name="Resources.Fish" bitmapFile="Resources-Fish.png" attributes="15" scripting="DefaultResourceBehavior" gameResourceType="0" expirationPercentage="0" notAllowedResourcePanelAttributes="0" horizontalIndex="1" verticalIndex="1" lowerScaleDescription="Texts.MapScaleMoreConsumption" averageScaleDescription="Texts.MapScaleAverageProduction" highestScaleDescription="Texts.MapScaleMoreProduction" resourceText="Texts.ResourceValue" />
</resources>
</resources>
RIGHT:
<resources> (see this one is missing in the wrong one)
<resources>
<GameResourceMemento id="12" name="Resources.Cowhide" bitmapFile="Resources-Cowhide.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" />
<GameResourceMemento id="13" name="Resources.Fish" bitmapFile="Resources-Fish.png" attributes="15" scripting="DefaultResourceBehavior" gameResourceType="0" expirationPercentage="0" notAllowedResourcePanelAttributes="0" horizontalIndex="1" verticalIndex="1" lowerScaleDescription="Texts.MapScaleMoreConsumption" averageScaleDescription="Texts.MapScaleAverageProduction" highestScaleDescription="Texts.MapScaleMoreProduction" resourceText="Texts.ResourceValue" />
</resources>
</resources>
- Make sure B/W images are saved as 24 or 32 bit images in .PNG format if you use any. Otherwise you will not be able to use an indexed file.
- Always use the original MOD and SCENARIO file to view parts, copy parts. It's the best HELP document available.
- Make sure you make a BACKUP (I simply name the samefile_backup) from the last working version.
- Learn to work with Visual Studio. It's very helpfull to be able to expand and minimize the definitions. Also use the FIND or SEARCH function a lot.
- Make notes in your own edit file about everything you do and how you did it. For yourself and others.
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
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:
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:
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Both the first steps into 3D models and the first steps into MOD Prototyping are now available in Steam Guide section for Aggressors as well.
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
This morning I used to transfer the old script for Extra resources for Roman Player to the new way of handling Move Events and Game Actions.
The change is discussed here:
aggressors-game.com/download/SimpleGameActionsMoveEvent.docx
A very useful read if you want to implement event driven game actions per x amount of turns for example.
The event now gives an amount of Stones and Wood every 4 turns (that represents 1 year in my mod).
It also shows the event to the player every 4 turns and it is added to the messages on the left side.
The reason to change is that it works now without any scripting.
Resource text file:
<data name="Texts.SimpleGameActionMoveEventReportTitle" xml:space="preserve">
<value>Extra resources for Romans</value>
</data>
<data name="Texts.SimpleGameActionMoveEventReport" xml:space="preserve">
<value>[MainImage:wood.png] An amount of stones and wood will be send to you every autumn.{newline} Mainly to support the costs of your forts.{newline}{newline} {0}</value>
</data>
<data name="GameAction.AddPlayerResourcesGameActionSuccess" xml:space="preserve">
<value>Resources received from Roman Empire every year (every 4 turns): {1}</value>
</data>
Scenario file added moveevent:
<MoveEventMemento type="SimpleGameActionsMoveEvent" id="13" probability="1" isRandomEvent="false" playerIds="1" executedResourceText="Texts.SimpleGameActionMoveEventReport" executedResourceTitle="Texts.SimpleGameActionMoveEventReportTitle">
<properties>
<doubles>
<SerializableStringDoublePair key="everyXTurns" value="4" />
</doubles>
</properties>
<gameActions>
<gameActions>
<GameActionMemento id="1" type="AddPlayerResourcesGameAction" achievedResourceText="GameAction.AddPlayerResourcesGameActionSuccess">
<properties>
<bools>
<SerializableStringBooleanPair key="isRelativePercentagesPerPlayerResources" value="false" />
</bools>
<strings>
<SerializableStringStringPair key="percentageRange" value="rand(70-130)" />
</strings>
<!--<doubles>
<SerializableStringDoublePair key="min-3" value="1" />
<SerializableStringDoublePair key="max-3" value="10" />
</doubles>-->
<resources>
<SerializableStringPlayerResourceCollectionPair key="resources">
<value>
<resources>
<PlayerResourceMemento id="3" value="100" />
<PlayerResourceMemento id="6" value="100" />
</resources>
</value>
</SerializableStringPlayerResourceCollectionPair>
</resources>
</properties>
</GameActionMemento>
</gameActions>
</gameActions>
</MoveEventMemento>
</moveEvents>
</moveEvents>
Ingame:
The change is discussed here:
aggressors-game.com/download/SimpleGameActionsMoveEvent.docx
A very useful read if you want to implement event driven game actions per x amount of turns for example.
The event now gives an amount of Stones and Wood every 4 turns (that represents 1 year in my mod).
It also shows the event to the player every 4 turns and it is added to the messages on the left side.
The reason to change is that it works now without any scripting.
Resource text file:
<data name="Texts.SimpleGameActionMoveEventReportTitle" xml:space="preserve">
<value>Extra resources for Romans</value>
</data>
<data name="Texts.SimpleGameActionMoveEventReport" xml:space="preserve">
<value>[MainImage:wood.png] An amount of stones and wood will be send to you every autumn.{newline} Mainly to support the costs of your forts.{newline}{newline} {0}</value>
</data>
<data name="GameAction.AddPlayerResourcesGameActionSuccess" xml:space="preserve">
<value>Resources received from Roman Empire every year (every 4 turns): {1}</value>
</data>
Scenario file added moveevent:
<MoveEventMemento type="SimpleGameActionsMoveEvent" id="13" probability="1" isRandomEvent="false" playerIds="1" executedResourceText="Texts.SimpleGameActionMoveEventReport" executedResourceTitle="Texts.SimpleGameActionMoveEventReportTitle">
<properties>
<doubles>
<SerializableStringDoublePair key="everyXTurns" value="4" />
</doubles>
</properties>
<gameActions>
<gameActions>
<GameActionMemento id="1" type="AddPlayerResourcesGameAction" achievedResourceText="GameAction.AddPlayerResourcesGameActionSuccess">
<properties>
<bools>
<SerializableStringBooleanPair key="isRelativePercentagesPerPlayerResources" value="false" />
</bools>
<strings>
<SerializableStringStringPair key="percentageRange" value="rand(70-130)" />
</strings>
<!--<doubles>
<SerializableStringDoublePair key="min-3" value="1" />
<SerializableStringDoublePair key="max-3" value="10" />
</doubles>-->
<resources>
<SerializableStringPlayerResourceCollectionPair key="resources">
<value>
<resources>
<PlayerResourceMemento id="3" value="100" />
<PlayerResourceMemento id="6" value="100" />
</resources>
</value>
</SerializableStringPlayerResourceCollectionPair>
</resources>
</properties>
</GameActionMemento>
</gameActions>
</gameActions>
</MoveEventMemento>
</moveEvents>
</moveEvents>
Ingame:
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
The Holland scenario is updated to a new version and the folder is not named to the version anymore.
It's called Battle over Rhenus now.
The Holland scenario is removed from Steam.
Please download the new scenario.
PM me as always for a non Steam version mod.
It's called Battle over Rhenus now.
The Holland scenario is removed from Steam.
Please download the new scenario.
PM me as always for a non Steam version mod.
Re: [Modding] Creating my first scenario
I will definitely download the updated Rhenus mod/scenario. Is there any particular faction you may not have tested a lot, that you would like to have us try?
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
Actually all factions except Frisii and Roman Empire.
But feel free to play with them as well.
The new version has a lot of minor tweaks. There is no balancing yet for the other tribes.
So all feedback about all other tribes is very welcome. I see how much time is left before thursday.
Otherwise changes will be made in future versions.
The mod is really not fisnished yet.
Re: [Modding] Creating my first scenario
Started 3 times with the Chauci on medium difficulty. They end up desperate for food. I had my settler making fields every turn, birth subsidy to 0%, and by turn 4-5 most of my forces have deserted due to lack of food, cities rebelling.
I suggest:
1) give the Chauci more fields to start with, at least barely enough to sustain itself;
2) perhaps take away the Elite Axeman that eats up one food every turn, although that would be a drastic adjustment.
I suggest:
1) give the Chauci more fields to start with, at least barely enough to sustain itself;
2) perhaps take away the Elite Axeman that eats up one food every turn, although that would be a drastic adjustment.
-
- Sr. Colonel - Battleship
- Posts: 1691
- Joined: Mon Jan 04, 2016 7:09 pm
Re: [Modding] Creating my first scenario
I made some changes earlier, but I will look into it.gwgardner wrote: ↑Sun Aug 26, 2018 6:50 pm Started 3 times with the Chauci on medium difficulty. They end up desperate for food. I had my settler making fields every turn, birth subsidy to 0%, and by turn 4-5 most of my forces have deserted due to lack of food, cities rebelling.
I suggest:
1) give the Chauci more fields to start with, at least barely enough to sustain itself;
2) perhaps take away the Elite Axeman that eats up one food every turn, although that would be a drastic adjustment.
Changes I made so far are some units received a economic unit ability.
I builded some starting farms/fields already.
You can make a great deal with trading when you have enough other resources.
Thank you for the report and for playing. I will look into it.
If you have time I like to hear other tribe situations.
There are probably issues with the fish ability not working because there is an issue in Steam version script.
Did you notice any troubles besides the food shortage?