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

Azzarrel

Sergeant
63 Badges
Jul 20, 2015
52
13
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Cossacks
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Magicka
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Megacorp
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Crusader Kings II: Conclave
  • Victoria 2
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Snowfall
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
i am trying to write my own little mod for ck2. I may advance slowly, but i start to learn how things work thanks to the modding wiki.
However I do not really understand how factors work. I mostly need factors for 'ai_will_do', but i couldn't figure out how different numbes change this.
Let's say there is a targetted_decision to steal money from your liege if you are steward.
I know that 1 = 100% chance every month for each allowed target, so if i write
Code:
       ai_will_do = {
           factor = 1    
[...]
it would mean that every steward will steal at least once (or exactly once?)per month money from his liege .
Now lets change the factor to 0.1, so there is a 10% chance for the ai to steal money from their liege, but the chance will increase if the ai is greedy or hates their liege.
Code:
modifier = {
               factor = 0.5
               FROM = {
                   trait = greedy
               }
           }
Does this change the factor now (so instead of 0.1 the chance is now 0.5), does it add to the base factor (so instead of 0.1 the chance is now 0.6) or does it mulitply with the base factor (so instead of 0.1 the chance would now be 0.05)?

Same question if more than one modifier applies. (so +0.5 from greedy and +0.5 from hate)

And what if i want to lower the chance if the steward has the trait 'just'
Do i have to add a negative factor ? Do i have to add a factor lower than the base factor?

Now I've seen this in way_of_life_decisions.txt for seduction
Code:
       ai_will_do = {
           factor = 1        # 1 = 100% chance every month (for each allowed target!)
           modifier = {
               factor = 0.05
           }
[...]
what is the modifier for?
It doesn't have any requirements, so why not just set the base factor to 0.05? Isn't that just redundant?
 

saladinayyub

Corporal
11 Badges
Jul 5, 2015
36
1
  • 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: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
Are you saying this code isn't working? When you start after 1163 he's still Jewish?

The quotes shouldn't matter, but you should put sympathy_judaism and hajjaj after his conversion using add_trait (I believe that putting them before the religion line, let alone putting them before a historical instruction to change religion, will simply remove them and they won't properly appear). That shouldn't prevent him from turning Sunni though, so please clarify the exact problem you're having.

Thanks it really doesn't make any sense for him to go on hajj when he is still jewish missed that LOL
 

jursamaj

General
125 Badges
Aug 20, 2012
2.360
216
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III
  • Heir to the Throne
  • Knights of Pen and Paper +1 Edition
  • Cities in Motion
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Leviathan: Warships
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • 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
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III Complete
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Europa Universalis III Complete
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: No Step Back
i am trying to write my own little mod for ck2. I may advance slowly, but i start to learn how things work thanks to the modding wiki.
However I do not really understand how factors work. I mostly need factors for 'ai_will_do', but i couldn't figure out how different numbes change this.
Let's say there is a targetted_decision to steal money from your liege if you are steward.
I know that 1 = 100% chance every month for each allowed target, so if i write
Code:
       ai_will_do = {
           factor = 1   
[...]
it would mean that every steward will steal at least once (or exactly once?)per month money from his liege .
Now lets change the factor to 0.1, so there is a 10% chance for the ai to steal money from their liege, but the chance will increase if the ai is greedy or hates their liege.
Code:
modifier = {
               factor = 0.5
               FROM = {
                   trait = greedy
               }
           }
Does this change the factor now (so instead of 0.1 the chance is now 0.5), does it add to the base factor (so instead of 0.1 the chance is now 0.6) or does it mulitply with the base factor (so instead of 0.1 the chance would now be 0.05)?

Same question if more than one modifier applies. (so +0.5 from greedy and +0.5 from hate)

And what if i want to lower the chance if the steward has the trait 'just'
Do i have to add a negative factor ? Do i have to add a factor lower than the base factor?

Now I've seen this in way_of_life_decisions.txt for seduction
Code:
       ai_will_do = {
           factor = 1        # 1 = 100% chance every month (for each allowed target!)
           modifier = {
               factor = 0.05
           }
[...]
what is the modifier for?
It doesn't have any requirements, so why not just set the base factor to 0.05? Isn't that just redundant?
Yes, I believe it is currently redundant to do base factors below 1 that way. Perhaps it wasn't at one time, and they never changed the old stuff.

Factors multiply. A factor of 2 doubles the chance, while a factor of .5 halves the chance. If there are multiple valid factors, multiply them all together.
 

mdman1

Second Lieutenant
31 Badges
Jul 26, 2012
170
94
  • Crusader Kings II
  • Heir to the Throne
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings III
  • Imperator: Rome Sign Up
  • Imperator: Rome
  • Crusader Kings II: Holy Fury
  • Shadowrun: Dragonfall
  • BATTLETECH - Backer
  • Crusader Kings II: Jade Dragon
  • Age of Wonders III
  • BATTLETECH
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Magicka 2
  • Crusader Kings II: Way of Life
  • 500k Club
  • Europa Universalis IV
Is there any mod that extends the finishing date? I know theres an endless timeline mod in EU4 but I've don't recall seeing one in CK2. I always feel uncomfortable starting in later start dates as I feel I don't have enough time.
 

Ceranai

Major
64 Badges
May 21, 2013
738
719
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Divine Wind
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Can anyone help me add a timer to the following code? at teh moment it is firing twice when I only want it to fire on teh 25th December it also fires 14th January:
Code:
character_event = {
    id = YULE.200#

    hide_window = yes

    religion = pagan

    trigger = {
        controls_religion = yes
        month = 11
    }

    immediate = {

       character_event = { id = YULE.201 days = 20 }
    }
}

character_event = {
    id = YULE.201

    hide_window = yes
    is_triggered_only = yes

    immediate = {
        any_playable_ruler = { character_event = { id = YULE.202 days 4 } }
    }
}

narrative_event = {
    id = YULE.202
   desc = YULE.202
   
       is_triggered_only = yes
       only_playable = yes
       immediate {
       set_character_flag = christmascooldown
       }
       option {
           name = YULE.202A
           trigger = {
           only_playable = yes
           }
           add_trait = immortal
       }   
}
 

Azzarrel

Sergeant
63 Badges
Jul 20, 2015
52
13
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Cossacks
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Magicka
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Megacorp
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Crusader Kings II: Conclave
  • Victoria 2
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Snowfall
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
Is there any mod that extends the finishing date? I know theres an endless timeline mod in EU4 but I've don't recall seeing one in CK2. I always feel uncomfortable starting in later start dates as I feel I don't have enough time.

guess all you have to do is to alter end_date in definies.txt in *yoursteamlibraryfile*/crusader kings 2/common
there are also various mods on the workshop just search for 'longer game'
 
Last edited:

loup99

Godogost of Armorica
78 Badges
Jan 22, 2013
16.589
6.382
  • Crusader Kings III
  • Europa Universalis IV
  • Warlock 2: The Exiled
  • 500k Club
  • Pride of Nations
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Crusader Kings Complete
  • Imperator: Rome Deluxe Edition
  • Victoria 2
  • Arsenal of Democracy
  • Cities in Motion
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III: Chronicles
  • For The Glory
  • Hearts of Iron III
  • March of the Eagles
  • Rome Gold
  • Sengoku
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Cities: Skylines
  • Europa Universalis IV: Pre-order

Ceranai

Major
64 Badges
May 21, 2013
738
719
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Divine Wind
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Still hoping for an answer to my last question but here is another, how do i add this building in so it only appears via the associated event?
Code:
castle = {
   # toy_factory
   toy_factory = {
   desc = toy_factory_desc
       trigger= { has_character_flag = toy_factory_owner }
       gold_cost = 1
       build_time = 1
       light_infantry = 50

   }
}

Code:
character_event = { #toy factory is built in capital
    id = YULE.203

    hide_window = yes
    is_triggered_only = yes

    immediate = {
       add_character_flag = toy_factory_owner
        add_building = toy_factory
    }

}
 

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
657
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
Still hoping for an answer to my last question but here is another, how do i add this building in so it only appears via the associated event?
Code:
castle = {
   # toy_factory
   toy_factory = {
   desc = toy_factory_desc
       trigger= { has_character_flag = toy_factory_owner }
       gold_cost = 1
       build_time = 1
       light_infantry = 50

   }
}

Code:
character_event = { #toy factory is built in capital
    id = YULE.203

    hide_window = yes
    is_triggered_only = yes

    immediate = {
       add_character_flag = toy_factory_owner
        add_building = toy_factory
    }

}

The add_building must be in the scope of the holding you want it to be built in.
 

Ceranai

Major
64 Badges
May 21, 2013
738
719
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Divine Wind
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis III Complete
  • Europa Universalis III Complete
The add_building must be in the scope of the holding you want it to be built in.

Thank you, however it is still not working:
building
Code:
castle = {
   # toy_factory
   toy_factory = {
       desc = toy_factory_desc
       trigger = { always = no }
       gold_cost = 1
       build_time = 1
       light_infantry = 50

   }
}

event
Code:
character_event = { #toy factory is built in capital
    id = YULE.203

    hide_window = yes
    is_triggered_only = yes

    immediate = {
       scope = capital_holding
       add_building = toy_factory
    }

}

I gave up trying to hide it while i try to fix the event. what is wrong now? It appears as a building in all teh castles but when I use the event it doesnt build
 

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
657
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
Thank you, however it is still not working:
building
Code:
castle = {
   # toy_factory
   toy_factory = {
       desc = toy_factory_desc
       trigger = { always = no }
       gold_cost = 1
       build_time = 1
       light_infantry = 50

   }
}

event
Code:
character_event = { #toy factory is built in capital
    id = YULE.203

    hide_window = yes
    is_triggered_only = yes

    immediate = {
       scope = capital_holding
       add_building = toy_factory
    }

}

I gave up trying to hide it while i try to fix the event. what is wrong now? It appears as a building in all teh castles but when I use the event it doesnt build

Two, things:
-I'm not sure, but maybe the trigger = { always = no } is forbidding the code to adding the building eve if you specifically use add_building

-Most importantly, your event code is wrong. It should be:
Code:
character_event = { #toy factory is built in capital
    id = YULE.203

    hide_window = yes
    is_triggered_only = yes

    immediate = {
       capital_holding = {
         add_building = toy_factory
       }
    }

}
 

Ceranai

Major
64 Badges
May 21, 2013
738
719
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Divine Wind
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Two, things:
-I'm not sure, but maybe the trigger = { always = no } is forbidding the code to adding the building eve if you specifically use add_building

-Most importantly, your event code is wrong. It should be:
Code:
character_event = { #toy factory is built in capital
    id = YULE.203

    hide_window = yes
    is_triggered_only = yes

    immediate = {
       capital_holding = {
         add_building = toy_factory
       }
    }

}
Ah you are a life saver.

Here is another question for you, how do i work out what teh localisation key for things should be?
upload_2016-12-23_16-30-10.png
That should be showing
+1000 toy soldiers
-5 spouse opinion
+5 city opinion, its code is now
Code:
    # toy_factory
   toy_factory = {
       desc = toy_factory_desc
       trigger = { always = yes }
       gold_cost = 1
       build_time = 1
       toy_soldier = 1000
       spouse_opinion = -5
       city_opinion = 5
       tech_growth_modifier = 1.1

   }
}
 

sdijkens

Captain
61 Badges
Dec 31, 2014
335
291
  • Crusader Kings II: Sword of Islam
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Mare Nostrum
  • Magicka
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Crusader Kings II
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Megacorp
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Stellaris: Nemesis
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Way of Life
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Sengoku
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
I am confused. Is the event where you can enter your child's name when it is born in events or not?
It doesn't fire in my mod, I thought this was because I replaced the events path in my mod file.
But I can't find the event in the vanilla events either.

My mod file:
Code:
replace_path = "history/characters"
replace_path = "history/diplomacy"
replace_path = "history/provinces"
replace_path = "history/titles"
replace_path = "history/wars"
replace_path = "history/technology"
replace_path = "history/eu4_converter"
replace_path = "common/cultures"
replace_path = "common/religions"
replace_path = "common/dynasties"
replace_path = "common/landed_titles"
replace_path = "common/trade_routes"
replace_path = "common/province_setup"
replace_path = "events"
replace_path = "music"
replace_path = "tutorial"

All I am trying to achieve is to have the event fire again, I don't seek to modify it since I think that won't be possible for a couple of reasons. If that is possible however then I would love to hear about it :p
 

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
657
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
I am confused. Is the event where you can enter your child's name when it is born in events or not?
It doesn't fire in my mod, I thought this was because I replaced the events path in my mod file.
But I can't find the event in the vanilla events either.

My mod file:
Code:
replace_path = "history/characters"
replace_path = "history/diplomacy"
replace_path = "history/provinces"
replace_path = "history/titles"
replace_path = "history/wars"
replace_path = "history/technology"
replace_path = "history/eu4_converter"
replace_path = "common/cultures"
replace_path = "common/religions"
replace_path = "common/dynasties"
replace_path = "common/landed_titles"
replace_path = "common/trade_routes"
replace_path = "common/province_setup"
replace_path = "events"
replace_path = "music"
replace_path = "tutorial"

All I am trying to achieve is to have the event fire again, I don't seek to modify it since I think that won't be possible for a couple of reasons. If that is possible however then I would love to hear about it :p

Nope, sorry, that's hardcoded. On the other hand, I think that there is a command set_name, but you cannot get user imput for that, just a string you decide when scripting the event.

Ah you are a life saver.

Here is another question for you, how do i work out what teh localisation key for things should be?
That should be showing
+1000 toy soldiers
-5 spouse opinion
+5 city opinion, its code is now
Code:
    # toy_factory
   toy_factory = {
       desc = toy_factory_desc
       trigger = { always = yes }
       gold_cost = 1
       build_time = 1
       toy_soldier = 1000
       spouse_opinion = -5
       city_opinion = 5
       tech_growth_modifier = 1.1

   }
}

The problem here is not localisation, but rather the modifiers themselves:
-spouse opinion and city_opinion are character modifiers, doesn't work on buildings,
-tech_growth_modifier is a province modifier iirc, so it doesn't work either
for the issue with toy_soldier, the most likely explanation is you havent set that up as a special troop type, or its definition is faulty.
 

Ceranai

Major
64 Badges
May 21, 2013
738
719
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Divine Wind
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Nope, sorry, that's hardcoded. On the other hand, I think that there is a command set_name, but you cannot get user imput for that, just a string you decide when scripting the event.



The problem here is not localisation, but rather the modifiers themselves:
-spouse opinion and city_opinion are character modifiers, doesn't work on buildings,
-tech_growth_modifier is a province modifier iirc, so it doesn't work either
for the issue with toy_soldier, the most likely explanation is you havent set that up as a special troop type, or its definition is faulty.


Im pretty sure I set it up properly- in special troops:
Code:
toy_soldier = {
   name = toy_soldier
   morale = 10
   maintenance = 0.01
   phase_skirmish_attack = 0.1
   phase_melee_attack = 0.1
   phase_pursue_attack = 0.1
   phase_skirmish_defense = 0.1
   phase_melee_defense = 0.1
   phase_pursue_defense = 0.1
   base_type = light_infantry
}

and in my localisation file Ive tried to copy the vanilla war elephants definitions:
Code:
toy_soldier;Toy Soldier;;;;;;;;;;;;;x
toy_soldier_offensive;Toy Soldier Offensive;;;;;;;;;;;;;x
toy_soldier_defensive;Toy Soldier Defensive;;;;;;;;;;;;;x
toy_soldier_morale;Toy Soldier Morale;;;;;;;;;;;;;x
 

loup99

Godogost of Armorica
78 Badges
Jan 22, 2013
16.589
6.382
  • Crusader Kings III
  • Europa Universalis IV
  • Warlock 2: The Exiled
  • 500k Club
  • Pride of Nations
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Crusader Kings Complete
  • Imperator: Rome Deluxe Edition
  • Victoria 2
  • Arsenal of Democracy
  • Cities in Motion
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III: Chronicles
  • For The Glory
  • Hearts of Iron III
  • March of the Eagles
  • Rome Gold
  • Sengoku
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Cities: Skylines
  • Europa Universalis IV: Pre-order
No error in the log files.I wasn't thinking adding one province to game would be that hard.How do you do it?Can you explain to me please?
Well, the method I used is step by step identical to the wiki. I don't find it hard though, but here I can't see what issue you have.
 

Ceranai

Major
64 Badges
May 21, 2013
738
719
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Divine Wind
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis III Complete
  • Europa Universalis III Complete
I feel bad for spamming this thread with questions but need help again, sorry :p
Can anyone tell me why
A) YULE.202 fires twice
B) YULE.202 doesnt trigger YULE.203 when the option is selected.
Advice in how to fix these problems would be greatly appreciated... here comes the code...

