• 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.
Thanks! I have one more question.
In my Hanseatic League mod, I have tried to an event for mayors in which the merchants help the holder of a city by the construction of municipal buildings.
I would add not = { has_building = x } as the key condition, but it doesn't seem to work well (the game doesn't read this trigger).

Is this scripting correct for my puropose?

Code:
    trigger = {
        any_province_lord = {
            limit = {
                is_republic = yes
            }
            any_demesne_title = {
                NOT = { has_building = x }
            }
        }
    }

try with any_demesne_province (instead of any_demesne_title)
 
2) Can someone explain how exactly does MTTH work. For example:

Code:
mean_time_to_happen = {
		months = 12
		
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 0.5
			trait = diligent
		}
		modifier = {
			factor = 5.0
			trait = slothful
		}
		modifier = {
			factor = 5.0
			trait = content
		}

mean_time_to_happen is the average number of months that will pass before the event fires, so for example if you play 100 games in 50 of them the event would have fired by 12 months time, right? Also, what is the distribution around this mean? Will it be all neatly packed around the mean or is the variance larger?

3) In the same event, what do modifiers actually do? Does being ambitious in the above example makes the event twice as unlikely to happen (factor=0.5), meaning that for someone who is ambitious the actual MTTH is 24 months? On the other hand, for someone who is slothful it's five times as likely (actual mtth would be around two months)? Or am I reading it all wrong?

Cheers for any tips.

I think:
MTTH of 12 is translated to a 8.33%/month probability.

Factor of 0.5 converts the MTTH to 6 or 16.66%/ month probability.
Factor of 5 converts the MTTH to 60 or 1.66%/ month probability.

I think the game checks for events to trigger once every 20 days for each character (it is in the defines somewhere)
 
I have a few relatively basic modding questions:

1) Is there a way to make a province modifier present from the start of the game on a single province?

2) Can someone explain how exactly does MTTH work.
mean_time_to_happen is the average number of months that will pass before the event fires, so for example if you play 100 games in 50 of them the event would have fired by 12 months time, right? Also, what is the distribution around this mean? Will it be all neatly packed around the mean or is the variance larger?

3) In the same event, what do modifiers actually do? Does being ambitious in the above example makes the event twice as unlikely to happen (factor=0.5), meaning that for someone who is ambitious the actual MTTH is 24 months? On the other hand, for someone who is slothful it's five times as likely (actual mtth would be around two months)?
1) Not that I know of. You can have a start up event, though.
2) Yes, in theory. I don't think anyone other than the developers know the exact distribution, but it seems close to a normal distribution.
3) The factors are multiplied by the base MTTH. So the ambitious trait makes it happen twice as fast (0.5x12 months), the slothful one 5 times more slowly.

Thanks! I have one more question.
In my Hanseatic League mod, I have tried to an event for mayors in which the merchants help the holder of a city by the construction of municipal buildings.
I would add not = { has_building = x } as the key condition, but it doesn't seem to work well (the game doesn't read this trigger).

Is this scripting correct for my puropose?

Code:
    trigger = {
        any_province_lord = {
            limit = {
                is_republic = yes
            }
            any_demesne_title = {
                NOT = { has_building = x }
            }
        }
    }
I'm not sure exactly what you're trying to do there, but that trigger in theory will return as true if any mayor-type character with a holding in the province does not have building x in any of his holdings anywhere. If you wanted to only test if he has the building in his holdings inside the province getting the even, then you'd need to specify that like so: any_demesne_title = { location = { province_id = ROOT }... }

try with any_demesne_province (instead of any_demesne_title)
No, buildings exist inside the title scope, not the province scope. Which makes sense since the province usually includes multiple holdings.
 
I'm not sure exactly what you're trying to do there, but that trigger in theory will return as true if any mayor-type character with a holding in the province does not have building x in any of his holdings anywhere. If you wanted to only test if he has the building in his holdings inside the province getting the even, then you'd need to specify that like so: any_demesne_title = { location = { province_id = ROOT }... }


Well, I would like to make an event to improve cities, but the event as follows doesn't show any options even though it could fire with console.

Code:
province_event = {
    id = 1000052020
    desc = "EVTDESC1000052020"
    picture = "GFX_evt_market"

    trigger = {
        any_province_lord = {
            limit = {
                is_republic = yes
            }
            any_demesne_title = {
                location = {
                    province_id = ROOT
                }
                NOT = { has_building = ct_wall_q_1 }
            }
        }
    }
    
    mean_time_to_happen = {
        months = 2000
    }
        
    option = {
        name = "EVTOPTA1000052020"
        any_province_lord = {
            random_demesne_title = {
                location = {
                    province_id = ROOT
                }
                limit = {
                    is_republic = yes
                }
                add_building = ct_wall_q_1
            }
        }
    }

}

