• 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.

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
Two questions -

First, is it possible to force a game rule via an event or decision ? Specifically I want to make sure that there is no interaction with China, even if the player forgets to turn it off.

Secondly, and very much related - is it possible to definitively kill of the Western Governor ? In my mod China does not exist so I have set active = no for all Duke level and above titles (including the Western Governor) but for some reason he is always there on day one. I assume some sort of event or effect is doing this - which one ? And no, it does not seem to be in the on_startup list of events.

Thanks in advance.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
Two more questions -

First, how do I return the number of provinces with a given culture for a trigger ? I have a series of narrative events that I want to fire once a certain portion of the map is covered with a certain culture. Ideally I would like to be able to say "If number of provinces with culture = (x, y, z...) > 1000 then trigger satisfied so do the event.

Anyone know what the syntax is here ?

Second, how do I check if a given province has a certain culture or religion ? I know that this should be an easy one but for the life of me I don't now how. Again, the ideal syntax would be something like "If culture of province X is "human" then do event".

Again, anyone know the syntax ?
 

klopkr

Chief suggester at the suggestion factory
106 Badges
Aug 12, 2013
8.769
15.278
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Call to arms event
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Humble Paradox Bundle
  • Europa Universalis IV: Dharma
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings II: Holy Fury
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III Complete
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: The Republic
  • Prison Architect
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV
  • Cities: Skylines - Parklife
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Stellaris: Distant Stars
  • Crusader Kings II: Conclave
  • Surviving Mars: First Colony Edition
  • The Showdown Effect
  • War of the Roses
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Stellaris: Humanoids Species Pack
Is there any way to set a government potential to be based on a trait or whether or not holding is held by a holy order?

I've tried the following:

Code:
potential = {
holy_order = yes
}

potential = {
trait = brahmin
}

potential = {
primary_title = { has_title_flag = holy_order }
}

potential = {
primary_title = d_teutonic_order
}

None of these seem to ever work. I've seen other mods use the trait one but it doesn't work for me.

Am I missing something?
 
Last edited:

Thezezeal

Captain
3 Badges
Dec 28, 2014
375
3
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Charlemagne
Two more questions -

First, how do I return the number of provinces with a given culture for a trigger ? I have a series of narrative events that I want to fire once a certain portion of the map is covered with a certain culture. Ideally I would like to be able to say "If number of provinces with culture = (x, y, z...) > 1000 then trigger satisfied so do the event.

Anyone know what the syntax is here ?

Second, how do I check if a given province has a certain culture or religion ? I know that this should be an easy one but for the life of me I don't now how. Again, the ideal syntax would be something like "If culture of province X is "human" then do event".

Again, anyone know the syntax ?
I believe the first part is simply just using the 'count' command, which the Wiki says can be used with any of the any_ scopes. So I believe it would be as simple as :

Code:
trigger = {
 any_province = {
  count = 1000
  culture = english
 }
}

to check if 1000 Provinces were English culture. I've never tried it myself, but from what I am reading, that seems correct.

To check a certain Province, you should be able to just scope to it via it's Province Id :

Code:
trigger = {
 province_id = 1
 culture = english
}

That would check the Province met the conditions when the Event tried to fire, or you could use an If Statement from another event. E,G:

Code:
option = {
 if = {
  limit = {
   1 = {
    culture = english
   }
  }
  #Do Something
 }
}

My Question: It's probably something you can do, but should not do, but the Game allows for emperor within emperor titles--so you could have e_Europe as the next step up from e_britannia, for example. The problem is that 'de_jure_liege' does not apparently work if you try this. It will work for c_, d_, and k_ titles, but seems to fail on an e_ (probably because it's not meant to); is there any way to script around that, would anyone know?[/Code]
 
Last edited:

abian363

