Jump to content

Dialogue Conditions Syntax


Dandys

Recommended Posts

Hi, I have a piece of ED-E dialogue that I want to make conditions for.

 

If I were writing it in a script, it would look like this (well not really because some are dialogue-only conditions like getquestvariable but I hope you'll get the point)

 

-----

 

If (GetQuestVariable VNPCFollowers EDEHired == 1 && GetisVoiceType RobotEDE == 1 && ((EDE1REF.IsWaiting == 0 & EDE1REF.GetDisabled == 0) || (EDE2REF.IsWaiting == 0 && EDE2REF.GetDisabled == 0) || (EDE3REF.IsWaiting == 0 && EDE3REF.GetDisabled == 0)))

 

-----

 

Or just in general, does anyone know how complex conditions work in dialogue with using multiple AND / OR?

 

- Thanks everyone for helping!

Edited by Dandys
Link to comment
Share on other sites

Hi, I have a piece of ED-E dialogue that I want to make conditions for.

 

If I were writing it in a script, it would look like this (well not really because some are dialogue-only conditions like getquestvariable but I hope you'll get the point)

 

-----

 

If (GetQuestVariable VNPCFollowers EDEHired == 1 && GetisVoiceType RobotEDE == 1 && ((EDE1REF.IsWaiting == 0 & EDE1REF.GetDisabled == 0) || (EDE2REF.IsWaiting == 0 && EDE2REF.GetDisabled == 0) || (EDE3REF.IsWaiting == 0 && EDE3REF.GetDisabled == 0)))

 

-----

 

Or just in general, does anyone know how complex conditions work in dialogue with using multiple AND / OR?

 

From the Official GECK Page:

 

 

AND/OR Precedence

 

The OR checkbox is used to determine how a Condition Item is evaluated with the ones that follow it. Consecutive ORs are treated like a single block when evaluating and have order precedence over AND. For example, the Condition Items (A AND B OR C AND D) are evaluated as (A AND (B OR C) AND D) and not ((A AND B) OR (C AND D)).

 

By applying the distributive and other properties complex expressions can be converted into a list of Condition Items that will evaluate as intended. For example, the expression ((A AND B) OR (C AND D)) can be represented as the list of Condition Items (A OR B AND B OR C AND A OR D AND B OR D). As described above, this evaluates as ((A OR B) AND (B OR C) AND (A OR D) AND (B OR D)) which is equivalent to the initial expression.

 

Reference Link

Link to comment
Share on other sites

Given the OR precedence and the fact that you can't force the EDE waiting/Disabled pairs to AND beforehand, which is what you need, it would seem that this expression can't be done in a condition list.

 

But there is always a way around this sort of thing by making assumptions or by simplifying the conditions in a script somewhere.

 

an assumption you could make:

since EDE is hired, this expression will always be true:

(EDE1REF.GetDisabled == 0) || (EDE2REF.GetDisabled == 0) || (EDE3REF.GetDisabled == 0)

 

If for some reason all EDE's are disabled, you won't be able to talk to him anyway to evaluate the conditions!

 

So making this assumption lets you simplify it to this, by assuming the IsWaiting variables on all the EDE's are in a proper state (might be a dangerous assumption, but this is just an example):

 

If (GetQuestVariable VNPCFollowers EDEHired == 1 && GetisVoiceType RobotEDE == 1 && ((EDE1REF.IsWaiting == 0) || (EDE2REF.IsWaiting == 0) || (EDE3REF.IsWaiting == 0))

 

And the condition list:
EDE1REF.IsWaiting == 0	OR
EDE2REF.IsWaiting == 0	OR
EDE3REF.IsWaiting == 0	AND
GetQuestVariable VNPCFollowers EDEHired == 1	AND
GetisVoiceType RobotEDE == 1	AND/OR <--doesn't matter on the last one

 

If the IsWaiting assumption is a bad one, then I would simplify this part in a quest script to just one variable to use in the conditions:

((EDE1REF.IsWaiting == 0 && EDE1REF.GetDisabled == 0) || (EDE2REF.IsWaiting == 0 && EDE2REF.GetDisabled == 0) || (EDE3REF.IsWaiting == 0 && EDE3REF.GetDisabled == 0)) 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...