• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Trmdrg

First Lieutenant
Feb 19, 2015
200
41
  1. Is there any code to add pirates to a specific sea province in the scenario file? Not an event script, but a string for the scenario file. If I add a navalunit then pirates have a navalunit (amazing, right?), not the piratic ships mechanic for a sea province. I just want pirates to be in a certain province from the very start of the scenario. Not via events.
  2. How can I add a permanent casus belli to a country scenario file? I know only the code "casusbelli = { type = temporary expirydate = { year = xxxx } }". With "permanent" instead of "temporary" it does not work. Please, do not write to me obvious things about cores and casus belli.
  3. I can use the code to set up the siege from the beginning of the scenario.
    Code:
    combat = {
        id = { type = 4712 id = 60175 }
        type = siege
        province = xxx
        date = { day = 1 month = november year = 431 } #I type here the past day when the siege began
        morale = { 4.415 4.415 }
        attackers = { { type = xxxx id = xx } }   #I type here the type and id of the army in that province
        fortress = { inf = 13000 cav = 500 art = 0 }
        siege_p = 0
        siege_d = 0.000
        siege_breaches = 0
    }
    But it works only when the owner is different from the attacker, it does not work if only controller is different (for example, if rebels control the province, and the attackers own it, such siege code breaks the game). Is there any way to overcome this?
    If the owner have the province, which rebels control in the very beginning of the scenario, and his army is already in that province, there is no automatic siege. The human player has to move the army out of that province and then move the army back to begin the siege.
    And what is "siege_p" and "siege_d"?
    Can we use this code not for sieges but for the land and sea battles? What will it look like?
  4. Along with the province culture parameter in the game, there is also the hidden settlement culture parameter. I do not understand this mechanic very well. Is there any code to set the settlement culture in the scenario file? Like "province = { id = xxx culture = "xxxxx" }" for the province culture. I am asking this because I have a problem. I set the culture of the specific province in my scenario by the code "province = { id = xxx culture = "xxxxx" }". The new culture, of course, differs from the one in the province.txt. But when I start the scenario, sometimes (not every time!) the game just rejects my code and changes the culture of that province to the main culture of its owner. The province contains colonial city (2001 population). I have already broken my head trying to figure out what the reason for this behaviour is, but I have no idea. Recently I began to think about the hidden settlement culture parameter. But most likely it is all about "culture_change = yes" for the continent in the geography.txt. Can I overcome this and dictate the game culture of this province to the game at the very beginning of the scenario? It seems strange to me that the game does not voluntary changes the provinceculture in spite of my code every time, but only sometimes.
Sorry for Engrish.
 
Last edited:
1. Is there any code to add pirates to a specific sea province in the scenario file? Not an event script, but a string for the scenario file. If I add a navalunit then pirates have a navalunit (amazing, right?), not the piratic ships mechanic for a sea province. I just want pirates to be in a certain province from the very start of the scenario. Not via events.
"Pirates are randomly generated (as a built-in event) in empty coastal sea zones (...)"

2. How can I add a permanent casus belli to a country scenario file? I know only the code "casusbelli = { type = temporary expirydate = { year = xxxx } }". With "permanent" instead of "temporary" it does not work. Please, do not write me obvious things about cores and casus belli.

It's going to be permanent in the game when: you attack religious leader or other country have your national province.

