[TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

This forum has been archived. Please use the new modding forum. If you need to retrieve a thread from here, contact BattleGoat.

Moderators: Balthagor, BattleGoat

Post Reply
vahadar
Colonel
Posts: 256
Joined: May 19 2010
Human: Yes

[TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by vahadar »

***08/29/17 updated with links to mod files for SRGW 1914 and SRU 1936 ***

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^^). [_]O

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 :roll:
- 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

Image

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 :wink:
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 :D

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 :wink:

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"
We also need to specify a new name for our cache file, like :

Code: Select all

#ifset 0x04
&&SAV
savfile "Tutorial French India"
&&END
We leave other lines untouched.

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

&&REGIONTECHS		3050

&&REGIONUNITDESIGNS		3050

&&REGIONPRODUCTS		3050
9, , 32, 0, 

&&REGIONSOCIALS		3050

&&REGIONRELIGIONS		3050
If you start the game now after building your cache, nothing will happen, your new country wont be listed as it simply dont exist on map yet. Because it is not "painted" on map like vanillas countries are, and because it is not yet made from an existing "painted" country, through GROUPING.

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, 
Now French India is assigned all Texas territory in game.

Image

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, 
But we also need to remove any reference to West India as it already exists here for India grouping (India id is 989).

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, 
Image

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",
The fun part, using events to customize our country

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, , 
This is done just with 3 lines here because we made sure before that we chose for GROUPING an unused country in .cvp that was within the borders of an existing country in our scenario, or that we were using a sub-country of an existing country in scenario.

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 creating a new line, id 75000 for example (just need to be greater than previous line id).
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, , , , , 
Now that my country has no more loyalty hex, but still has territory, i will need to surrender it, so the previous owner of my territory will retake all its lost land thanks to loyalty ownership change done above.
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, , 
But we want our country to exist :roll:
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, , 
I am not going into other parameters details, but just know that all those events are done right at game start, it will be transparent for you once we assign territory after.

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
Using event 44, i am transfering twelve hex to French India (3050). I am not specifying from who i am transferring here, the parameter eventdbregion is set at 0 so the transfer is happening whoever the owner is.
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, , , , ,
Using event 72, i am transfering the same twelve hex loyalty to French India, whoever the original loyalty owner was (eventdbregion is set at 0).
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, , , , ,
the loyalty for hex 1325x355 would be transfered to its actual owner on map, which is still French India 3050, because of the land transfer we did before.

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, , , , , , ,
Using event 29, i am giving the coordinates of the city hex i want to be my capital for French India (3050). Here that city hex is already owned by us thanks to the land transfer we did above.

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) :

Image

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, 
So now the city at 1300x357 coordinates is named MAHE.

Image

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,
The .OOF file lists towns name alphabetically, so just browse it to insert that line accordingly (should be after YANAGAWA city ie.)
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.

Image

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
Last edited by vahadar on Sep 01 2017, edited 14 times in total.
raxo2222
Captain
Posts: 104
Joined: Mar 25 2011
Human: Yes
Location: Poland