In my experience, such a case means that something is wrong with trigger, but I don't see exact reason.
 
Well, I would like to make an event to improve cities, but the event as follows doesn't show any options even though it could fire with console.

In my experience, such a case means that something is wrong with trigger, but I don't see exact reason.
Sorry, I didn't notice before, you can't have a limit inside a trigger. That's for effects. Try removing limit = { } and see if it works.
 
Sorry, I didn't notice before, you can't have a limit inside a trigger. That's for effects. Try removing limit = { } and see if it works.


The event shows options now, however, the event can't correctly check whether settlements (cities, in this case) have already the target building or not.
 
I'm not understanding exactly. As I read it, your trigger (once you remove the limit brackets) will check if 1) any mayor-type province lord, 2) that he has a holding in the province, and 3) that this holding does not have the building.

Can you post the revised event and explain what is not working as expected when you see it in-game.
 
I'm not understanding exactly. As I read it, your trigger (once you remove the limit brackets) will check if 1) any mayor-type province lord, 2) that he has a holding in the province, and 3) that this holding does not have the building.

Can you post the revised event and explain what is not working as expected when you see it in-game.

Your point 3) is my issue. I have tested with a random chosen province in 1066 which doesn't have any buildings.
However, the event doesn't fulfill the condition. I doubt that the script after "any_demesne_title" is correct.

Here is the code.

Code:
province_event = {
    id = 1000052020
    desc = "EVTDESC1000052020"
    picture = "GFX_evt_market"

    trigger = {
        any_province_lord = {
            is_republic = yes
            any_demesne_title = {
                location = {
                    province_id = ROOT
                }
                NOT = { has_building = ct_wall_q_5 }
            }
        }
    }
    
    mean_time_to_happen = {
        months = 2000
    }
        
    option = {
        name = "EVTOPTA1000052020"
        any_province_lord = {
            random_demesne_title = {
                location = {
                    province_id = ROOT
                }
                limit = {
                    is_republic = yes
                    Not = { has_building = ct_wall_q_5 }
                }
                add_building = ct_wall_q_5
            }
        }
    }

}
 
Hmm, I don't know, maybe try throwing in tier = baron. The vanilla events with similar triggers seem to use it (see below). Or perhaps has_building is the wrong syntax or doesn't work in triggers. I've only tested add/remove_building as effects.

Code:
any_province_lord = {
			any_demesne_title = {
				location = {
					province_id = ROOT
				}
				tier = baron
				num_of_buildings = 1
			}
		}
 
Hmm, I don't know, maybe try throwing in tier = baron. The vanilla events with similar triggers seem to use it (see below). Or perhaps has_building is the wrong syntax or doesn't work in triggers. I've only tested add/remove_building as effects.

Sadly tier = baron has nothing to do with buildings, and num_of_buildings is not good trigger for the event to add buildings which a settlement lacks. As I already said, it seems that has_building doesn't work as trigger, but as condition in effect. It is really weird since Sengoku has it as trigger.

Thanks anyway. I will try to find another way to create that event.
 
Hi all!

i just managed to become pope and king of sicilia. my question is how i can stop this gamepausing popups that appears if you are pope and someone wants an indulgence. i get 2 -6 every day and that makes my game unplayable!

i never modded something by myself, so i don´t know what to change...

i found the event in the events folder / religious_events:

Code:
################################################## #############
# Interactions from decisions
################################################## #############

#Character purchases indulgence
character_event = {
id = 39250
desc = "EVTDESC39250"
picture = GFX_evt_emissary

is_triggered_only = yes

option = {
name = "EVTOPTA39250"
FROM = {
character_event = { id = 39251 days = 3 random = 7 tooltip = "EVTTOOLTIP39251" }
}
}
}

