• 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.
Apr 10, 2005
206
0
www.livejournal.com
I am trying to write an event which gives a warning when a ruler or his child becomes 16, so I know to pause the game and start looking for a wive.
Unfortunately my event doesn't work, probably because I made a mistake somewhere.

Code:
#########################
# Eligible for marriage
# By JordiK
#########################
character_event = {
	id = 30010
	
	picture = "event_intrigue"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = not value = { type = is_married } }
		condition = { type = or
			condition = { type = ruler }
			condition = { type = ruler_child }
		}
		condition = { type = age value = 16 }
	}

	action_a = {#Your child is now eligible for marriage !
		effect = { type = set_to_realm_religion }
	}
}

Basically what I want the event to do is check if a character is 16, is a ruler or the child of a ruler, and is not married. Then it should give a warning (the set_to_realm_religion is just added because I needed something for the effect).

The problem is alas that this event doesn't trigger at all. If I trigger it manually, I get 'cannot happen, trigger not satisfied'.

Help?
 
You miss out mean_time_to_happen. All CK events need something like this:

Code:
mean_time_to_happen = {
         days = 1
}

Usually it's placed between trigger and actions. You can use "months" and "years" instead of "days" if you want. The higher the MTTH, the more often it fires. Now the problem is that, even with MTTH 1 day, it most of the time will not fire immidiately when the child is 16, at worst it can take years to fire, since there is significant random element involved. But usually MTTH 1 day will fire within a year. However, with your current trigger, this event will keep firing for the kid until he / she is married, so if you don't plan to marry some child, it can become a nuisance.

In case you didn't know, educations end only after 16 nowadays, so they kind of work in same ways, pointing out that "Hey, this kid is marriage age now". Since your event could not fire more guaranteedly quickly, I don't think you would really find it useful.