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

Sute]{h

Field Marshal
88 Badges
Jun 25, 2002
3.508
199
  • Europa Universalis IV: Pre-order
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome Collectors Edition
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Victoria 3 Sign Up
  • Europa Universalis IV: Art of War
  • 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
  • Deus Vult
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • Majesty 2
I'm working one a somewhat complex event chain for my exalted mod, and since I havn't been event scripting since Victoria, I'd like to run it past the board for obvious errors.

First of the idea of the events is to give certain people the dragon-blooded trait. I've toyed around with several approaches to this, since it should be somewhat rare and unpredicate. The easiest was just to make an event that pretty much fired for every child giving an X% chance to get the trait. I desided against that approach since I want the player to keep hoping for an exaltation thoughout characters childhood.

That led me to an approach where I'm using a somewhat high MTTH instead. However this approach led me to another problem. Since it is the parent that gets the event I was unsure of what would happen if he/she had more than one child. I figured the game would only roll one dice per event per char despite how many times the char furfilled the criteria. If I'm wrong on this I'd love to know though. My solution is to create a bunch of events one for each year of age the child has. I know you could have two children of the same age, but the chances are somewhat low.

My main concern is if I've gotten the effect right. I want the child to get both the dragon-blooded trait and one of the five aspect traits. I've only posted one of the events. So if the MTTH seems very high it is because there will be around 10 seperate events one for each year. Also the event should only trigger for around 10% of the children of a parent with the good pedigree trait.

Code:
character_event = {

	id = X

	trigger = {
		not = { traits = dragon-blooded }
		any_child = {
			age = 7
			not = { age = 8 }
			not = { traits = dragon-blooded }
			not = { traits = solar }
			not = { traits = lunar }
			not = { traits = sidereal }
			not = { traits = abyssal }
		}
	}

	mean_time_to_happen = {
		months = 1588

		modifier = {
			factor = 10.0
			not = { traits = good_pedigree } 
		}
	}

	title = ""
	desc = ""

	option = {
	name = ""
		random_child = {
			limit = { 
				age = 7 
				not = { age = 8 }
				not = { traits = dragon-blooded }
				not = { traits = solar }
				not = { traits = lunar }
				not = { traits = sidereal }
				not = { traits = abyssal }
			}
			add_trait = dragon-blooded
			random_list = {
				20 = { add_trait = air_aspected }
				20 = { add_trait = earth_aspected }
				20 = { add_trait = fire_aspected }
				20 = { add_trait = water_aspected }
				20 = { add_trait = wood_aspected }
			}
		}
	}
}
 
Ok. Are factors limited to one number after the . or can I use something like factor 0.876 if I want to?
 
Sute]{h said:
Ok. Are factors limited to one number after the . or can I use something like factor 0.876 if I want to?

I've certainly used two-decimal factors like 0.55. I don't think I've ever gone any further than that, but I assume you can.

If your intention is to get a factor of 2 if two thresholds are reached, then I'd settle for a factor of 1.4 on each factor, rather than 1.41421356
 
Thanks again.

Yet another question.

Is it possible to have more than one requirement for a MTTH factor?

Like this:

modifier = {
factor = 0.10
not = { traits = dragon-blooded }
traits = good_pedigree
}

Thus only using the 0.1 factor if the character is of good pedigree and not a dragon-blooded.
 
Hmm... I ended up with this MTTH

Code:
mean_time_to_happen = {
		months = 2655

		modifier = {
			factor = 3.00
			not = { traits = dragon-blooded }
		}
		modifier = {
			factor = 0.90
			traits = impeccable_pedigree
			not = { traits = dragon-blooded }
		}
		modifier = {
			factor = 0.80
			traits = legendary_pedigree
			not = { traits = dragon-blooded }
		}
		modifier = {
			factor = 10.0
			not = { traits = dragon-blooded }
			not = { traits = good_pedigree }
			not = { traits = impeccable_pedigree }
			not = { traits = legendary_pedigree }			
		}
		modifier = {
			factor = 0.50
			traits = air_aspected
			not = { traits = impeccable_pedigree }
			not = { traits = legendary_pedigree }
		}
		modifier = {
			factor = 1.33
			traits = dragon-blooded
			not = { traits = air_aspected }
			not = { traits = impeccable_pedigree }
			not = { traits = legendary_pedigree }
		}
		modifier = {
			factor = 0.25
			traits = impeccable_pedigree
			traits = air_aspected
		}
		modifier = {
			factor = 1.50
			traits = impeccable_pedigree
			traits = dragon-blooded
			not = { traits = air_aspected }
		}
		modifier = {
			factor = 0.15
			traits = legendary_pedigree
			traits = air_aspected 
		}
		modifier = {
			factor = 2.41
			traits = legendary_pedigree
			traits = dragon-blooded
			not = { traits = air_aspected }
		}
	}
Any way of simplifying it without affecting the odds?
 
Darkarbiter said:
Probably not, is there any particular reason why you need to?
Because less complicated triggers would properly cut down on the CPU stress?