Code:
character_event = {
    id = YULE.200#

    hide_window = yes

    religion = pagan

    trigger = {
        controls_religion = yes
        month = 11
    }

    immediate = {

       character_event = { id = YULE.201 days = 20 }
    }
}

character_event = {
    id = YULE.201

    hide_window = yes
    is_triggered_only = yes

    immediate = {
        any_playable_ruler = { character_event = { id = YULE.202 days = 1 } }
    }
}

narrative_event = {
    id = YULE.202
   desc = YULE.202
 
       is_triggered_only = yes
       only_playable = yes
       immediate {
       set_character_flag = christmascooldown
       }
       option {
           name = YULE.202A
           trigger = {
           only_playable = yes
           }
           random_list = { #The possible events that can fire
  10 = {
 #   modifier = {
 #     factor = <factor_1>
 #     #Conditions for factor to apply
 #   }
 #   modifier = {
 #   factor = <factor_2>
 #     #Conditions for factor to apply
 #   }
 #Factory Event Prompt
        ROOT = { character_event = { id = YULE.203 days = 1 } }
       }
   } 
}     
     
character_event = { #toy factory is built in capital
    id = YULE.203
   desc = YULE.203
    is_triggered_only = yes

    immediate = {
       capital_holding = {
         add_building = toy_factory
        add_character_flag = toy_factory_enabled
       }
    }
   option {
           name = YULE.203A
           trigger = { always = yes
                   }
           }

}

The idea is that Santa (modded into the history files) spawns the event every christmas for all players, this bit is working (though he then sends it again 14th jan), he then sends out a random event to each player weighted on their karma. this is where the random_list comes in.

Testing YULE.203 by itself it does work.
 
Last edited: