Jump to content

variables triggering in dialogues


jastey

Recommended Posts

Hi,

following code:

 

  ...
IF ~~ THEN order_05
SAY ~Bla, my lady.~
IF ~~ THEN DO ~SetGlobal("X#AjantisRomanceOrderEnd","GLOBAL",1)~ + order_17
END

...

IF ~~ THEN order_17
SAY ~More Blabla.~
IF ~!Global("X#AjantisRomanceOrderEnd","GLOBAL",1)~ THEN + order_20
IF ~Global("X#AjantisRomanceOrderEnd","GLOBAL",1)~ THEN EXIT
END

 

should end the dialogue after order_17 if coming from order_05, but it doesn't.

 

I guess the answer is easy, something like "the game checks the variables only every second, so this triggering follows too quick"?

And does somebody have a solution to solve this problem, other than "write two different dialogue paths"? ...

 

Thanks in advance!

Link to comment

Actions from dialogues get added to the creature's action list and do not get executed until the dialogue is over. The simplest solution is to split the order_17 block into two to account for this:

 

IF ~~ THEN order_05
SAY ~Bla, my lady.~
IF ~~ THEN DO ~SetGlobal("X#AjantisRomanceOrderEnd","GLOBAL",1)~ + order_17a
END

// send blocks with X#AjantisRomanceOrderEnd = 1 here
IF ~~ THEN order_17a
SAY ~More Blabla.~
IF ~~ THEN EXIT
END

// send blocks without X#AjantisRomanceOrderEnd = 1 here
IF ~~ THEN order_17b
SAY ~More Blabla.~
IF ~~ + order_20
END

Link to comment

Actually, it depends. If you go directly from the state setting the variable to the one checking it, it won't work properly. However, if there's an intermediate state between the two, the variable will be updated as you'd expect. At least, that's my experience of it.

Link to comment

Thanks for your answers. I wrote a silly little test dialogue to test the variables triggering and had the same experience as you, SimDing0. So it needs one intermediate state before a set variable (local or global) can be used in the same dialogue.

Link to comment

Archived

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

×
×
  • Create New...