Jump to content

Re-Evaluating Conditions in DLG Files


Skye

Recommended Posts

Am I correct in thinking that conditions don't get re-evaluated in a dialog once it's initiated until you close it? Is there any way around that?

 

I tried eliminating/changing some default replies in a dialog dynamically, but it doesn't look like the state changes until I close and initiate the dialog again.

 

For example, something like this doesn't seem to work.

 

BEGIN MyDialog

IF ~True()~ THEN BEGIN Main
SAY @1
  + ~Global("TalkedAboutOption1","LOCALS",0)~ + @2 + Option1
  + ~Global("TalkedAboutOption1","LOCALS",1)~ + @3 + Option2
  ++ @4 EXIT
END

IF ~~ THEN BEGIN Option1
SAY @5
  ++ @6 DO ~SetGlobal("TalkedAboutOption1","LOCALS",1)~ + Main
END

...
It always shows Option1, even though the global changes. If I exit the dialog and re-initiate it, it shows Option2 normally.
Link to comment

I'm playing with BG:EE engine, so unfortunately I won't be using DialogueSetGlobal unless they add it with the next patch.

 

There is a delay for processing script actions in dialogs. It usually takes two or three transitions for script actions to be executed.

Odd, seeing as other actions (journal entries, xp rewards, item handling, etc.) seem to be processed instantly, at least according to the log.

 

Seems more like a delay in trigger re-evaluation. Not that it makes any difference. I guess I'll try to work around it.

Link to comment

What do you mean when you say two transitions?

Block1
... DO SetGlobal("MyVariable","LOCALS",1) GOTO Block2

Block2
SAY blabla
... GOTO Block3 (MyVariable = 0)

Block3
SAY blabla2 (MyVariable = 1)

Or

Block1
... DO SetGlobal("MyVariable","LOCALS",1) GOTO Block2

Block2
SAY blabla (MyVariable = 0)
= blabla2 (MyVariable = 1)
Link to comment

Yes. The second example is just a WeiDU shortcut, btw.

Is this behaviour true for all the DO ~do something~ you put into a dialogue??

I had the feeling it does, especially if you write dialogue in CHAIN,

The only ones that seem to trigger immediately are the DOs you put into PC's responses.

This is just how I experience it from some actions (like party get XPs) that always appear on the screen with this delay you have described. Can you confirm that as standard behaviour?

Link to comment

Yeah, this is a very annoying "feature". First discovered when GemRB didn't work correctly with Lum's machine in ToB.

GemRB tried to implement SetGlobal sanely, but the dlg for the machine exploited this nasty feature.

 

Instants take one more transition than you would expect.

Non instants (and anything after them) are delayed until the dialogue ends.

Link to comment

Yeah, this is a very annoying "feature". First discovered when GemRB didn't work correctly with Lum's machine in ToB.

GemRB tried to implement SetGlobal sanely, but the dlg for the machine exploited this nasty feature.

 

Instants take one more transition than you would expect.

Non instants (and anything after them) are delayed until the dialogue ends.

This sounds more like what I have observed as well, instant is not really *immediately* - and I understand this to be true for BG2 IE as well as GemRB (which I am not using, yet).

Thanks for the Lum hint - strangely enough it works most of the time but sometimes it loops (maybe it works if some interject provides the necessary additional transition?) Most of the time I have Irennicus in my party at that point and he has a lot to comment on Lum.

Link to comment

It may get progressively worse sometimes, actually. You can have an NPC join the party while in dialog mode, but they will still use non-party dialog file after one next transition. Imagine trying to add interjections to it :D

 

By the way, the problem with Lum machine is what prompted ToBEx to introduce a new action, instead of fixing the existing one.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...