Domuit Hispania
13 Badges
Feb 27, 2017
454
7
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV
  • Victoria 2
  • Crusader Kings II: Way of Life
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Monks and Mystics
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Sunset Invasion
Hi, so I´m trying to make this event pop but I don´t know why it doesn´t, it works by command
Code:
narrative_event = {
    id = ale.1
    title = ale.1.name
    desc = ale.1.desc
    picture = GFX_evt_battle_visigothic
    border = GFX_event_narrative_frame_war
    
    ai = no

    trigger = {
        only_independent = yes
        completely_controls = d_lugdunum
        culture = gallic
        NOT = { has_global_flag = alesia_avenged }
    }
    
    mean_time_to_happen = {
        days = 1
    }
    
    option = {
        name = ale.1.a
        set_global_flag = alesia_avenged
        prestige = 150
    }
}
 

WWeimar

Recruit
9 Badges
Aug 26, 2016
4
0
  • Crusader Kings II
  • Europa Universalis III
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
I am trying to mod vanilla CBs (00_cb_types) in that way, that only characters with a specific trait (e.g. "Brave") could declare wars.

So that:

Code:
can_use = {
FROM = { trait = brave }
}

Unfortunately, for some reason, even if the character has the specified trait, he is unable to declare war: the CB just does not appear in the list.
Could someone please tell me, where could the mistake be? I understand, that it is very basic thing and the mistake I made is likely to be very stupid, but I could not find it for the last couple of days.
Will be very thankful for any help.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
Hi, so I´m trying to make this event pop but I don´t know why it doesn´t, it works by command
Code:
narrative_event = {
    id = ale.1
    title = ale.1.name
    desc = ale.1.desc
    picture = GFX_evt_battle_visigothic
    border = GFX_event_narrative_frame_war
   
    ai = no

    trigger = {
        only_independent = yes
        completely_controls = d_lugdunum
        culture = gallic
        NOT = { has_global_flag = alesia_avenged }
    }
   
    mean_time_to_happen = {
        days = 1
    }
   
    option = {
        name = ale.1.a
        set_global_flag = alesia_avenged
        prestige = 150
    }
}


First off, I assume that you have defined d_lugdunum and the gallic culture, but it pays to make sure that you have the correct spelling.

Secondly and more obviously, there is no condition called only_independent, just use independent. That's my bet as to the problem.
 

abian363

Domuit Hispania
13 Badges
Feb 27, 2017
454
7
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV
  • Victoria 2
  • Crusader Kings II: Way of Life
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Monks and Mystics
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Sunset Invasion
First off, I assume that you have defined d_lugdunum and the gallic culture, but it pays to make sure that you have the correct spelling.

Secondly and more obviously, there is no condition called only_independent, just use independent. That's my bet as to the problem.
I tried first without only_independent or just independent when adding, I thought I should specify more
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
I believe the first part is simply just using the 'count' command, which the Wiki says can be used with any of the any_ scopes.
:
To check a certain Province, you should be able to just scope to it via it's Province Id.
:
My Question: It's probably something you can do, but should not do, but the Game allows for emperor within emperor titles--so you could have e_Europe as the next step up from e_britannia, for example. The problem is that 'de_jure_liege' does not apparently work if you try this. It will work for c_, d_, and k_ titles, but seems to fail on an e_ (probably because it's not meant to); is there any way to script around that, would anyone know?[/Code]


Thanks for that, I pretty much got the same answer by futzing around with the vanilla files. The Wiki is not clear as to when ordering is important and when it isn't, my end result had the 'count' command last on the assumption that I had to screen forst for culture and then by number.

As to province ID, again I got there after a lot of baloney. The game isn't clear as to when province ID should be used instead of the county name, I got there in the end.

Re: Your query - I did not know you could even do that ! Based on what you said though I wouldn't think that the problem is solvable - 'de_jure_liege' not looking up for kings and below but not emperors would IMO be hard coded. Have you thought about lowering you other titles to match or alternatively try putting a king above your emperor ? Very kludgy but it might work.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
I tried first without only_independent or just independent when adding, I thought I should specify more

