Crating a NEW country?

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
boyarinn
Sergeant
Posts: 12
Joined: Mar 19 2016
Human: Yes

Crating a NEW country?

Post by boyarinn »

Is there a way to create a brand new country (that is not listed in the .cvp file)? I have all the HEX codes that are needed to do this. Can anyone write me an instruction please? Tank you!
YoMomma
Brigadier Gen.
Posts: 768
Joined: Jun 27 2015
Human: Yes
Contact:

Re: Crating a NEW country?

Post by YoMomma »

Well basicly same way you created Crimea i guess. Copy a region in .cvp. Change region number to something unused, change the data you like, apply the hexes and thats that. Ofcourse load the region in .regionincl and to keep it clean i would do .csv as well.
Gameplay 1st
Zetangi
Warrant Officer
Posts: 32
Joined: Dec 31 2015
Human: Yes

Re: Crating a NEW country?

Post by Zetangi »

Is there by any chance a video tutorial on how to do this? This all sounds like alien talk to me.
boyarinn
Sergeant
Posts: 12
Joined: Mar 19 2016
Human: Yes

Re: Crating a NEW country?

Post by boyarinn »

YoMomma wrote:Well basicly same way you created Crimea i guess. Copy a region in .cvp. Change region number to something unused, change the data you like, apply the hexes and thats that. Ofcourse load the region in .regionincl and to keep it clean i would do .csv as well.
I got lost on the "apply the hexes" part. The rest I've understood. Could you explain the HEX part it in a little more detail, please?
YoMomma
Brigadier Gen.
Posts: 768
Joined: Jun 27 2015
Human: Yes
Contact:

Re: Crating a NEW country?

Post by YoMomma »

Add the hexes to the region with scripted events.
Atleast if you only make the new region a part of an existing region, else just group.
Gameplay 1st
MK4
Colonel
Posts: 488
Joined: Oct 08 2011
Human: Yes

Re: Crating a NEW country?

Post by MK4 »

YoMomma wrote:Add the hexes to the region with scripted events.
I understand the thread is old, but could you please give some details or link me to some guide on how to do this? Scripting has never been my thing...
YoMomma
Brigadier Gen.
Posts: 768
Joined: Jun 27 2015
Human: Yes
Contact:

Re: Crating a NEW country?

Post by YoMomma »

Yea i understand, i was more hoping cdiplayer would explain this part, since he did it for his mod, but ill figure it out when i have some time. Maybe this weekend. I have to try myself, maybe take a look in his mod.
Gameplay 1st
MK4
Colonel
Posts: 488
Joined: Oct 08 2011
Human: Yes

Re: Crating a NEW country?

Post by MK4 »

Thank you for the quick response! By all means, if you think you can enlighten me even by a bit on this subject please give it a try. :-)
vahadar
Colonel
Posts: 257
Joined: May 19 2010
Human: Yes

Re: Crating a NEW country?

Post by vahadar »

***
edited 09/01/17
check http://www.bgforums.com/forums/viewtopi ... 56#p181900 i made a detailed tutorial to create country from scratch
***

You need to know one thing, countries in .cvp file are all premade hex in the map file. If you want to create a totally new country you can assign hex to it through events (but you could also check that post about the map editor discovered in SRGW http://www.bgforums.com/forums/viewtopi ... 87&t=25941 might work for SR1936 who knows). You will also need to use existing groups from existing countries (dead or alive).

I will give you an example so you can create your own country with events.
At the bottom of this post you will find all details for the files you need to modify for the example under to work.

Lets say im starting a 1936 game and i want to create a Dai Nam revolt in Indochina with territory around the city of Hue

For quick explanations i will use a premade country that is not actually playable in the game but is already existing in map file and in the cvp :
Vietnam country in the CVP files (id 2197, made of north and south vietnam if you check grouping)

If you want to create your own new country i suggest you take a model from an existing one to make a new one in the .cvp (and dont forget to update the .REGIONINCL file with your new country id and name) and use the tips in the SR modding wiki website ;)

So back to our Dai Nam revolt.

In the cvp, i am making sure my country is not already grouped in another one (Vietnam is grouped in 2189 Indochina) otherwise it wont be listed as playable country in game.
So i remove the id 2197 in the grouping region of 2189 Indochina

