Jump to content

Very weird ignoring of conditions in dialogue


Recommended Posts

So I have 2 final dialogue topics TopicA and TopicB

In the 'begin' fragment of TopicA I run a function that calculates some stuff then sets a globalVar.

In my test cases globalvar x was set to 91.

TopicA then flows via invisible continue into TopicB, which has dialogue with condition globalvar x <= 80

I run a debug in the function and in the fragment in TopicA which shows that x is indeed 91.

The dialogue with condition globalVar x <= 80 displays, despite the reality that x = 91.

I'm totally baffled and the only thing I can think of is that it's a timing issue with the globvar being set and then checked almost immediately. But I don't know.

Any ideas ?

Edited by csbx
Link to comment
Share on other sites

28 minutes ago, csbx said:

I'm totally baffled and the only thing I can think of is that it's a timing issue with the globvar being set and then checked almost immediately.

I believe that is exactly the issue. The variable change needs to exist in the needed state before the dialogue recognizes it. Essentially, if you are using variables to control dialogue options, you need to set a variable, have a dialogue, then check the variable for the condition to be registered with the dialogue.

 

Link to comment
Share on other sites

Posted (edited)
38 minutes ago, Vagrant0 said:

I believe that is exactly the issue. The variable change needs to exist in the needed state before the dialogue recognizes it. Essentially, if you are using variables to control dialogue options, you need to set a variable, have a dialogue, then check the variable for the condition to be registered with the dialogue.

 

To be honest, I used to only have topic [A] with the function running in the 'pre' fragment (generating the globvar) and the conditions (with the globvar) in the same topic. I recognized the issue and so split it to [A] and {B} thinking that would split the setting of the globvar and the checking of the condition. Apparently that's a no. It's as if [A] and {B} topics load up simultaneously.

Edited by csbx
Link to comment
Share on other sites

I have not full tested this, but I do use it in the context of forcegreets where it works like this:

The game engine sort of mashes up the topicinfos that are linked by invisible continue.  Your scripts execute correctly, but it you don't set a prompt text on the 2nd segment, the 2nd segment's follow up topic menu will show while the 1st segment is still being said.

Add a dummy/ineffectual prompt on the 2nd segment of your invisible continue.  It will then wait for the 1st segment to be done before evaluating the conditions for the possible continuations from the 2nd.

Link to comment
Share on other sites

6 hours ago, csbx said:

To be honest, I used to only have topic [A] with the function running in the 'pre' fragment (generating the globvar) and the conditions (with the globvar) in the same topic. I recognized the issue and so split it to [A] and {B} thinking that would split the setting of the globvar and the checking of the condition. Apparently that's a no. It's as if [A] and {B} topics load up simultaneously.

I think it's because variable changes that execute from dialogues are not considered in real-time. The variable that a dialogue option is checking needs to exist for some time before the dialogue option gets displayed in order to be acknowledged. I forget the specifics, but it might not even be acknowledged unless the dialogue with the subsequent topic is spoken again.

If I remember correctly, if responses to B are based on a variable set in A, you need a filler dialogue between A and B to give time for the game to acknowledge the variable change so the correct dialogue is used for B.

 

2 hours ago, xkkmEl said:

I have not full tested this, but I do use it in the context of forcegreets where it works like this:

The game engine sort of mashes up the topicinfos that are linked by invisible continue.  Your scripts execute correctly, but it you don't set a prompt text on the 2nd segment, the 2nd segment's follow up topic menu will show while the 1st segment is still being said.

Using a forcegreet might be a workaround here depending on what kind of dialogue we are doing since it closes the dialogue and immediately re-evaluates the conditions. The problem is that it can create some flow strangeness.

Link to comment
Share on other sites

Posted (edited)

You guys gave me an idea about one possibility unconsidered. It just so happened that the pertinent dialogue had no .iip files. I generated them and it seems that has solved things--question mark. I earlier tried the force prompt between dialogues and that didn't seem to take so I'm probably looking at a forcegreet if this turns out not to be solved--though it would be a PIA to implement here.

Edited by csbx
Link to comment
Share on other sites

On 4/25/2024 at 6:38 PM, xkkmEl said:

Please do report of success/failure of your lip file experiment!

From what I've experienced in testing, there's zero problem now. I'll confess, though, that there also was no topicinfo available with all conditions satisfied--but that shouldn't have forced showing a topic that certainly wasn't satisfied either.

Ghost ejected from machine for now.

Link to comment
Share on other sites

On 4/25/2024 at 6:38 PM, xkkmEl said:

Please do report of success/failure of your lip file experiment!

Okay - I have a second data point here. It happened again on a different portion of dialogue. Generating .lip file did nothing. I also tried deleting conditions, exiting out, and re-adding them. No change.

Finally, I just deleted the topicinfos (with the conditions that were getting ignored) altogether and re-added them. Solved.

My conclusion: when npc responses that are supposed to be chosen via conditions behave erratically, just delete the topics and re-write them.

Link to comment
Share on other sites

Okay, I hate to say it, but it's a sufficiently ugly problem that I'd like to dig a little deeper. It's back, friends !

So here's the problem. We thought the issue may have been a timing issue in terms of dialogue windows loading up perhaps before a function has done its thing within a previous dialogue's fragment.
But the case I have now is as follows: the function runs and sets a globalvar to, say, 90. I'd understand if the next dialogue with the >= 90 condition didn't satisfy so didn't show up (could be timing). However, if I run the same dialogue again, that global var is still at 90. And so if I choose the exact same dialogue that runs the same function that will yield globalvar = 90, the globalvar will be 90 no matter the timing. And yet the >=90 conditioned dialogue doesn't show and the dialogue just exits. Hilariously, if I make the condition <90, the dialogue shows up. I also tried setting the condition to = 90. It doesn't show up. I check the globalvar in console and it is 90.000 throughout the process.

I'm losing my mind and don't know how to proceed.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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