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

unmerged(15101)

Second Lieutenant
Feb 25, 2003
179
0
Visit site
Is there any way to create an event where one, but only one, of two or more possible outcomes occurs? For example, I can do this:
Code:
action_a = {
	effect = {
		type = random
		chance =50
		effect = { type = [I]heads[/I] }
	}
	effect = {
		type = random
		chance = 50
		effect = { type = [I]tails[/I] }
	}
}
So there's an equal chance of heads or tails, but there's also a chance that both or neither will occur. Is it possible set it up so one or the other happens but not both?
 
Not that I know of.

Cat
 
It depends on the effects. If one of the effects can be tested for in a trigger e.g. adding a trait, then you can have a two event chain that will work.

Event 1

effects: 50% chance heads
trigger Event 2

Event 2
condition not heads
effect: tails
 
The Arch Mede said:
It depends on the effects. If one of the effects can be tested for in a trigger e.g. adding a trait, then you can have a two event chain that will work.

Event 1

effects: 50% chance heads
trigger Event 2

Event 2
condition not heads
effect: tails
Is there a condition check for triggered events? Wouldn't this example trigger event 2 every time regardless of whether or not 'heads' came up?

I did come up with one possible way to make this work:
Code:
Event 1A
    option A - trigger event 2A
    option B - trigger event 2B

Event 1B (same MTTH and conditions as event 1A)
    option A - trigger event 2B
    option B - trigger event 2A

Event 2A - heads
Event 2B - tails
As long as 2A and 2B have the same event names, the player won't know the outcome in advance when making the choice.
 
That, on the other hand, is an idea I have toyed with for some events (still not in the beta patch, so don't ask :p :D), and I think it's a good idea in general.

Cat
 
Fallout_Boy said:
Is there a condition check for triggered events? Wouldn't this example trigger event 2 every time regardless of whether or not 'heads' came up?

Yes. But the not heads condition will stop event 2 firing for the 50% when heads came up in event 1.
 
The Arch Mede said:
Yes. But the not heads condition will stop event 2 firing for the 50% when heads came up in event 1.
I'm not sure about this, but my understanding from scripting HOI and Victoria events was that the command "trigger event x" doesn't just cause a check of the conditions and fire the event if they are met, but actually triggers event x regardless of whether the conditions are met. I'll have to check and see if this is the case with CK events.

edit: I just tested it, and this is the case. If you create an event with:

condition = { type = year value = 1100 }

It will still occur if triggered by another event in 1066.
 
Last edited:
Fallout_Boy said:
I'm not sure about this, but my understanding from scripting HOI and Victoria events was that the command "trigger event x" doesn't just cause a check of the conditions and fire the event if they are met, but actually triggers event x regardless of whether the conditions are met. I'll have to check and see if this is the case with CK events.
Yes. It's the same. No conditions are checked.

Cat
 
For trait-pairs this can be easily done.
Code:
action_a = {
	effect = { type = add_trait value = chaste }
	effect = {
		type = random
		chance = 50
		effect = { type = add_trait value = lustful }
	}
}
 
Cat Lord said:
Yes. It's the same. No conditions are checked.

Cat

Bah. I had thought that the absence of conditions in the examples I had seen was because there was no reason for them, rather than they would not work. :( This is a pain. It never worried me in EU2 events, but for CK I really would like the flexibility that this sort of logic can give. :mad:

Is there a way of modding the chance of an effect in the same sort of way that the choice which the ai makes can be modified? I could use that as a workaround. Or, a couple of additional unused traits would also suffice...

It should be relatively easy to edit the education events to remove one of the possible outcomes which would free 4 for use as flags in event logic. Need to be careful of unexpected effects on characters that start with them in the scenario files though. Time to experiment. :)
 
The Arch Mede said:
It should be relatively easy to edit the education events to remove one of the possible outcomes which would free 4 for use as flags in event logic. Need to be careful of unexpected effects on characters that start with them in the scenario files though. Time to experiment. :)
On a complete other topic that reminded me i was thinking the other day that there would be a way to fix the rare dual education bug by making the 3 education traits trait pairs.