Then i'm modifying a bit the country datas, like this for example (all techs available, capital is set to Hue coordinates, some techs and design at start and so on...)
Dont mind the details, check wiki for each line explanation :)

Code: Select all

&&CVP		2197
regionname	"Dai Nam"
prefixname	"Dai Viet"
altregionname	"Dai Nam", "", ""
blocknum       21
altblocknum    
continentnum   5
flagnum        505
musictrack     4
regioncolor    0x
politic        0.5
govtype        2
refpopulation  18.89
poptotalarmy   4000
popminreserve  2000
treasury       
nationaldebtgdp     
techlevel      15
civapproval    0.25
milapproval    
fanaticism     
defcon         2
loyalty        
playeragenda   
playeraistance     
worldavail     OWLPIYRCABQTZXUDEFGHMNKVSJ
armsavail      
worldintegrity     0.45
treatyintegrity    0.65
envrating      0.38
milsubsidyrating   
domsubsidyrating   0.15
creditrating   0.6
tourismrating  
literacy       
lifeexp        
avgchildren    
crimerate      
unemployment   
gdpc           46
inflation      
buyingpower    
prodefficiency 
alertlevel     0
bwmmember      1
religionstate  
bconscript     0
forcesplan     
milspendsalary 
milspendmaint  
milspendintel  
milspendresearch   
RacePrimary    1
RaceSecondary  1
capitalx       1492	
capitaly       333
masterdata     0
nonplayable    0
influence      43, , , 
influenceval   -0.35, , , 
couppossibility    0.75
revoltpossibility  0.25
independencedesire 
parentloyalty  
independencetarget 
sphere         0
civiliansphere 0
keepregion     0
parentregion   
theatrehome    2

&&GROUPING		2197
2102, 
2114, 

&&REGIONTECHS		2197
1164, 
907, 
1638, 
1572, 
909, 
1560,
850, 
1165, 
1680, 
1681, 
1528, 
921, 
1271, 
1709, 
1172, 
1665, 
567, 
1168, 
923, 
1710, 
1139, 
1170, 
1708, 
1696, 


&&REGIONUNITDESIGNS		2197
1, 
2, 
10, 

&&REGIONPRODUCTS		2197
0, , 28, 800
1, , 28, 800
2, , 7, 200
3, , 28, 2000
4, , 14, 1000
5, , 7, 200
7, , 7, 100
8, , 14, 50
9, , 14, 50
10, , 14, 50

&&REGIONSOCIALS		2197
0, 0.03, , 
1, 0.08, , 
2, 0.06, , 
3, 0.01, , 
4, 0.01, , 
5, 0.26, , 
6, 0.02, , 
7, 0.01, , 

&&REGIONRELIGIONS		2197
0, 0.095, 
1, 0.065, 
3, 0.79, 
4, 0.01, 
5, 0.01, 
10, 0.03, 
I am also modifying the SR1936.REGIONINCL and rename Vietnam with Dai Nam (also in any localized LocalText-Regions.csv)
I'm creating a new .Scenario file for sandbox to import all those files i modified (do not work with vanilla files for safety and backup, make copies for your mod)

So we have our country but if i build the cache, nothing will really happen, and Dai Nam territory is matching the entire Vietnam premade territory, which is not what i want for my example.

I will now use scripted events to make Dai Nam country alive at start, give it a leader, fix ownership of hexes i dont want for Dai Nam but keeping Vietnam loyalty, and assigning some parts of Vietnam to Dai Nam
This is done in the SR1936.CSV file under &&SEVENTS lines
https://supremeruler.gamepedia.com/Events

Using event 48 i am making my country 2197 alive

Code: Select all

//Dai Nam rebellion modification
//Vietnam2197 alive at start
70000, 0, 0, 48, 0, 2197, 0, 0, 0, 0, 0, 1492, 333, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, , 
here 70000 is just the id of the event, i make it bigger than the last id of vanilla csv, ids of lines dont need to be consecutive. You can put whatever line id you want as long as it is greater than last previous line
You need to specify the coordinates of the capital also (here 1492 333)

Since i want Dai Nam to occupy just pockets of lands within Indochina and not the entire premade Vietnam loyalty zone, i am reverting ownership of all hexes loyal to Vietnam to Indochina. Then i will retransfer some specific hex to Dai Nam.
Using event 43 i am targeting the battlezones loyal to Vietnam i want to give Indochina, this way i can work on a blank Dai Nam country and assign hex i want from original Vietnam country.
Here i am transfering 4 BZ (3 in indochina + guanzhouwan), the ownership transfer is made from 2197 Dai Nam to 2189 Indochina.