Code:
country = {
    tag = ENG
    ai = "england_under_HYW_pre_ai.txt"
    policy = {
        (...)
        }
    culture = { type = "english" }
    treasury = 400.000
    religion = {
        type = catholic
        }
    historicalmonarch = {
        (...)
        }
    diplomacy = {
        relation = { tag = CON value = -100.000 casusbelli = { type = permanent expirydate = { year = 1913 month = january day = 1 } } }
    (...)

3. (...) But it works only when the owner is different from the attacker, it does not work if only controller is different (...)
Probably limitation on the game engine or all cases were not implemented.

4. (...) I set the culture of the specific province in my scenario by the code "province = { id = xxx culture = "xxxxx" }". The new culture, of course, differs from the one in the province.txt. But when I start the scenario, sometimes (not every time!) the game just rejects my code and changes the culture of that province to the main culture of its owner. (...)
I think some colonization rules may apply here. See: https://eu2.paradoxwikis.com/Colony & https://eu2.paradoxwikis.com/Colonization and also keep in mind about this: FTG\Db\Map\geography.txt

Code:
#Continents:
#id = X                             Used as UNIQUE value of a single list in the script engine for continents, regions and areas. Target a random city province of the continent, region or area. X = 1 means value = -1001 for the script engine (default is 0 and not taken in account in the script engine if not specified).
#culture_change = yes/no            If yes, culture of the colonial cities turns to primary culture of the country when nationalism fades away (default is yes if not specified).
#can_convert_culture = yes/no       If yes, provinces with annexable religions will convert culture also when converted to a non-annexable religion (default is yes if not specified).

#Regions:
#id = X                             Same as continent.
#can_convert_culture = yes/no       If yes, provinces with annexable religions will convert culture also when converted to a non-annexable religion (default is the continent setting if not specified).
 
Last edited:
  • 1Like
Reactions:
  1. Along with the province culture parameter in the game, there is also the hidden settlement culture parameter. I do not understand this mechanic very well. Is there any code to set the settlement culture in the scenario file? Like "province = { id = xxx culture = "xxxxx" }" for the province culture. I am asking this because I have a problem. I set the culture of the specific province in my scenario by the code "province = { id = xxx culture = "xxxxx" }". The new culture, of course, differs from the one in the province.txt. But when I start the scenario, sometimes (not every time!) the game just rejects my code and changes the culture of that province to the main culture of its owner. The province contains colonial city (2001 population). I have already broken my head trying to figure out what the reason for this behaviour is, but I have no idea. Recently I began to think about the hidden settlement culture parameter. But most likely it is all about "culture_change = yes" for the continent in the geography.txt. Can I overcome this and dictate the game culture of this province to the game at the very beginning of the scenario? It seems strange to me that the game does not voluntary changes the provinceculture in spite of my code every time, but only sometimes.
Sorry for Engrish.
Colonies usually change their provinceculture to that of the owner if the owner sends another successfull colonist there or converts a pagan province to it´s own religion.

That is blocked by "culture_change = no" for Europe in geography.txt for the continent.
It may also be blocked for regions.
Read the help text at the top of geography.txt:

Code:
#Continents:
...
#can_convert_culture = yes/no       If yes, provinces with annexable religions will convert culture also when converted to a non-annexable religion (default is yes if not specified).
...
#Regions:
...
#can_convert_culture = yes/no       If yes, provinces with annexable religions will convert culture also when converted to a non-annexable religion (default is the continent setting if not specified).
 
  1. Is there any code to add pirates to a specific sea province in the scenario file? Not an event script, but a string for the scenario file. If I add a navalunit then pirates have a navalunit (amazing, right?), not the piratic ships mechanic for a sea province. I just want pirates to be in a certain province from the very start of the scenario. Not via events.

Not that I know of. But why not use either the chance the game offers or an event?

In geography.txt you can adjust the number and frequency of pirates appearing

Code:
#piracy = low/medium/high           Frequency and number of pirates in the region (default is medium if not specified)
#                                   - increased effect on coastal sea zones if high piracy for the region.
#                                   - reduced effect in coastal sea zones of the region for each low piracy neighbouring coastal province.

An in events you can either add pirates or privateers

Code:
command = { type = pirates which = x value = y }
Adds y pirate vessels in province x.

command = { type = privateers which = x }
Commission privateers in province x - same effect as "Commission Privateers" button
 
1. Pirate ships are ships owned by Pirates. They may appear slightly different when you code them in the scenario file, but they should operate the same way. What differences are you seeing?

2. As luk3Z said, type = permanent is legal and should work (i.e. should mean that the CB does not disappear after it is used once). What do you mean by "does not work"?

3. I'm not sure why the combat doesn't start correctly when the owner is the one sieging. Can you send me a test file so I can debug?

Land and sea combats are found near the end of a save file. They look like this:
Code:
combat = {
	id = { type = 4712 id = 36286 }
	type = land
	province = 662
	date = { day = 0 month = january year = 1420 }
	morale = { 2.5625 1.7475 }
	attackers = { { type = 4712 id = 36278 } }
	defenders = { { type = 4712 id = 13673 } { type = 4712 id = 19459 } { type = 4712 id = 4745 } { type = 9423 id = 996 } }
}
You should be able to include such blocks into scenario files. Attackers and defenders are simply lists of unit IDs.

The siege parameters are explained well in the EU2 Wiki. FTG sieges work exactly the same way.

4. Others have explained well already, but this is because of culture_change = yes in geography.txt. If you set the population to 5000 or above, so that it is a full city and not a colonial city, I believe that should stop the game from changing the culture.
 
Last edited:
  • 1Like
Reactions:
1. Lol, man. I wrote twice in two lines: "Not an event script", "Not via events". And then you write to me about events. Are you kidding me?
2. But I expected you to write here on the basics of core provinces and casus belli mechanic after my "Please, do not write to me obvious things about cores and casus belli". You lose your grip.

1. If I add an ordinary navalunit for PIR, they just stay there on board or even go to the adjacent province, until someone sinks them. But they do not want to become those little pirate icons on the province screen.
2. "relation = { tag = XXX value = -100.000 casusbelli = { type = permanent } }" without "expirydate" does not work. "relation = { tag = XXX value = -100.000 casusbelli = { type = permanent expirydate = { year = xxx } } }" works like a temporary casusbelli. I mean it expires.
By the way, is there a list of commands for this diplomatic field somewhere? I know only temporary casusbelli, "trade = yes", "refusetrade = yes", "access = yes" and guaranteeing. What about diplomatic warning?
I met the code "refusetrade = "no" in other people's mods, but I did not find that it somehow worked in the game. Many tests. It does not prevent the embargo from AI.
3. Thank you for the combat code.
The game crashes with an error when loading the scenario, if the scenario file contains the siege in the province, with the attackers=owner and controller=somebody else (REB or others). But everything is ok if the enemy not only controls, but also owns that province (attacker does not own it). I did a lot of test, this is not some mistake-misprint with ownership/controllership.
4. It seems strange to me that the game does not ignore my command "province = { id = xxx culture = "xxxxx" }" every time, but from time to time. Sometimes the game uses my culture for that certain province with a colonial city (2001), but sometimes (on the very first day of the scenario, not after expanding or missioners) I see there wrong culture (main culture of the owner country). No nationalism.
 
Last edited:
For three of those questions, the easiest answer is to do it in-game and save the game, then look at the save.

Pirate fleets are saved as navalunits belonging to PIR.
Warnings are saved as "warned = { <date> }".
Sieges look like this:
Code:
combat = {
	id = { type = 4712 id = 6383 }
	type = siege
	province = 662
	date = { day = 20 month = january year = 1419 }
	morale = { 1.8358 2.5625 }
	attackers = { { type = 9423 id = 988 } }
	fortress = { inf = 5000 cav = 0 art = 0 }
	siege_p = 0
	siege_d = 0.0000
	siege_breaches = 0
}
This is a siege of a rebel-controlled province by CHI, and it loads perfectly fine.

I met the code "refusetrade = "no" in other people's mods, but I did not find that it somehow worked in the game. Many tests. It does not prevent the embargo from AI.
refusetrade = no just means there is not currently an embargo. It doesn't prevent one in the future.

4. It seems strange to me that the game does not ignore my command "province = { id = xxx culture = "xxxxx" }" every time, but from time to time. Sometimes the game uses my culture for that certain province with a colonial city (2001), but sometimes (on the very first day of the scenario, not after expanding or missioners) I see there wrong culture (main culture of the owner country). No nationalism.
I'm not sure why it would vary. It should be 100% of the time when the city is less than 5000 population, is on a continent with culture_change = yes, has no nationalism, and has a culture that is not accepted by the owner.
 
Sieges look like this:
Code:
combat = {
    id = { type = 4712 id = 6383 }
    type = siege
    province = 662
    date = { day = 20 month = january year = 1419 }
    morale = { 1.8358 2.5625 }
    attackers = { { type = 9423 id = 988 } }
    fortress = { inf = 5000 cav = 0 art = 0 }
    siege_p = 0
    siege_d = 0.0000
    siege_breaches = 0
}
This is a siege of a rebel-controlled province by CHI, and it loads perfectly fine.
Hm. I should make more tests. What date do you use in the "date = { day = 20 month = january year = 1419 }"? What is it? I thought it is the date when the siege began, and therefore it should be in the past. Your example is from some scenario with a startdate later than 20 january 1419?
 
1. Lol, man. I wrote twice in two lines: "Not an event script", "Not via events". And then you write to me about events. Are you kidding me?
No. As I know of no way to add pirates in the scenario at the start of the game I simply pointed out what I know is possible and asked why not use that.
Up to now you gave no reason why it makes a difference if a pirate starts the scenario in a sea zone or if it is added the moment the scenario starts with an event.

2. But I expected you to write here on the basics of core provinces and casus belli mechanic after my "Please, do not write to me obvious things about cores and casus belli". You lose your grip.
That had already been answered by luk3Z.

...
By the way, is there a list of commands for this diplomatic field somewhere?

3. Thank you for the combat code.
The game crashes with an error when loading the scenario, if the scenario file contains the siege in the province, with the attackers=owner and controller=somebody else (REB or others). But everything is ok if the enemy not only controls, but also owns that province (attacker does not own it). I did a lot of test, this is not some mistake-misprint with ownership/controllership.
Have you tried using the FtG validator on your mod to see what errors might be in it?
 
Last edited:
Hm. I should make more tests. What date do you use in the "date = { day = 20 month = january year = 1419 }"? What is it? I thought it is the date when the siege began, and therefore it should be in the past. Your example is from some scenario with a startdate later than 20 january 1419?
That's from a game I saved on January 24th. You're correct that it's the date the siege began. What kind of errors are you getting?