Best practice question regarding simultaneous option

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mcfurgerburger
Posts: 12
Joined: Thu May 26, 2022 11:33 am

Best practice question regarding simultaneous option

Post by mcfurgerburger »

Hey all, have this dilemma that I solved by setting simultaneous to true, which only caused a new issue. So I am wondering what the best practice is for this case.

Dilemma: I use a dialogue system trigger on a door to ask the player if they want to enter a room or not, and also to tell the player if they cannot enter the room at the time. Once the player transfers to the room after saying yes, a new dialogue is automatically started in the room. Without the simultaneous option however, the new dialogue does not start because the game thinks the previous conversation is still going on.

Solution: I solved this by turning simultaneous on in the dialogue system manager.

Problem this created: When I go back to the door and try to use it when the player is not allowed in the room (one of the nodes in the conversation), if I trigger the conversation too quickly (because I use the gamepad to interact/use), it will keep replaying the conversation over and over. So spamming say the A button on my gamepad will keep replaying the conversation.

What is the best practice to solve this? I tried creating a lua function to enable/disable simultaneous but this seems to run asynchronously when used in the conversation or in the dialogue system trigger actions, which results in conversations freezing. Honestly it's absolutely ridiculous that if I use the same button for triggering conversations as for speeding up conversations, it instead tries to trigger the conversation again. If it didn't have that, I wouldn't need simultaneous at all.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best practice question regarding simultaneous option

Post by Tony Li »

Hi,

It sounds like you were trying to use Allow Simultaneous Conversations to work around a different issue. Let's address the root issue, which is that the door conversation is still active when you change scenes. The goal then is to make sure the conversation ends when you change scenes.

Are you using the LoadLevel() sequencer command to change scenes? For example:
  • NPC Dialogue Text: "Go through the door?"
    • PC Dialogue Text: "Yes."
      Sequence:

      Code: Select all

      LoadLevel(AnotherRoom)
If so, then if you require the player to click a continue button to dismiss subtitles, you may need to add a Continue() sequencer command:
  • NPC Dialogue Text: "Go through the door?"
    • PC Dialogue Text: "Yes."
      Sequence:

      Code: Select all

      required LoadLevel(AnotherRoom);
      Continue()
The 'required' keyword guarantees that LoadLevel() runs even if the Continue() command somehow exits the command queue first.

I'm assuming the dialogue entry node with the LoadLevel() sequencer command is the last node in the conversation. If not, you can add a StopConversation() sequencer command to force the conversation to stop.
mcfurgerburger
Posts: 12
Joined: Thu May 26, 2022 11:33 am

Re: Best practice question regarding simultaneous option

Post by mcfurgerburger »

I am actually not using LoadLevel as I wasn't aware of it. I use my own loading method that unloads the current scene and loads the next scene asynchronously so that I can show a loading screen and progress bar. If the dialogue system's internal methods have a better way of doing that, I might switch to it.

But I'll try using StopConversation to see if that fixes the issue with overlapping with the next conversation in the room.

update: StopConversation seems to have fixed my issue!

I am still curious as to whether there are better practices for loading between scenes/showing loading screens w/ the dialogue system.
Post Reply