You dont really need to do this if you work on a totally new country, this trick was made to bypass the fact Vietnam loyalty hexes were already set in the map file.
But you need to work with existing group since creating a totally new country in .cvp without using existing groups wont do anything.
You can use painted region on map (existing countries in cvp if you prefer) that are not use by the scenario.

Code: Select all

//Transfering all hex from BZs in Vietnam2197 to Indochina2189 - plus Guanzhouwan - to fix ownership at start
70010, 0, 0, 43, 0, 2197, 2189, 0, 0, 0, 0, 0, 1480, 311, , , , , , ,
70011, 0, 0, 43, 0, 2197, 2189, 0, 0, 0, 0, 0, 1496, 336, , , , , , ,
70012, 0, 0, 43, 0, 2197, 2189, 0, 0, 0, 0, 0, 1486, 361, , , , , , ,
70013, 0, 0, 43, 0, 2197, 2189, 0, 0, 0, 0, 0, 1509, 310, , , , , , ,
Under is the part you need to do for a totally new country in the cvp file with no premade loyalty zone on map.

Now Dai Nam territory is set the way i want it simply hold no land at all, and the previous loyalty zone of Vietnam (now Dai Nam) remains but is occupied by Indochina. I can then correctly assign BZs or hexes i want to Dai Nam.
Here i'm using event 44, and giving 5 hexes, the first being the hex of the capital with the coordinates of the city of Hue 1492 333 (as we also did for the coordinates in the .cvp file, and the make country alive event). Then i am assiging to Dai Nam some hexes around the city.
The last two sets of number are the coordinates of the hex you transfer.

I am doing it hex by hex but you could define an entire box of hex to transfer (specifying top left and bottom right coordinates of rectangle) see wiki for details.

You can also transfer entire battlezones to a country you create using event 43 (instead of adding it hex by hex), see events on wiki for details
For a BZ transfer (like i did in the code above to give all Vietnam BZs to Indochina) you need to give just the coordinates of one hex within that BZ and the game will transfer the entire BZ owned by the previous owner to the new owner. If a BZ is shared between 2 or more nations, the game will just transfer the hexes owned by the previous owner in that BZ to the new owner, if the previous owner id is specified in the event. If previous owner id is not specified it will take all hexes within said BZ regardless of their original owners.

Code: Select all

//Making sure Vietnam has territory around HUE
70020, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1492, 333, , , , , , ,
70021, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1492, 334, , , , , , ,
70022, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1493, 333, , , , , , ,
70023, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1491, 333, , , , , , ,
70024, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1491, 332, , , , , , ,
If you want you can transfer some ocean hex to give Dai Nam water access from Hue.
example :

Code: Select all

70026, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1493, 332, , , , , , ,
70027, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1494, 332, , , , , , ,
And for fun lets give Dai Nam some more cities in Indochina to stage revolts

Code: Select all

//Vietnam has VINH
70030, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1480, 322, , , , , , ,
//Vietnam has QUI NHON
70031, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1501, 346, , , , , , ,
//Vietnam has DA NANG
70032, 0, 0, 44, 0, 0, 2197, 0, 0, 0, 0, 0, 1496, 336, , , , , , ,
Using event 72 you could also create a true loyalty zone for your country, but it can be a lot of work when you cant easily work with BZs or theatres, but need to work it hex by hex.

Code: Select all

70200, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 1, 1473, 358, , , , , //Cambodia 1834 Siamese-vietnamese war BZ transfer example
Here i transfer the loyalty of all cambodian hexes within the BZ of Saigon
2197 is otherdbregion here, i am not specifying dbregion so the game will transfer loyalty regardless of owner, even if original owner is dead. In that case it will also transfer ocean hex if the BZ include oceanic zone.
I could do the following so that only the hex owned by Indochina2189 are transfered, i'm specifying Indochina as original owner despite loyalty is to Cambodia, because Cambodia is dead, and its Indochina who control the land actually :

Code: Select all