#Character gets approval
character_event = {
id = 39251
desc = "EVTDESC39251"
picture = GFX_evt_pope

is_triggered_only = yes

option = {
name = "EVTOPTA39251"
trigger = {
reverse_opinion = { who = FROM value = 75 }
}
if = {
limit = { piety = 500 }
scaled_wealth = -0.9
piety = 25
}
if = {
limit = { NOT = { piety = 500 } }
scaled_wealth = -1.0
piety = 25
}
FROM = {
opinion = {
who = ROOT
modifier = bought_indulgences
years = 5
}
}
clr_character_flag = ask_for_indulgence
}
option = {
name = "EVTOPTA39251"
trigger = {
NOT = { reverse_opinion = { who = FROM value = 75 } }
reverse_opinion = { who = FROM value = 0 }
}
if = {
limit = { piety = 400 }
scaled_wealth = -1.15
piety = 25
}
if = {
limit = { NOT = { piety = 400 } }
scaled_wealth = -1.25
piety = 25
}
FROM = {
opinion = {
who = ROOT
modifier = bought_indulgences
years = 5
}
}
clr_character_flag = ask_for_indulgence
}
option = {
name = "EVTOPTA39251"
trigger = {
NOT = { reverse_opinion = { who = FROM value = 0 } }
reverse_opinion = { who = FROM value = -75 }
}
if = {
limit = { piety = 400 }
scaled_wealth = -1.4
piety = 25
}
if = {
limit = { NOT = { piety = 400 } }
scaled_wealth = -1.5
piety = 25
}
FROM = {
opinion = {
who = ROOT
modifier = bought_indulgences
years = 5
}
}
clr_character_flag = ask_for_indulgence
}
option = {
name = "EVTOPTA39251"
trigger = {
NOT = { reverse_opinion = { who = FROM value = -75 } }
}
if = {
limit = { piety = 400 }
scaled_wealth = -1.65
piety = 25
}
if = {
limit = { NOT = { piety = 400 } }
scaled_wealth = -1.75
piety = 25
}
FROM = {
opinion = {
who = ROOT
modifier = bought_indulgences
years = 5
}
}
clr_character_flag = ask_for_indulgence
}
option = {
name = "EVTOPTB39251"
ai_chance = { factor = 0 }
FROM = {
opinion = {
who = FROM
modifier = refused_indulgences
years = 5
}
}
clr_character_flag = ask_for_indulgence
}
}


and in the decisions folder / realm_decisions:

Code:
buy_indulgence_for_sins = {
		potential = {
			religion = catholic
			age = 16
			demesne_size = 1
			NOT = { has_character_flag = ask_for_indulgence }
		}
		allow = {
			scaled_wealth = 1.0
			is_heretic = no
		}
		effect = {
			set_character_flag = ask_for_indulgence
			rightful_religious_head_scope = {
				character_event = { id = 39250 days = 5 random = 12 tooltip = "indulgence_ask" }
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = {
					scaled_wealth = 10.0
				}

i just want this popup not showing up...

can you please help me?
 
Last edited:
1) Not that I know of. You can have a start up event, though.

How would one go about doing this? Lets say I want to set up a province modifier in every province on the map, would I need to write up specific events for every country, or could it be done with one major event? Any tips on how to start doing that?
 
How would one go about doing this? Lets say I want to set up a province modifier in every province on the map, would I need to write up specific events for every country, or could it be done with one major event? Any tips on how to start doing that?
One event will work fine. If you want this modifier to remain for the rest of the game, then make the trigger that the province doesn't have it, and give it a MTTH of 1 day. Now every province in the game will get this event shortly after the start of the game.

If you don't want the modifier to always be there, then use a province flag as your trigger mechanism--the event checks if a province has the flag (none will at the start of game), and the event placing the modifier will also set the flag, preventing the event from firing again.
 
Hi all!

i just managed to become pope and king of sicilia. my question is how i can stop this gamepausing popups that appears if you are pope and someone wants an indulgence. i get 2 -6 every day and that makes my game unplayable!

i never modded something by myself, so i don´t know what to change...

i found the event in the events folder / religious_events:

....

i just want this popup not showing up...

can you please help me?
Snarky answer--this is why you shouldn't be the pope! Now you know what that poor character has to deal with.

Serious answer: you'll need to change that decision so it only sends a letter to the pope if the pope is ai, and if the pope is not ai, then the event it triggers will be recieved by some courtier of the Pope (I'd recommend your lord spiritual). Then you might want to change the events so that instead of the character liking the Lord Spiritual, he'll like the L.S.'s liege (the Pope).
 
I just remembered that the siege events raise and lower morale. Perhaps you could play around with the commands from there.

Thanks for the reply Jaol. The problem I think with siege events is that the morale loss/gain is applied to the whole force. I wanted a system where morale only effects the flank of the leader that is wounded/killed unless of course the king is involved in which case all troops would be affected.
 
Just a short question.
I know some of you are familiar with coding from recent paradox titles, so this might seem obvious to you, but how do i use the console to debug?
How can i trigger events in the console?
Any help is much appreciated
Look in the cheats thread. It has instructions on how to trigger events via the console

Not really a modding question but I could think of no better place. Is there an easy way to switch a count's allegiance to a different duke/king in the savegame file? Thank you.
liege=x is what determines it, IIRC.