Condition Logic Puzzler

Post » Sun Aug 16, 2015 12:57 am

I have a TopicInfo and I want to condition it to work for three actors, but only if the player holds the token corresponding to that actor

In pseudo code and with conventional Boolean precedence, I might write it like this:

if	speaker_is(A) AND player_holds(token_of_A)	OR	speaker_is(B) AND player_holds(token_of_B)	OR	speaker_is(C) AND player_holds(token_of_C)then	speak()end
Only CK conditions reverse the usual precedence so that OR binds more strongly than AND, if I remember correctly. That works great if you have a list of speakers and a set of condtions common to all of them, but it makes things like this far more difficult

Can anyone work out how to express that in CK logic? I can do it by having three infos and conditioning one to A, one to B and one to C, but I'd prefer to have a a single topic.

Any ideas, anyone?

[edit]

Just for my own satisfaction, I worked out how that logic would work with beth's precedence

if	speaker_is(A) AND 	( player_holds(token_of_A) OR speaker_is(B) )AND 	( player_holds(token_of_B) OR speaker_is(C) )AND 	player_holds(token_of_C)then	speak()end
So the only way that dialogue fires is if Speaker is A and you hold all three tokens.

I'm not misremembering how conditions work, am I? This seems crazier the more I think about it. It's like something I dreamed and woke up thinking it really happened...
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Return to V - Skyrim