Re: [TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by raxo2222 »

Can someone create Atlantis?

This country would have all techs and world designs of units researched and would have lets say 10 000 or 100 000 people.
It would be on island as far as possible from any countries.
That would be nice quantity versus quality battles.
Like 1 mech against 10 000 1914 year infantry :p
vahadar
Colonel
Posts: 256
Joined: May 19 2010
Human: Yes

Re: [TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by vahadar »

Thats possible yes :D i will spend 30mn to do this later today. Since you mentioneed 1914, you want this for SRGW 1914 or SRU-1936 ?

But i wont create new land (need map editor for that), instead using existing island (was thinking of Portuguese Madeira at Funchal).
Adding all techs and design is quickly done, will copy table and add needed coma in .cvp file. Hope game wont explode when creating the cache :lol:
raxo2222
Captain
Posts: 104
Joined: Mar 25 2011
Human: Yes
Location: Poland

Re: [TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by raxo2222 »

vahadar wrote:Thats possible yes :D i will spend 30mn to do this later today. Since you mentioneed 1914, you want this for SRGW 1914 or SRU-1936 ?

But i wont create new land (need map editor for that), instead using existing island (was thinking of Portuguese Madeira at Funchal).
Adding all techs and design is quickly done, will copy table and add needed coma in .cvp file. Hope game wont explode when creating the cache :lol:
For SRGW 1914, but you can make it for SRU-1936 too, as great war may be DLC for ultimate too.
That country should have large GDP/c, like around $100 000 per capita.
vahadar
Colonel
Posts: 256
Joined: May 19 2010
Human: Yes

Re: [TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by vahadar »

**edit 08/29/17**
New link for Atlantis mod for SRGW 1914 (1st link posted yesterday was with mistake in mod cache, fixed now)
https://nofile.io/f/epXBMj8YbKq/Atlantis+SRGW+1914.zip

And here is version for SRU 1936
https://nofile.io/f/8JO84YnbBF2/Atlantis+SRU+1936.zip
Note that since the limit of 255 countries is reached in .REGIONINCL for 1936 i had to merge Reunion (419) with France (1689) to free one country slot.

A quick tutorial about how to make this mod will follow.

I couldnt set default research efficiency to 0, so you will need to lower it yourself in game otherwise you will loose millions a day ;)
Also the Financial tab will adjust datas after one day (because here reference population is 5M for 100.000 gdp/c when pop is 65k actually)

Image
vahadar
Colonel
Posts: 256
Joined: May 19 2010
Human: Yes

Re: [TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by vahadar »

Quick step by step Tutorial to make Atlantis mod above

I'm assuming you already read the first tutorial for French India, so i can skip some explanations.

Making the .scenario file
No real difference compared to first tutorial, just see for yourself in the files you can download for Atlantis mod in previous post.

Making the .REGIONINCL file
For both SRU and SRGW i just added Atlantis country id (3050), like in the first tutorial

Code: Select all

3050,    // "Atlantis",
For SRU 1936, since SR1936.REGIONINCL file is already capped at 255 countries, i cloned that file and commented ("removed") French Reunion country (id 419) to free one country slot, and added Atlantis.

Code: Select all

//419,    // "Reunion", 
Making the .cvp file
Like in the previous tutorial i created a new country id 3050 for Atlantis. I used Texas (id 2997) in the GROUPING section of our newly made Atlantis country (id 3050).
All unit designs and all techs are also added.
Many modifications were made to the regional datas for Atlantis. See for yourself in the download files previous post and check wiki for more explanation for those datas https://supremeruler.gamepedia.com/Regional_Data.

Because of the country limitation in the .REGIONINCL file for SRU-1936, i also merged Reunion (419) with France (1689) like this :

Code: Select all

&&GROUPING		1689
1601, 
1602, 
421, 
223, 
419, 
(Not done for SRGW 1914)

Making the .csv file

It required even fewer lines compared to French India tutorials to create the territory+loyalty for Atlantis, only 6 lines total.

Code: Select all

//create country trick
75000, 0, 0, 72, 0, 3050, 2989, 0, 0, 0, 0, 0, 0, 3, , , , , , ,
75001, 0, 0, 40, 0, 3050, 2989, 0, 0, 0, 0, 0, , , 0, 0, , , , , 
75009, 0, 0, 48, 0, 3050, 0, 0, 0, 0, 0, 739, 251, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, , 
//Hex transfer Atlantis
//Transfering entire loyalty of Funchal BZs to Atlantis
75030, 0, 0, 72, 0, 1788, 3050, 0, 0, 0, 0, 0, 0, 1, 739, 251, , , , , //need to do loyalty transfer before hex transfer
//Transfering entire Funchal BZs to Atlantis
75040, 0, 0, 43, 0, 1788, 3050, 0, 0, 0, 0, 0, 739, 251, , , , , , , 
//Making sure Funchal is capital (should be in .cvp)
75050, 0, 0, 29, 0, 3050, 0, 0, 0, 0, 0, 0, 739, 251, , , , , , ,
Like in our French India tutorial we have the similar first three lines (event 72, event 40 and event 48) to make a blank Atlantis country (using Texas/USA). Check explanations there.

Unlike previous tutorial land transfer is quicker here, as i just need to transfer the battlezone of Funchal, and not hex by hex
As you can see it is done in two steps.
First i transfer Funchal BZ loyalty from Portugal (1788) to Atlantis (3050) using event 72

Code: Select all

75030, 0, 0, 72, 0, 1788, 3050, 0, 0, 0, 0, 0, 0, 1, 739, 251, , , , ,
i1 parameter is set to 1 here since we do a BZ transfer
i2 and i3 set at 739 and 251 are the coordinates of one hex within that BZ so the game knows what BZ we transfer
Loyalty transfer can be done two ways.
Telling original owner, since this is a loyalty transfer made to a country (to otherdbregion here Atlantis) it needs to have a specified "from country" (dbregion here Portugal) as owner of the hex/Bz. That's the case here Portugal is owner of Funchal BZ.
Not telling original owner, you just set dbregion to 0 and set otherdbregion to Atlantis id. But it will transfer all hex loyalty from that BZs including ocean hex outside of vanilla Funchal island territory, like we already said in previous tutorial.

Then i transfer all hex ownership in Funchal BZ from Portugal to Atlantis using event 43

Code: Select all

75040, 0, 0, 43, 0, 1788, 3050, 0, 0, 0, 0, 0, 739, 251, , , , , , , 
Like this our country already works if we build the cache (since we have already set Atlantis capital coordinates in the .cvp file, and also with event 48 make country alive), but i'm always using event 29 to set capital just in case :

Code: Select all

75050, 0, 0, 29, 0, 3050, 0, 0, 0, 0, 0, 0, 739, 251, , , , , , ,
Others events used here

Code: Select all

//Creating sea port, air base and barracks to prevent Orbat deployment issue from previous owner
//creating sea port id 21203 at 737*250 in slot 0
75060, 0, 0, 34, 21203, 3050, 0, 0, 0, 0, 0, 0, 0, 1, 737, 250, , , , ,
//creating air base id 21202 at 737*250 in slot 3
75061, 0, 0, 34, 21202, 3050, 0, 0, 0, 0, 0, 0, 3, 1, 737, 250, , , , ,
//creating barracks id 21201 at 737*250 in slot 5
75062, 0, 0, 34, 21201, 3050, 0, 0, 0, 0, 0, 0, 5, 1, 737, 250, , , , ,
//setting max garrisson to all built hex in Atlantis BZ
75070, 0, 0, 71, , 3050, 0, 0, 0, 0, 0, 0, 18, 1, 737, 250, , , , ,
//adding 1 mech BMV-E2 Raven units at start, quicker than making a new orbat for Atlantis
75150, 0, 0, 10, 3912, 3050, , 0, 0, 0, 0, 0, 1, 2, 739, 251, , , , , //1 BMV-E2 Raven deployed and supplied
//Treasury and goods adjustement at start
75201, 0, 0, 16, 8, 3050, , 0, 0, 0, 0, 0, , , , , 20000, , , , //+20000 industry goods
75202, 0, 0, 16, 9, 3050, , 0, 0, 0, 0, 0, , , , , 20000, , , , //+20000 consumer goods
75203, 0, 0, 16, 10, 3050, , 0, 0, 0, 0, 0, , , , , 20000, , , , //+20000 military goods
75204, 0, 0, 16, 3, 3050, , 0, 0, 0, 0, 0, , , , , 2000000, , , , //+2000000 petroleum goods
75205, 0, 0, 16, 6, 3050, , 0, 0, 0, 0, 0, , , , , 100000, , , , //+100000 uranium goods
*** digression ***

Before explaining those events i need to do a digression about why i'm creating military facilities through events here and not in .OOF file (sea port, air base, barracks)

Let's say i want our town Funchal to have a sea port instead of a sea pear, like it is in the vanilla .OOF file of SR1914.
What do i have in vannila .OOF for Funchal hex :
in SRGW-1914 scenario :

Code: Select all

21205,739,251,"FUNCHAL",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21501,739,251,"FUNCHAL",0,0,0, ,6,0.8,0,0,1,1,0,2.460914,0,0,0,0, 
in SRU-1936 scenario :

Code: Select all

21204, 739, 251, "FUNCHAL", 0.000000, 0, 0, , 3, 0.800000, 0.000000, 0, 1.000000, 1.000000, 0.000000, 1.570796, 0, 0, 0, 0, 
21205, 739, 251, "FUNCHAL", 0.000000, 0, 0, , 4, 0.800000, 0.000000, 0, 1.000000, 1.000000, 0.000000, 1.570796, 0, 0, 0, 0, 
21501, 739, 251, "FUNCHAL", 0.000000, 0, 0, , 6, 0.800000, 0.000000, 0, 1.000000, 1.000000, 0.000000, 3.508112, 0, 0, 0, 0, 
For SRGW-1914 :
1st line creates a sea pier (21205) at hex 739x251 named FUNCHAL with position 4 on hex (here "south" - facility hex positioning range from 0 to 6, 0 being top left then going clockwise and 6 being the central hex like city/complex)
2nd line creates a small village (21501) named FUNCHAL at 739x251, hex positioning 6 (cities and complex are always at position 6)

For SRU-1936, 1st line creates an air field position 3, 2nd line a sea pier position 4 and last line a small village.
You find the id of all facilities in your DEFAULT.UNIT file at the end, in /Maps/DATA/

Let's say i want a sea port instead of a sea pier for SRGW 1914, i simply replace

Code: Select all

21205,739,251,"FUNCHAL",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
with :

Code: Select all

21203,739,251,"FUNCHAL",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
If i build the cache i will indeed have a sea port now.
BUT something is wrong i have portuguese naval units on my hex [_]O

Image

Since orbats files (here SR1914.OOB in our .scenario) are processed before your .csv event file (even if you change include order in your .scenario file), game engine will read portuguese orbat and balance all its units set in reserve between its sea ports/barracks/air bases.
Since our Funchal sea port belongs to Portugal when the orbat is parsed by the engine (the transfer event to Atlantis happens after), some naval units will be put in reserve there. When we do the transfer to Atlantis through events, those units originally stationned in the sea port will leave hex at game start.

To counter this i am not creating in the .OOF any military facility that allow a unit to go in reserve. I can create any other facility still in my .OOF
Instead i am using events to create those military facilities.

Why this is important? Because if you want to transfer lands form a country to another through events for your mod (lets say i transfer Normandy and Britany regions from France to USA), but some military base allowing reserve were included in the land transfered, you will have units deployed from the original nation there (here i will have lots of french units in my new USA territory). So you need to delete those facilities in the .OOF in the first place, and recreate them through events. Game will balance reserved units in the remaining military bases for France.

***end of digression***

Since i want to create some air base, sea port and barrack for Atlantis i am not going to do it in my .OOF file.
Using event 34 i can create any facility i want on map. I just need to specify in eventparam column the id of the facility, then the owner (Atlantis 3050) then for i0 parameter i set its position within hex (0 to 5, game will create military/industrial complex at 6 automaticly if need), i1 parameter is set at 1 to tell the facility is already built and i2 i3 parameters set the x,y coordinates on map.

Code: Select all

//creating sea port id 21203 at 737*250 in slot 0
75060, 0, 0, 34, 21203, 3050, 0, 0, 0, 0, 0, 0, 0, 1, 737, 250, , , , ,
//creating air base id 21202 at 737*250 in slot 3
75061, 0, 0, 34, 21202, 3050, 0, 0, 0, 0, 0, 0, 3, 1, 737, 250, , , , ,
//creating barracks id 21201 at 737*250 in slot 5
75062, 0, 0, 34, 21201, 3050, 0, 0, 0, 0, 0, 0, 5, 1, 737, 250, , , , ,
So here i create a sea port (21203) at hex 737x250 position 0 in hex, then an air base (21202) position 3, then a barracks (21201) position 5.

And now no portuguese units at start of our game. :wink:

With event 71 i am setting all my hex within my new Atlantis battlezone (ex Funchal BZ) with full garrisson.

Code: Select all

75070, 0, 0, 71, , 3050, 0, 0, 0, 0, 0, 0, 18, 1, 737, 250, , , , ,
i0 parameter at 18 specify garrisson are fully build already
i1 set to 1, because i'm doing it in all my BZ
i2,i3 specify the coordinates (here a hex within my BZ so the game recognize the BZ)

Using event 10 i'm creating and deploying a mech unit. I could do it with orbat files, but it is quicker here for me.

Code: Select all

75150, 0, 0, 10, 3912, 3050, , 0, 0, 0, 0, 0, 1, 2, 739, 251, , , , , //1 BMV-E2 Raven deployed and supplied
in eventparam column you put the unit id you want to create, here a Raven mech id 3912. Unlike orbats you cant personnalize the name of the unit you create here.
IDs of units are found in DEFAULT.UNIT file in /Maps/DATA/
i0 parameter is the quantity created (here 1)
i1 parameter the status of those units (deployed, reserve...), here 2 means deployed and fully supplied
i2, i3 the hex where that unit is created (here 739,251 at Funchal)

Then i am doing various goods adjustement at start using event 16. I can also do it editing &&REGIONPRODUCTS in my regional data .cvp file, see http://www.bgforums.com/forums/viewtopi ... 48&t=11881 for that.

Code: Select all

75201, 0, 0, 16, 8, 3050, , 0, 0, 0, 0, 0, , , , , 20000, , , , //+20000 industry goods
75202, 0, 0, 16, 9, 3050, , 0, 0, 0, 0, 0, , , , , 20000, , , , //+20000 consumer goods
75203, 0, 0, 16, 10, 3050, , 0, 0, 0, 0, 0, , , , , 20000, , , , //+20000 military goods
75204, 0, 0, 16, 3, 3050, , 0, 0, 0, 0, 0, , , , , 2000000, , , , //+2000000 petroleum goods
75205, 0, 0, 16, 6, 3050, , 0, 0, 0, 0, 0, , , , , 100000, , , , //+100000 uranium goods
Also check the wiki to see the id of the goods put in eventparam column (ie 8 is industry goods).

Making the .OOF file

I want to rename Funchal town to Atlantis, add some facilities to that town, and create two news customized complex in the remaining 2 hex of our island.
So i'm adding this to my .OOF file :

Code: Select all

21212,737,250,"ATLANTIS SKUNK WORKS",0,0,0, ,1,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21210,737,250,"ATLANTIS SKUNK WORKS",0,0,0, ,2,0.8,0,0,1,1,0,1.570796,0,0,0,0,  
21211,737,250,"ATLANTIS SKUNK WORKS",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21006,737,250,"ATLANTIS SKUNK WORKS",0,0,0, ,6,0.8,0,0,1,1,0,3.909537,0,0,0,0, 
21300,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,0,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21011,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,1,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21020,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,2,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21078,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,3,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21066,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21304,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,5,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21003,738,251,"ATLANTIS OMNI CONSUMER PRODUCTS",0,0,0, ,6,0.8,0,0,1,1,0,3.909537,0,0,0,0, 
21223,739,251,"ATLANTIS",0,0,0, ,0,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21204,739,251,"ATLANTIS",0,0,0, ,1,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21226,739,251,"ATLANTIS",0,0,0, ,2,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21321,739,251,"ATLANTIS",0,0,0, ,3,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21205,739,251,"ATLANTIS",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21073,739,251,"ATLANTIS",0,0,0, ,5,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21509,739,251,"ATLANTIS",0,0,0, ,6,0.8,0,0,1,1,0,3.909537,0,0,0,0, 
Using my previous explanations above on .OOF structure and the sea port at Funchal, you can decipher what i do here. I create some structures and give names to hex at 737,250 and 738,251, with complex (military and industrial) and some buildings (again you can find the facilities IDs in the .UNIT file). I modify Funchal hex at 739,251, renaming it and adding new facilities.
Also i am not filling the position of the three military bases i already built using events at hex coordinates 737,250..

I also need to delete the vanilla .OOF lines for Funchal city, for SRGW 1914 or SRU-1936, respectively :

Code: Select all

21205,739,251,"FUNCHAL",0,0,0, ,4,0.8,0,0,1,1,0,1.570796,0,0,0,0, 
21501,739,251,"FUNCHAL",0,0,0, ,6,0.8,0,0,1,1,0,2.460914,0,0,0,0, 

Code: Select all

21204, 739, 251, "FUNCHAL", 0.000000, 0, 0, , 3, 0.800000, 0.000000, 0, 1.000000, 1.000000, 0.000000, 1.570796, 0, 0, 0, 0, 
21205, 739, 251, "FUNCHAL", 0.000000, 0, 0, , 4, 0.800000, 0.000000, 0, 1.000000, 1.000000, 0.000000, 1.570796, 0, 0, 0, 0, 
21501, 739, 251, "FUNCHAL", 0.000000, 0, 0, , 6, 0.800000, 0.000000, 0, 1.000000, 1.000000, 0.000000, 3.508112, 0, 0, 0, 0, 
And this concludes our quick tutorial.
I made less detailed explanations but i'm sure you can figure it all :wink:
Last edited by vahadar on Aug 30 2017, edited 2 times in total.
evildari
Colonel
Posts: 488
Joined: Aug 10 2017
Human: Yes

Re: [TUTORIAL] How to create a country from scratch, 100% custom and loyal land and have up to 255 regions in your mod

Post by evildari »

Thank you very much vahadar for this very detailed explanation - will surely help me alot to make totaly new countries for my new mod MARSX1
my mods
http://www.bgforums.com/forums/viewtopi ... 79&t=25932 (even techs and units for everyone - AI will own you too)
http://www.bgforums.com/forums/viewtopi ... 79&t=29326 (MARSX2)
Post Reply

Return to “Modding SRUltimate”