70200, 0, 0, 72, 0, 2189, 2197, 0, 0, 0, 0, 0, 0, 1, 1473, 358, , , , , //Cambodia 1834 Siamese-vietnamese war BZ transfer example
"1" befoe the coordinates 1473, 358, tells game i'm transfering within a BZ, giving the coordinates of one hex within this BZ so the game knows which BZ i'm talking about
put "0" if you transfer loyalty hex by hex, ie :

Code: Select all

70201, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 0, 1476, 356, , , , , //and under, hex transfer example
70202, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 0, 1476, 355, , , , ,
70203, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 0, 1477, 355, , , , ,
70204, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 0, 1478, 355, , , , ,
70205, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 0, 1477, 354, , , , ,
70206, 0, 0, 72, 0, 0, 2197, 0, 0, 0, 0, 0, 0, 0, 1476, 354, , , , ,
Check event 72 on wiki for more options for this event

Now our newly made country has its own territory consisting of tiny pockets of lands within Indochina with a new customized loyalty zone

I then need to set a leader to my country.
First i need to make sure i make one for my country in the DEFAULT.PPLX file (make copy)
I'm adding this line in the PPLX file :

Code: Select all

//Mod Vietnam revolt
2024,2,Bao,Dai,,,,,,595,,,,,,,,2197,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2024 is id of line, must follow last vanilal line id
Then is Name (first and last) here Bao Dai
Next number (595) is the icon id i am using for that leader, here i am using an existing one (mengjiang one)

You dont really need to fill the other options, like this you have the minimum to create a new leader with a picture (but you can set gender, personality, politic... check wiki or dig in file headers for help)

Since SRGW (or even before dunno? never noticed) you can specify title, for an emperor it would be :

Code: Select all

//Mod Vietnam revolt
2024,2,Bao,Dai,Emperor,,,,,595,,,,,,,,2197,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Specifying region id for the leader in that file is not mandatory (the 2197)

Before pic num id, you can specify age if you want
For instance if i was modding SR Great War in 1914 :

Code: Select all

//Mod Vietnam revolt
3134,2,Duy,Tan,Emperor,,0,0,14,3022,,,,,,,,,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
This is for a 14 years old Duy Tan, emperor of Vietnam in 1914, using picture num id 3022

Then back to our events in the .CSV file
I'm telling the game who is the leader of my newly made country using event 20, and specifying the id of the line i added in the .PPLX file (here is 2024 for Bao Dai)

Code: Select all

//Setting Vietnam leader Bao Dai
70040, 0, 0, 20, 10, 2197,-1 , 0, 0, 0, 1, 0,2024,,, , , , , ,
Et voilà :) now you can build the cache and the game will add a new country to play with :)
But it will have no units, you can create your own Orbat file for Dai Nam (2197.csv in orbats directory). I wont go into detail for orbats, check wiki, or you can simply add units through event 10 like this (specifying unit id, target country, how many to create, unit status, and coordinates, check wiki for details) :

Code: Select all

//Vietnam Troops spawn Hue
70050, 0, 0, 10, 4269, 2197, -1, 0, 0, 0, 0, 0, 2, 2, 1492, 333, , , , ,1, //2 units of 75mm howitzer
70051, 0, 0, 10, 353, 2197, -1, 0, 0, 0, 0, 0, 2, 2, 1492, 333, , , , ,1, //2 units of Partisans
70052, 0, 0, 10, 354, 2197, -1, 0, 0, 0, 0, 0, 2, 2, 1492, 333, , , , ,1, //2 units of Guerilla
70053, 0, 0, 10, 1, 2197, -1, 0, 0, 0, 0, 0, 4, 2, 1492, 333, , , , ,1, //4 units of Militia
To give your country some spicy starting events you could set it hostile with France and Indochina, with horrible relations with Siam, France or China, and positive with Japan. Giving treaties with Japan then cancelling those treaties after some time and so on...
Check event 14 for relation change in the wiki, event 5 for setting treaties between countries and event 17 for war status.

Code: Select all

