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

Cat Lord

Retired Moderator
68 Badges
May 13, 2002
10.866
26
www.revolutionundersiege.com
  • Victoria 3 Sign Up
  • Stellaris: Nemesis
  • Europa Universalis IV: Rights of Man
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Europa Universalis IV: Golden Century
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: The Republic
  • Magicka
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Europa Universalis IV: Call to arms event
Hello all,

as you may have read, 1.03 is out, and should be a dream for modders (well at least I ask a lot to Johan to make it become a dream :D).

It introduce a new but not straightforward possibility:

Context Switching Condition

And many many more things.

Please use this thread for your question specific to events scripting with the new 1.03 possibilty :)

Cat
 
Last edited:
Yep. There are 3 of us who wrote/rewrote the bulk of the events for 1.03 and we'd be happy to help you as needed.
 
A comprehensive list of new conditions and effects, and old conditions/effects that behave differently in 1.03 would, I believe, be greatly appreciated.
 
richvh said:
A comprehensive list of new conditions and effects, and old conditions/effects that behave differently in 1.03 would, I believe, be greatly appreciated.
The file "event effect.txt" has been updated as much as I can. That's a start :)

Cat
 
2 things:
1. How do you change the AI's chance of picking an option.
2. Did you change it so that bastards are linked to the character getting the event and not the ruler?
 
Jinnai said:
2 things:
1. How do you change the AI's chance of picking an option.
Example:
Code:
	action_a = {
		ai_chance = 36
			#start AI modifier block
			modifier = {
				condition = { type = not value = { type = diplomacy value = 2 } }
				factor = 1.5
			}
			modifier = {
				condition = { type = not value = { type = diplomacy value = 4 } }
				factor = 1.5
			}
			#end AI modifier block
		effect = { type = prestige value = 10 }
	}
	action_b = {
		ai_chance = 50
			#start AI modifier block
			modifier = {
				condition = { type = not value = { type = diplomacy value = 4 } }
				factor = 0.75
			}
			modifier = { 
				condition = { type = diplomacy value = 7 }
				factor = 0.75
			}
			#end AI modifier block
		effect = { type = piety value = 10 }
	}
	action_c = {
		ai_chance = 32
			#start AI modifier block
			modifier = { 
				condition = { type = diplomacy value = 7 }
				factor = 1.5
			}
			modifier = { 
				condition = { type = diplomacy value = 9 }
				factor = 1.5
			}
			#end AI modifier block
		effect = { type = piety value = 5 }
		effect = { type = prestige value = 5 }
	}
In this example, the AI with a low diplomacy will have more chance to pick a, with a medium diplo to pick b, and with a high diplo, to pick c.

Code:
Diplo value     a     b     c
     1          72   37.5  32
     3          48   37.5  32
     5          32   50    32
     8          32   37.5  48
    10          32   37.5  72
Jinnai said:
2. Did you change it so that bastards are linked to the character getting the event and not the ruler?
No.

Cat
 
Last edited:
Jinnai said:
another related question

can you use the CSC checks for ai chance (not effects)?
CSC checks will work in any context when a trigger condition or modifier condition applies so if you're working with ai_chance effects you can modify that with csc's.

Example:

Say you wanted to add a modifier to the AI choosing how it educates it children in a court where the demesne capital has a cathedral (something you couldn't do in 1.02). You could do this:

Code:
	action_c = {
		ai_chance = 30
			modifier = {
				condition = { 
					type = capital
						condition = { 
							type = has_improvement
							value = { type = cathedral value = yes }
						}
				}
				factor = 1.5
			}
		effect = blahblahblah
	}
The above would change the ai's chance of choosing action c from 30% to 45% if the demesne capital has a cathedral. Note that the modifier isn't enclosed at all (i.e you don't put {} around it) and of course it is ignored for players.

I hope that answers your question since I wasn't 100% clear on what you were asking.
 
event_effects.txt still says you can use the syntax
Code:
condition = {
  type = has_improvement
  value = {cathedral = no }
}
Has this actually been fixed, or is event_effects.txt inaccurate again on this point?
 
richvh said:
event_effects.txt still says you can use the syntax
Code:
condition = {
  type = has_improvement
  value = {cathedral = no }
}
Has this actually been fixed, or is event_effects.txt inaccurate again on this point?
AFAIK it could easily still be broken. It's the sort of syntax I wouldn't normally use simply because so few others allow it and it would lead me into all sorts of (potentially) bad habits. I would recommend sticking with the assumption that it hasn't been fixed and continue to NOT it instead, just to be safe.
Code:
condition = {
        type = not
        value = { type = has_improvement value = {cathedral = no } }
}
 
As I understand what MrT and Cat Lord have written, if you want a character effect (ruler trait added), you have to write a character event, that can use context switching to check province conditions. There is no way to have character effects and province effects in the same event.
 
Richard is correct.

These are Context Switching CONDITIONS. Not context switching effect...

Cat
 
I note that the province condition
Code:
type = capital value = yes
used in the advance discovery series is still not documented in event_effects.txt. Now there is a csc type of realm_capital. Can realm_capital be used as a province condition to test if a province is the top level capital?
 
richvh said:
Now there is a csc type of realm_capital. Can realm_capital be used as a province condition to test if a province is the top level capital?
No.

Cat
 
Note: You can nest different csc

Examples:

A check on the steward of the ruler for a province event:

Code:
#####
# Arbitrary Steward: Upset the population

[B]province_event[/B] = {
	id = 7500
	
	picture = "event_intrigue"
	
	trigger = {
		condition = { type = not value = { type = ai } }
[B]		condition = {
			type = owner
			condition = {
				type = steward_csc
				condition = { type = trait value = arbitrary }
			}
		}[/B]
	}

	mean_time_to_happen = {
		months = 480

		# Ruler trait modifiers:

		modifier = {
			condition = {
				type = owner
				condition = { type = trait value = trusting }
			}
			factor = 0.75
		}

		modifier = {
			condition = {
				type = owner
				condition = { type = trait value = suspicious }
			}
			factor = 1.25
		}

	}

And the contrary:

An example of a check on a province for a steward event.

Code:
[B]character_event [/B]= {
	id = 7514
	
	picture = "event_crime"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = steward }
		condition = { type = trait value = deceitful }
[B]		condition = {
			type = ruler_csc
			condition = {
				type = any_province
				condition = {
					type = or
					condition = { type = has_improvement value = { thieves_guild = yes } }
					condition = { type = has_improvement value = { smugglers_ring = yes } }
					condition = { type = has_improvement value = { highway_robber_band = yes } }
				}
			}
		}[/B]
	}

	mean_time_to_happen = {
		months = 480

		# Ruler trait modifiers:

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = trait value = trusting }
			}
			factor = 0.8
		}

		modifier = {
			condition = {
				type = ruler_csc
				condition = { type = trait value = suspicious }
			}
			factor = 1.25
		}

	}

	immidiate = {#Dirty money
		effect = { type = gold scale = 0.25 }
		effect = { type = piety value = -10 }
	}

}

Cat
 
Note also:

If you use a csc for someone who doesn't exist then it will always return as false.

Example:

If you use the steward_csc and the court does not have a steward appointed, this will return as false no matter what condition(s) is nested inside it. When you're using these it doesn't hurt to double check that you haven't forgotten a trigger condition that should be included to avoid strange results. (Cat Lord and I learned that lesson the hard way :eek:o :D )
 
Cat Lord said:
richvh said:
Now there is a csc type of realm_capital. Can realm_capital be used as a province condition to test if a province is the top level capital?
No.

Cat
So is there any way for a province event to check if the selected province is the top-level capital?
 
richvh said:
So is there any way for a province event to check if the selected province is the top-level capital?
"type = capital" + CSC "type = owner + type = is_independent" ?

Cat