Skye Posted September 23, 2015 Posted September 23, 2015 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.
argent77 Posted September 23, 2015 Posted September 23, 2015 There is a delay for processing script actions in dialogs. It usually takes two or three transitions for script actions to be executed. You can see it, for example, in the Wish dialog (WISH25.DLG).
Gwendolyne Posted September 23, 2015 Posted September 23, 2015 Installing ToBEx, you can use a new script action opcode : 353 DialogueSetGlobal(S:Name*,S:Area*,I:Value*). Then, DO ~DialogueSetGlobal("YourVariable","LOCALS",n)~ works fine and reevaluates "YourVariable" without quitting the dialog !
Skye Posted September 23, 2015 Author Posted September 23, 2015 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.
Ardanis Posted September 24, 2015 Posted September 24, 2015 It takes two transitions to recognize an updated state in dialog trigger. And yes, it is very annoying and occasionally a *royal* pita to deal with.
Gwendolyne Posted September 24, 2015 Posted September 24, 2015 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)
Ardanis Posted September 24, 2015 Posted September 24, 2015 Yes. The second example is just a WeiDU shortcut, btw.
Roxanne Posted September 24, 2015 Posted September 24, 2015 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?
argent77 Posted September 24, 2015 Posted September 24, 2015 Only script actions listed in INSTANT.IDS are supposed to be executed instantly in dialog's DO blocks. It still takes at least two transitions to update internal states however. Everything else is delayed until the dialog has been ended.
Avenger Posted September 25, 2015 Posted September 25, 2015 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.
Roxanne Posted September 25, 2015 Posted September 25, 2015 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.
Ardanis Posted September 25, 2015 Posted September 25, 2015 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 By the way, the problem with Lum machine is what prompted ToBEx to introduce a new action, instead of fixing the existing one.
Skye Posted September 30, 2015 Author Posted September 30, 2015 Wouldn't it have been better to just fix the Lum's Machine dialog and have the engine work as one would expect instead?
argent77 Posted September 30, 2015 Posted September 30, 2015 They have probably kept it for compatibility reasons. Some mods may rely on this specific behavior of actions in dialogs.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.