//Relation change
70070, 0, 0, 14, , 2197,  2001, 0, 0, 0, 0, 0,1,1,1,1 , 1, 1 ,0 , , , //Friendly Japan, reciprocity
70071, 0, 0, 14, , 2197,  1689, 0, 0, 0, 0, 0,1,1,1,1 , -1, -1 ,1 , , , //Hatefull France
70072, 0, 0, 14, , 2197,  2189, 0, 0, 0, 0, 0,1,1,1,1 , -0.75, -0.75 ,1 , , ,  //not that Hatefull Indochina
70073, 0, 0, 14, , 2197,  2101, 0, 0, 0, 0, 0,1,1,1,1 , -1, -1 ,1 , , ,  //Hatefull Siam
70074, 0, 0, 14, , 2197,  1989, 0, 0, 0, 0, 0,1,1,1,1 , -1, -1 ,1 , , ,  //Hatefull China
70075, 0, 0, 14, , 2197,  2188, 0, 0, 0, 0, 0,1,1,1,1 , -1, -1 ,1 , , ,  //Hatefull Malay States
70076, 0, 0, 14, , 2197,  1188, 0, 0, 0, 0, 0,1,1,1,1 , 1, 1 ,0 , , , //Friendly Germany
70084, 0, 0, 5, 10, 2197,  2001, 0, 0, 0, 0, 0,1,0,0, , ,  , , , , //Mutual defense Japan
70085, 0, 0, 5, 10, 2197,  1188, 0, 0, 0, 0, 0,1,0,0, , ,  , , , , //Mutual defense Germany
70087, 57600, 0, 5, 10, 2197,  2001, 0, 0, 0, 0, 0,0,0,0, , ,  , , , , //Mutual defense Japan ends
70088, 57600, 0, 14, , 2197,  2989, 0, 0, 0, 0, 0,1,1,1,1 , 0.45, 0.45 ,0 , , , //Average USA
70089, 57600, 0, 14, , 2197,  1389, 0, 0, 0, 0, 0,1,1,1,1 , 0.35, 0.35 ,1 , , , //Average UK
70090, 0, 0, 5, 12, 2197,  2001, 0, 0, 0, 0, 0,1,0,0, , ,  , , , , //Transit with Japan
// Rebellion war Indochina-Vietnam
70100, 0, 0, 17, 0, 2189, 2197, 0, 0, 0, 0, 0, 0, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, , 
70101, 0, 0, 17, 0, 2197, 2189, 0, 0, 0, 0, 0, 0, 0, 0, 0, , , , , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ,
Using conditionnal events you can make very interesting things, i will not detail it here but you have a first taste of the event system like this.

Hope this help. I know you might have a lot of questions after this, since i'm just throwing lines of scripts, but reading the wiki and following my example will give you some hints. If need i can attach all the files modified for the Dai Nam example above for you to dig in. Just let me know.

Short summary of what i wrote above for files you need to modify to create a new country for Sandbox mode :

1- create a new .scenario file (copy and modify SR1936.scenario in SR \Sandbox directory)
This scenario file is calling all files you modified for your mod (as include files)

2- create a new .cvp file from the SR1936.CVP file located in the \Maps directory
this is where you put your new country informations

3- create a new .REGIONINCL, still in \Maps, from SR1936.REGIONINCL to add your new country with its id defined in the .cvp

4- update (or create from vanilla files) any localized region text file in the \Localize directory, ie the LocalText-Regions.csv in \Localize\LOCALEN\Scenario, and make sure it is properly included in the .scenario file

5- create a new .csv file from the SR1936.CSV one in the \Sandbox directory, add all events you want there

6- create new or update the DEFAULT.PPLX file for your leader in the \Maps\DATA directory

Build your new sandbox game cache and enjoy.
Last edited by vahadar on Sep 01 2017, edited 3 times in total.
MK4
Colonel
Posts: 488
Joined: Oct 08 2011
Human: Yes

Re: Crating a NEW country?

Post by MK4 »

What an awesome post! Thank you very much for taking the time to write this!

I was actually interested in modding SR2020 (and probably porting it to SRCW), but I migrated here since my thread in the SR2020 section did not produce any result for over half a year. My intention was to add Transnistria because, as it is now, Moldova and its neighborhood are unrealistically uncomplicated. And, if that goes well, to better reflect the current situation in Ukraine.

I assume most of the stuff is compatible so I`ll give it a try over the weekend I hope.
vahadar
Colonel
Posts: 257
Joined: May 19 2010
Human: Yes

Re: Crating a NEW country?

Post by vahadar »

You should work directly with SR1936 or SRCW, because the events system was not introduced to my knowledge in SR2020 (no events options).
Post Reply

Return to “Modding 1936”