[SOLVED] NPCs having a dialogue in the background

Started by barnacleboy, Sat 12/02/2022 13:33:39

Previous topic - Next topic

barnacleboy

As SayBackground is non-blocking, what's the best way to have two characters have a dialogue while the player walks around doing his thing?

Also, if I do a Say at the same time as a SayBackground is being displayed, it disappears...is there any way to avoid that?

The only approach I've found so far is manually setting timers/variables to trigger the "next" line of dialogue inside a room_RepExec. It's horribly tedious!

Like:
Code: ags

    if ( (IsTimerExpired(1) == 1 ) && ( scene2 == 2 ) ) {
      cPaul.SayBackground("What a dumb question.");
      SetTimer(2, 240);
      scene2 = 3;



Crimson Wizard

#1
Quote from: barnacleboy on Sat 12/02/2022 13:33:39
The only approach I've found so far is manually setting timers/variables to trigger the "next" line of dialogue inside a room_RepExec. It's horribly tedious!

Using timer and some sort of "dialog state" variable is indeed a correct approach, but it's also true that doing so by hand for each line is very tedious and makes the script long and complicated.

The good solution is scripting a system that keeps the track of the current line and advances dialog on timer. This is beyond "Beginner's questions" though.

There has been a module named "QueuedSpeech" that seems to be doing this: https://www.adventuregamestudio.co.uk/forums/index.php?topic=23806.0
It may be a little outdated, but it appears there's an updated version posted by Potajito in the end of the thread recently.

Laura Hunt

Quote from: barnacleboy on Sat 12/02/2022 13:33:39
Also, if I do a Say at the same time as a SayBackground is being displayed, it disappears...is there any way to avoid that?

Code: ags
game.bgspeech_stay_on_display = 1


SMF spam blocked by CleanTalk