The only other thing that I can think of is that while the title and desc are just tags, they may need to have a number on the end, just like the id number does. Try changing the tags from ale.1.name to name.ale.1 and from ale.1.desc to desc.ale.1

Don't forget to change your localization keys !
 

LordPeter

Marjoram
49 Badges
Mar 5, 2012
2.249
382
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
@Rags17: I just want to add that I just recently found out there is apparently a "regional_percentage" condition, where you can check whether some other condition is fulfilled in X % of a specific region. Might be handy if you only want to check part of the world.
If you want absolute numbers instead of percentage, then of course use the "count" thing.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
I am trying to mod vanilla CBs (00_cb_types) in that way, that only characters with a specific trait (e.g. "Brave") could declare wars.

So that:

Code:
can_use = {
FROM = { trait = brave }
}

Unfortunately, for some reason, even if the character has the specified trait, he is unable to declare war: the CB just does not appear in the list.
Could someone please tell me, where could the mistake be? I understand, that it is very basic thing and the mistake I made is likely to be very stupid, but I could not find it for the last couple of days.
Will be very thankful for any help.


FROM is the target, ROOT is the attacker.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
@Rags17: I just want to add that I just recently found out there is apparently a "regional_percentage" condition, where you can check whether some other condition is fulfilled in X % of a specific region. Might be handy if you only want to check part of the world.
If you want absolute numbers instead of percentage, then of course use the "count" thing.

Thanks for that, it seems to work as planned for now. AFAIK there are around 1355 counties on the full 2.8.1 map so I am just setting the target to an arbitrarily high number like 1000.

What I would like to do now though is check every year and spit out the number of counties currently converted. My mod has humans replacing Neanderthals and I want the whole process to happen in around 200 game years (which represents 40,000 years), so far it seems to work as planned but I would actually like to be able to see just what 355 or 200 or 500 remaining counties looks like so I can adjust my target accordingly.
 

LordPeter

