This is the first of a series of tutorials i will make about modding Supreme Ruler games.
What is today possible to create a new country ?
- to modify an existing country from a scenario,
- to create a new country merging existing "painted" country on map (aka grouping existing countries in the .cvp file),
- to adjust modded countries owned territory through event by transferring hex or loyalty between them.
- to use the old war declaration trick described by Fistalis there http://www.bgforums.com/forums/viewtopi ... 39#p165792 which is out of date for SRU.
- to create new country, "painting" it with map editor discovered since SRGW release (will not be explained in this tutorial, and only works for SRGW/SRU http://www.bgforums.com/forums/viewtopi ... 87&t=25941).
But what if you want to create any new country with the territory you want? And having that custom territory loyal to you?
As of today most people will tell you it is not possible (well exept with map editor i guess^^).
Indeed you cant just simply create a country to your .cvp file and .REGIONINCL, make it alive through events, and transferring hex and loyalty from another country. The game wont do it.
- You will know here how to use a quick trick to create any country from scratch, zero territory, and editing map through events to assign hex and loyalty zones to your country, no hair loss or swearing at the game engine
- You will be able to keep all the current countries of a scenario, and have up to a total 255 countries (total playable + colonies) in SRGW, SRU, SR1936 or SRCW.
This tutorial details the process for SRGW and SRU, i havent tested yet for SR 1936 and Cold War but the events used here are also available in those games so it should work the same.
Some glossary about files:
.scenario : .scenario file is the main entry for the game. It tells what ressources are needed for your mod, all others files listed under are called in here. For a sandbox game it is located in the /Sandbox/ directory. The name of the file defines the name for the scenario in the list of available sandbox games.
.cvp : .cvp file is the regionnal data file, listing all countries for a mod, available or not for that mod. It is located in /MAPS/ directory, ie SR1936.cvp, SR1914.cvp and so on.
.REGIONINCL : .REGIONINCL file is listing all countries present in your mod (playable and colonies, also dead countries used in scenario), which refers to the IDs of countries in the .cvp file. You can have a maximum of 255 countries listed in the .REGIONINCL for your scenario (dead and active countries). The file is located in /MAPS/ directory, named after vanilla scenario or your own scenario.
.OOF : .OOF file lists all hex on map that have towns, complex and so on. It is located in /MAPS/ directory.
.csv : .csv file is where most all the stuff are done. It lists all events in the course of the game, diplomatic relations set at game start, optionnal parameters for countries... It is located in the /Sandbox/ folder.
For quick editing of events i recommend the use of this wonderfull tool by xwerswoodx, Scripted Events Creator & Editor tool, especially when transfering multiple hex between countries :
http://www.bgforums.com/forums/viewtopi ... ry#p175398
SR modding wiki :
https://supremeruler.gamepedia.com/Supreme_Ruler_Wiki
Official list of regions in Supreme Ruler :
https://supremeruler.gamepedia.com/REGIONINCL
How to create game cache for a mod :
https://supremeruler.gamepedia.com/Creating_a_Cache
Let's make French India colony
Say i want to create French India in 1914 scenario (lets anticipate SRGW as a DLC for SRU^^), or in SRU-1936 scenario. French India is a french colony with tiny pockets of land in India as you can see in the screenshot under.
https://en.wikipedia.org/wiki/French_India
Download tutorial files + cache here :
SRGW 1914 version :
https://nofile.io/f/s2C8REOw5h0/Tutoria ... W+1914.zip
SRU 1936 version :
https://nofile.io/f/2tVsuFdMYga/Tutoria ... U+1936.zip
Note that for 1936, since the limit of 255 countries is reached in .REGIONINCL i had to merge Reunion (419) with France (1689) to free one country slot.
The goal :
We want to add a new country with no territory then design a custom territory for our country with full hex loyalty, not using pre-designed countries territory on map (not using any "painted" territory).
As mentionned above we can modify an existing country to achieve this or we can merge existing countries or modify ownership/loyalty of hex.
But none of the existing countries in the .cvp file will suit what we want to do, and the method used by Fistalis before is now out of date.
Also we cant simply create a country in .cvp file and .REGIONINCL, making it alive and giving it lands and loyalty through events. The game wont allow it.
So this is the trick : to use game engine our way to make our country alive using an existing "painted" country, but forcing it to have zero land/loyalty inherited from that pre-designed country, and then assign some land of our choice and loyalty control for that land of ours.
We will "assign" (group) to our new country the territory of any unused country from our .cvp file. This is already known to modders when they want to modify a country using an existing pre-designed territory on map.
But we can also assign it any subgroup countries of existing countries in the scenario.
So here in this example it can be Texas (not present in SRU-1936 or SR1914 scenarios), or West India (sub-country of India in SR1914 and SRU-1936). In this tutorial i will show for both what happens.
If we start the game, French India is now either West India (Bengal + Andaman islands), or Texas depending on what we chose, but that is not at all what we want for our country.
The real trick is that we will then transfer all loyalty hex from our new country back to its previous ingame owner on map (that is India or USA here, Texas is part of USA), then we will surrender our country hence all our territory to its original scenario owner through events thanks to the loyalty shift we just did before (still India or USA).
So now we have vanilla India or USA back to normal, all land and loyalty matching what it was before our modifications. And our new country is dead. Cool
Then using events we will make French India alive again, obviously it will have no land of its own. But this new French India country now exists for the game and is ready to be assigned custom territory and loyalty zone through events, which will be explained also.
And all this requires only 3 lines of events, before assigning new territory
Like this you can reach the maximum limit of 255 countries for your mod, providing there is enough unused country or subgroup countries in the .cvp.
It is still not clear? I know So just read the tutorial, it will become cristal
Step by step guide
Creating our scenario file
Let's assume we already created a new .scenario file in our /Sandbox/ folder, cloning the content of SR1936.scenario or The Great War - 1914.scenario.
For this turorial lets name it "Tutorial French India.scenario". If we launch the game, it is now in the list of sandbox games.
As we will not work with vanilla files, we need to duplicate needed files with new names and apply the name changes in the scenario file. Here we will just prepare the inclusion for those files replacing vanilla #include lines as follow :
Code: Select all
#include "Tutorial French India.CVP", "MAPS\"
#include "Tutorial French India.REGIONINCL", "MAPS\"
Code: Select all
#include "Tutorial French India.OOF", "MAPS\"
Code: Select all
#include "Tutorial French India.csv"
Code: Select all
#ifset 0x04
&&SAV
savfile "Tutorial French India"
&&END
Creating our country in the .cvp file
Lets now go in /MAPS/ folder and duplicate SR1914.cvp or SR1936.cvp. Rename file "Tutorial French India.CVP" ie. It matches the name we already put in our .scenario file above.
I am not going to explain all country details, you will find all infos about how it works there :
https://supremeruler.gamepedia.com/Regional_Data
Just duplicate any country and tailor it to your needs, dont forget to not use existing country IDs.
Here let's just use this code i made under creating a new country with id 3050 named India and because we add parentregion 1689, it is now a french colony and will have name French India in game.
The only thing i'm going to highlight here is the use of masterdata parameter set to 1, so all datas (starting fund, population, gdp/c...) remain the same for your country at start whatever country we use after in the next step of the tutorial.
(you will understand after what i write here : just know that if masterdata was at 0 and i used Texas, my starting money would have been very high because the countries data for French India and Texas would have been merged).
Note that refpopulation must be set at least equal than the country you use in GROUPING. Otherwise you will have hex with 0 population on map.
Code: Select all
//French India
&&CVP 3050
regionname "India"
prefixname ""
altregionname "", "", ""
blocknum 30
altblocknum
continentnum 5
flagnum 16
musictrack 6
regioncolor 0x
politic 0
govtype 1
refpopulation 5 //need to be higher than original grouped country, otherwise total pop on all hexes will be 0
poptotalarmy
popminreserve 1000
treasury
nationaldebtgdp
techlevel 2
civapproval 0.38
milapproval 0.55
fanaticism
defcon 0
loyalty 0.80
playeragenda
playeraistance 0
worldavail QW
armsavail F
worldintegrity 0.55
treatyintegrity 0.75
envrating 0.36
milsubsidyrating
domsubsidyrating 0.15
creditrating 0.74
tourismrating
literacy
lifeexp
avgchildren
crimerate
unemployment
gdpc 77
inflation
buyingpower
prodefficiency
alertlevel
bwmmember 0
religionstate
bconscript 0
forcesplan
milspendsalary
milspendmaint
milspendintel
milspendresearch
RacePrimary
RaceSecondary
capitalx
capitaly
masterdata 1
nonplayable 0
influence , , ,
influenceval , , ,
couppossibility
revoltpossibility
independencedesire
parentloyalty
independencetarget
sphere
civiliansphere
keepregion 0
parentregion 1689
theatrehome
&&GROUPING 3050
&®IONTECHS 3050
&®IONUNITDESIGNS 3050
&®IONPRODUCTS 3050
9, , 32, 0,
&®IONSOCIALS 3050
&®IONRELIGIONS 3050
We will now use an existing country in our .cvp file that needs to match the following :
- unused country at all in our scenario (like Texas), that is fully included within the borders of an existing country in game (Texas is part of USA map here),
- subgroup country of existing country in game (like West India - aka Bengal/Andaman - for India).
This easily allow you to reach 255 countries available for your game. For SR1914.REGIONINCL we have in vanilla 220 countries (dead and alive) in the scenario. Using american states and the following trick explained in this turorial we can reach the limit of 255 countries.
Lets start with Texas.
Texas country id is 2997.
We just need to make sure this country id is not used anywhere else, as a sub-country grouped in another country, and that is the case here, no other 2997 id used in groupings for SR1914 or SRU-1936.
Lets modify our GROUPING entry in our Tutorial French India.CVP file for our country added above as follow :
Code: Select all
&&GROUPING 3050
2997,
That is not what we want but that is mandatory for the game to recognize our country. Why? Because like we said before, newly made country in .cvp dont have any "painted" territory on map, while all vanilla countries listed in that .cvp file have pre-designed territory.
Lets do it with West India choice
For West India (country id 906) we need to modify our new country as follow :
Code: Select all
&&GROUPING 3050
906,
Search for India in the .cvp, make sure its the correct India country id 989, and modify India GROUPING as follow :
Code: Select all
&&GROUPING 989
901,
902,
903,
904,
905,
//906,
912,
910,
2103,
Updating our .REGIONINCL file
Now that French India country is created in our .cvp file either with Texas or West India, we need to update the .REGIONINCL file with its id, to tell the scenario this country will be present in game.
Go in the /MAPS/ directory, either clone SR1914.REGIONINCL or SR1936.REGIONINCL, rename the file to "Tutorial French India.REGIONINCL" like it is already in our .scenario file.
Then just add the following line :
Code: Select all
3050, // "India",
Now lets go to /Sandbox/ folder again, duplicate The Great War - 1914.csv or SR1936.csv and rename it "Tutorial French India.csv"
This is where we will strip our new country from its territory so we can work on it after starting from scratch, and where we revert the others countries we "stole" territory from (USA or India) to their original state with ownership for both lost hex and loyalty.
If you used Texas in previous step, simply add those 3 lines of events at the end of your file :
Code: Select all
//*****************************French India modification********************************************
//*******Creating country from scratch trick*******
//Transfering all French India3050 loyalty hex to USA2989 at start, i1=3 for all owned hex on world map
75000, 0, 0, 72, 0, 3050, 2989, 0, 0, 0, 0, 0, 0, 3, , , , , , ,
//Surrendering French India3050 to USA2989 at start, not modifying USA government in the process i3=0
75001, 0, 0, 40, 0, 3050, 2989, 0, 0, 0, 0, 0, , , 0, 0, , , , ,
//*******end of trick*******
//French India3050 alive at start
75009, 0, 0, 48, 0, 3050, 0, 0, 0, 0, 0, 1325, 355, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ,
Before going further please read about events here, at least know the position for the various parameters (columns) :
https://supremeruler.gamepedia.com/Events
Here i will explain line by line what i do.
Code: Select all
75000, 0, 0, 72, 0, 3050, 2989, 0, 0, 0, 0, 0, 0, 3, , , , , , ,
I am using event 72, which transfers loyalty between countries or to a country from anyone.
For parameter i1, i put 3 to tell that i will do this event worldwide.
Then i specify the country i'm taking loyalty from (here French India id 3050), and the country i'm transfering Loyalty to (here USA 2989).
Because the event is worldwide as parameter, the game will transfer all loyalty hex owned by French India to USA. Here in this tutorial it will transfer all Texas loyalty to USA.
Code: Select all
75001, 0, 0, 40, 0, 3050, 2989, 0, 0, 0, 0, 0, , , 0, 0, , , , ,
Using event 40, i am telling that French India (3050) is surrendering to USA (2989), and that this wont affect USA government in the process (i3 parameter is set to 0)
Now USA is in full controll of its lost territory, and French India is dead.
Code: Select all
75009, 0, 0, 48, 0, 3050, 0, 0, 0, 0, 0, 1325, 355, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ,
Using event 48, i am telling the game i want my country back, and i am specifying the hex coordinates of its capital (Pondichery on map here).
Like this we have a blank country French India recognized by the game with zero territory, and we can work on it transfering territory from anywhere in the world.
This also means i cant use Texas country in my .cvp file for other countries, as it is now grouped with French India, but none of its land belongs to French India thanks to events above.
But we achieved our goal with this trick and we dont need Texas to be ingame in our tutorial for 1914 or 1936
For West India example it would be the same kind of code :
Code: Select all
//*****************************French India modification********************************************
//*******Creating country from scratch trick*******
//Transfering all French India3050 loyalty hex to India989 at start, i1=3 for all owned hex on world map
75000, 0, 0, 72, 0, 3050, 989, 0, 0, 0, 0, 0, 0, 3, , , , , , ,
//Surrendering French India3050 to India989 at start, not modifying India government in the process i3=0
75001, 0, 0, 40, 0, 3050, 989, 0, 0, 0, 0, 0, , , 0, 0, , , , ,
//*******end of trick*******
//French India3050 alive at start
75009, 0, 0, 48, 0, 3050, 0, 0, 0, 0, 0, 1325, 355, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ,
Assigning territory to our country
We are still working with our Tutorial French India.csv file.
There are many ways to assign territory : hex by hex, by battlezone (you can transfer entire BZ between countries and remove unwanted hex after), or simply "drawing" a box of hex you transfer from one country to another. Quickly check events 43 and 44 in the wiki for details on what i just said.
Remember that xwerswoodx Scripted Events Creator & Editor tool is a wonder for massive land transfer between countries.
Here i am using event 44, hex by hex transfer because there arent much hex i want to give to French India, and French India territory doesnt match any known battlezone i can easily work with.
I want the following territory for my country within India :
Pondichery (1325 355) and sea access
Karaikal (1325 360) and sea access
Mahe (1300 357) and sea access, i will also need to rename the existing town Badagora in that hex (not far from Mahe in real world)
Yanaon (1339 331) and sea access, i will need to create a town in that hex since there is none in vanilla.
First lets do the land transfer, then the loyalty transfer, then lets modify our hex for city name and city creation.
The land transfer :
Code: Select all
//Hex transfer French India
//Pondichery
75010, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1325, 355, , , , , , , //Pondichery
75011, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1326, 356, , , , , , , //water hex
75012, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1327, 356, , , , , , , //water hex
//Karikal
75013, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1325, 360, , , , , , , //Karaikal
75014, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1326, 361, , , , , , , //water hex
75015, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1327, 361, , , , , , , //water hex
//Mahé
75016, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1300, 357, , , , , , , //Badagara city in vanilla, changed in map file
75017, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1299, 357, , , , , , , //water hex
75018, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1298, 358, , , , , , , //water hex
//Yanaon
75019, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1339, 331, , , , , , , //empty land hex in vanilla
75020, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1340, 332, , , , , , , //river hex
75021, 0, 0, 44, 0, 0, 3050, 0, 0, 0, 0, 0, 1341, 332, , , , , , , //water hex
But i could have put 989 instead if i wanted to make sure the transfer is made just from India (India 989 is actual ingame hex owner) and not from another country. Same for USA if i was using Texas.
For i0 and i1 parameters i just put the coordinates of the transfered hex on map.
The loyalty transfer :
Code: Select all
//Loyalty transfer French India
75100, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1325, 355, , , , ,
75101, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1326, 356, , , , ,
75102, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1327, 356, , , , ,
75103, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1325, 360, , , , ,
75104, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1326, 361, , , , ,
75105, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1327, 361, , , , ,
75106, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1300, 357, , , , ,
75107, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1299, 357, , , , ,
75108, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1298, 358, , , , ,
75109, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1339, 331, , , , ,
75110, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1340, 332, , , , ,
75111, 0, 0, 72, 0, 0, 3050, 0, 0, 0, 0, 0, 0, 0, 1341, 332, , , , ,
Here parameter i1 is set to 0, which means the transfer is done hex by hex. But you could also transfer by battlezone, by theatre, or even worldwide like we did previously above.
You need to know that if you transfer loyalty of BZs or theatres to a country not specifying original owner, it will also give loyalty to any ocean hex included in that BZ/theatre, ocean hex that are actually outside the owned territory of the country you took BZ/theatre loyalty from.
i2 and i3 parameters are the x,y coordinates of hex on map.
I can also choose to not specify from whom and to who i transfer the loyalty (both dbregion and otherdbregion set at 0). Then if i was doing the following :
Code: Select all
75100, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1325, 355, , , , ,
Finally we need to make sure we assign a capital to our country, if it was not already specified in our .cvp file above (and here it wasnt). Actually event 48 used before to make alive our country already did it, but better be safe than sorry^^
Code: Select all
//Making sure Pondichery is capital
75050, 0, 0, 29, 0, 3050, 0, 0, 0, 0, 0, 0, 1325, 355, , , , , , ,
Now if you recreate your mod cache and start the game, your country is almost complete and will look like this (the country in white in the screenshot) :
Modifying city name and adding a new city
This is the last step for our country to be as we want it.
Go in your /Maps/ folder, duplicate SR1914.OOF or SR1936.OOF and rename it "Tutorial French India.OOF" like it is already in our .scenario file.
Let's rename Badagara city at 1300x357 to Mahé.
Open the file and search for this : 21591,1300,357,"BADAGARA"
Replace BADAGARA city name with MAHE
If you used SR1914.OOF, line should look like this now :
Code: Select all
21591,1300,357,"MAHE",0,0,0, ,6,0.8,0,0,1,1,0,0.645772,0,0,0,0,
Lets create the city of Yanaon on that empty hex we transfered before at 1339x331.
Just add this line in your file, we will just duplicate the newly made MAHE line and change a few parameters like this :
Code: Select all
21591,1339,331,"YANAON",0,0,0, ,6,0.8,0,0,1,1,0,0.645772,0,0,0,0,
21591 here means the hex is a small village. You can find all IDs of hex structures in your .UNIT file, located in the /Maps/DATA/ folder.
1339 and 331 are the coordinates of the hex we want a new city on.
And this concludes our tutorial.
If you rebuild your cache, you now have a new french colony "French India" with its own territory within India.
You could go further modding relations, treaties, units, some events, adding sea pier to your cities and so on, this will be explained in details in later tutorials.
Hope this help
***
edit : another tutorial few post away, just scroll down the page
http://www.bgforums.com/forums/viewtopi ... 56#p181937