Marjoram
49 Badges
Mar 5, 2012
2.249
382
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
@Rags17: Actually I needed something like that for the early stages of my old mod, if I understand you correctly: You want an event to fire every year, and print you the number of provinces that are currently of a certain culture in the world?
Then your best bet are variables, the incredibly useful tool for every situation:
Code:
# reset variable every year
set_variable = {
    which = global_number_of_neanderthal_provinces
    value = 0
}
# calculate the number of provinces
any_province = {    # obviously expensive scope, so only fire rarely
    limit = {
        culture = neanderthal
    }
    change_variable = {
        which = global_number_of_neanderthal_provinces    # <- "global_" prefix makes variable global, so scope is irrelevant
        value = 1
    }
}
Fire something like this in a single, yearly event, and have its event option display the variable via localization. The "change_variable" within the "any_province" scope will behave almost like a mini "while" loop (well, not really, but that's how I imagine it in my head ^^), increasing the variable by exactly one for every province that matches the limit.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
@Rags17: Actually I needed something like that for the early stages of my old mod, if I understand you correctly: You want an event to fire every year, and print you the number of provinces that are currently of a certain culture in the world?
Then your best bet are variables, the incredibly useful tool for every situation:
Code:
# reset variable every year
set_variable = {
    which = global_number_of_neanderthal_provinces
    value = 0
}
# calculate the number of provinces
any_province = {    # obviously expensive scope, so only fire rarely
    limit = {
        culture = neanderthal
    }
    change_variable = {
        which = global_number_of_neanderthal_provinces    # <- "global_" prefix makes variable global, so scope is irrelevant
        value = 1
    }
}
Fire something like this in a single, yearly event, and have its event option display the variable via localization. The "change_variable" within the "any_province" scope will behave almost like a mini "while" loop (well, not really, but that's how I imagine it in my head ^^), increasing the variable by exactly one for every province that matches the limit.

@LordPeter - That looks fantastic ! My only enhancement would be to turn it into a character decision - I am currently running endless tests on observer mode at max speed, naturally I don't get any pop ups or anything so my best bet would be to pause, play a random character, fire the decision, then go back to observer mode.

I'll give this a try, thanks again !
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
@Rags17: Actually I needed something like that for the early stages of my old mod, if I understand you correctly: You want an event to fire every year, and print you the number of provinces that are currently of a certain culture in the world?
Then your best bet are variables, the incredibly useful tool for every situation:
Code:
# reset variable every year
set_variable = {
    which = global_number_of_neanderthal_provinces
    value = 0
}
# calculate the number of provinces
any_province = {    # obviously expensive scope, so only fire rarely
    limit = {
        culture = neanderthal
    }
    change_variable = {
        which = global_number_of_neanderthal_provinces    # <- "global_" prefix makes variable global, so scope is irrelevant
        value = 1
    }
}
Fire something like this in a single, yearly event, and have its event option display the variable via localization. The "change_variable" within the "any_province" scope will behave almost like a mini "while" loop (well, not really, but that's how I imagine it in my head ^^), increasing the variable by exactly one for every province that matches the limit.

Update - It doesn't seem to be working ! I have tried multiple variations of your code but the variable doesn't want to show up. FWIW here is the event code and the localization keys -

Code:
namespace = dawn

character_event = {
    id = dawn.060
    title = EVTTITLEdawn.060
    desc = EVTDESCdawn.060
    picture = GFX_evt_70000_BP
   
    is_triggered_only = yes
   
    immediate = {
        set_variable = {
            which = global_number_of_human_provinces
            value = 0
        }
        any_province = {
            limit = { culture = human }
            change_variable = {
                which = global_number_of_neanderthal_provinces
                value = 1
            }
        }
    }
   
    option = {
        name = EVTOPTAdawn.060
    }
}
Code:
EVTTITLEdawn.060;The Human Tally;;;;;;;;;;;;
EVTDESCdawn.060;Humans now occupy [global_number_of_human_provinces] of the 1355 provinces on the map;;;;;;;;;;;;
EVTOPTAdawn.060;Excellent !;;;;;;;;;;;;

Any suggestions ?

(PS - It is run via the on_yearly_pulse on_action and fires no problem, its just that the variable text global_number_of_human_provinces is missing).
 

LordPeter

Marjoram
49 Badges
Mar 5, 2012
2.249
382
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
Hmm, that's a pity. I personally was using it as a local variable on the character itself, because I also only checked the demesne. However, I see no reason why it should not work with global variables - unless you for some reason have to call them differently in the localization.
I have no time to test it myself right now, but can you try to add different scopes to the localization call first? Like
Code:
EVTDESCdawn.060;Humans now occupy [Root.global_number_of_human_provinces] of the 1355 provinces on the map;;;;;;;;;;;;
or something else - the scope shouldn't really matter because it is a global variable, but you never know.
If this doesn't work, you could try the same thing with "local" variables, i.e. ditch the "global_" prefix and always scope to your player character first. That at least should work, because I have done it myself in the past.
 

Rags17

Ludere Ludum
62 Badges
Dec 11, 2014
5.953
3.631
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Mass Transit
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: La Resistance
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
Hmm, that's a pity. I personally was using it as a local variable on the character itself, because I also only checked the demesne. However, I see no reason why it should not work with global variables - unless you for some reason have to call them differently in the localization.
I have no time to test it myself right now, but can you try to add different scopes to the localization call first? Like
Code:
EVTDESCdawn.060;Humans now occupy [Root.global_number_of_human_provinces] of the 1355 provinces on the map;;;;;;;;;;;;
or something else - the scope shouldn't really matter because it is a global variable, but you never know.
If this doesn't work, you could try the same thing with "local" variables, i.e. ditch the "global_" prefix and always scope to your player character first. That at least should work, because I have done it myself in the past.

Thanks for that, I'll give that a try