Author Topic: [SOLVED] Dialogue Stop and Colour Mysteries  (Read 510 times)

Skeevy Wonder

  • Gus, cats, games, and love for all.
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with story design
    • I can help with voice acting
    • I can help with PR
    • Skeevy Wonder worked on one or more games that was nominated for an AGS Award!
[SOLVED] Dialogue Stop and Colour Mysteries
« on: 25 Jan 2022, 06:18 »
Hello and happy new year, everyone!  :-D

In one of my dialogues the third question is meant to close the conversation...


Code: Adventure Game Studio
  1. @3
  2.  
  3.   if (JerryOneQfive < 1)
  4.     {
  5.     cMalcolm.SayBubble("Please just go away!");
  6.  
  7.     cJerrysHead.SayBubble("Hmm hmm hmm da da da...")
  8.  
  9.     JerryOneQfive++;
  10.     }
  11. stop
  12.  


...but for some reason you have to click the option twice for the dialogue to close.

And now for the embarrassing question:

When I began creating the game in October of 2020 I chose this hideous red and yellow colour combo (red dialogue options, hover to bright yellow), but can no longer find the setting.  ???

Thanks in advance!
« Last Edit: 10 Feb 2022, 04:17 by Skeevy Wonder »

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Re: Dialogue Stop and Colour Mysteries
« Reply #1 on: 25 Jan 2022, 08:02 »
That would be these two:
game.dialog_options_highlight_color = xxx; //color used to draw the active (selected) dialog option
Character.SpeechColor = xx;

Re: Dialogue Stop and Colour Mysteries
« Reply #2 on: 25 Jan 2022, 09:08 »
When you say you have to click it twice, are you saying that absolutely nothing is happening after the first click?

Skeevy Wonder

  • Gus, cats, games, and love for all.
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with story design
    • I can help with voice acting
    • I can help with PR
    • Skeevy Wonder worked on one or more games that was nominated for an AGS Award!
Re: Dialogue Stop and Colour Mysteries
« Reply #3 on: 27 Jan 2022, 06:35 »
Thanks a million, arj0n! I didn't even know about that list of game variables in the manual/help! I'd chosen dark red as the speech colour within the interface, maybe yellow is the default highlight? Anyway, awesome--that's fixed that (and you've opened up a new world of possibilities).  ;-D

When you say you have to click it twice, are you saying that absolutely nothing is happening after the first click?

Hullo, Khris!  ;-D

Yeah, after clicking the option that's meant to close the dialogue, the lines for the characters are displayed as scripted, but then the dialogue options are back again. If you click the aforementioned option again it does actually close.

My intention is for cMalcolm to say his line, cJerrysHead to say his, and for the dialogue to be gone. I've also tried putting return RUN_DIALOG_STOP_DIALOG; within the if statement in various places but it doesn't appear to make any difference.

Code: Adventure Game Studio
  1. @3
  2.  
  3.   if (JerryOneQfive < 1)
  4.     {
  5.     cMalcolm.SayBubble("Please just go away!");
  6.  
  7.     cJerrysHead.SayBubble("Hmm hmm hmm da da da...");
  8.  
  9.     JerryOneQfive++;
  10.     return RUN_DIALOG_STOP_DIALOG;
  11.     }
  12. stop
  13.  


Thanks again, everyone!



Re: Dialogue Stop and Colour Mysteries
« Reply #4 on: 27 Jan 2022, 08:43 »
The only explanation I can think of is that due to a scripting error elsewhere, the dialog actually stops but then is immediately started again. Would that be possible?

Skeevy Wonder

  • Gus, cats, games, and love for all.
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with story design
    • I can help with voice acting
    • I can help with PR
    • Skeevy Wonder worked on one or more games that was nominated for an AGS Award!
Re: Dialogue Stop and Colour Mysteries
« Reply #5 on: 28 Jan 2022, 04:47 »
The only explanation I can think of is that due to a scripting error elsewhere, the dialog actually stops but then is immediately started again. Would that be possible?

It absolutely seems like it. And my scripting skills aren't great, to put it generously. (laugh)

Here's the bit from the global script that starts the dialogue (and is supposed to fade cJerrysHead out after the dialogue is exhausted, which also isn't working  :( ).

Code: Adventure Game Studio
  1. // TALKING TO JERRY
  2. function cJerrysHead_Talk()
  3.   {
  4.     if (JerryDialogueOne == 0)
  5.     {
  6.     // Preamble invoked only on first load of this dialogue
  7.     cMalcolm.SayBubble("Oh no...");
  8.     cJerrysHead.SayBubble("bla bla bla");
  9.     cMalcolm.SayBubble("bla bla bla");
  10.     cJerrysHead.SayBubble("bla bla bla");
  11.     cMalcolm.SayBubble("Sigh.");
  12.  
  13.     JerryDialogueOne = 1;
  14.  
  15.     dJerry1.Start();
  16.     }
  17.     // END DIALOGUE PRELUDE
  18.  
  19.    if (!dJerry1.HasOptionBeenChosen(1) || !dJerry1.HasOptionBeenChosen(2) || !dJerry1.HasOptionBeenChosen(3) || !dAskJerry1.HasOptionBeenChosen(1) || !dAskJerry1.HasOptionBeenChosen(2) || !dAskJerry1.HasOptionBeenChosen(3))
  20.     {
  21.     dJerry1.Start();
  22.     }
  23.  
  24.    if (dJerry1.HasOptionBeenChosen(1) && dJerry1.HasOptionBeenChosen(2) && dJerry1.HasOptionBeenChosen(3) && dAskJerry1.HasOptionBeenChosen(1) && dAskJerry1.HasOptionBeenChosen(2) && dAskJerry1.HasOptionBeenChosen(3))
  25.     {
  26.     cJerrysHead.Clickable = false;
  27.     int trans = cJerrysHead.Transparency;
  28.     while (trans < 100)
  29.       {
  30.       trans++;
  31.       cJerrysHead.Transparency = trans;
  32.       Wait(1);
  33.       }
  34.     }
  35.   }
  36.  


I'm happy to post the two related dialogues too, if that would help. I don't see anything missing, out of place or duplicated in them, but there could've been an oversight on my part. BTW the if statements and JerryOneQfive etc variable have since been rubbished (superfluous part of some other stuff I was trying to do).

Thanks for your help!


Matti

Re: Dialogue Stop and Colour Mysteries
« Reply #6 on: 28 Jan 2022, 14:35 »
In line 19 to 22 the dialog starts again if any of those six options has not been chosen. This seems wrong and could be the problem you're talking about.

Skeevy Wonder

  • Gus, cats, games, and love for all.
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with story design
    • I can help with voice acting
    • I can help with PR
    • Skeevy Wonder worked on one or more games that was nominated for an AGS Award!
Re: Dialogue Stop and Colour Mysteries
« Reply #7 on: 29 Jan 2022, 04:33 »
In line 19 to 22 the dialog starts again if any of those six options has not been chosen. This seems wrong and could be the problem you're talking about.

Ahhh! Thanks, Matti--that was it! I was over-complicating the situation and have removed the extra dJerry1.Start(); replaced the second if with:

Code: Adventure Game Studio
  1.     if (JerryDialogueOne == 1)
  2.     {
  3.     dJerry1.Start();
  4.     }
  5.  

I didn't want the preamble before the dialogue starts to play every time you try to talk to the character.

Again, thanks a million.  ;-D



Re: Dialogue Stop and Colour Mysteries
« Reply #8 on: 29 Jan 2022, 20:55 »
and is supposed to fade cJerrysHead out after the dialogue is exhausted, which also isn't working
Starting a dialog gets queued until the current function finishes. This is also what caused the other problem I guess, because the option logic, even if correct, is executed before the dialog even starts.

Skeevy Wonder

  • Gus, cats, games, and love for all.
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with story design
    • I can help with voice acting
    • I can help with PR
    • Skeevy Wonder worked on one or more games that was nominated for an AGS Award!
Re: Dialogue Stop and Colour Mysteries
« Reply #9 on: 10 Feb 2022, 04:15 »
Starting a dialog gets queued until the current function finishes. This is also what caused the other problem I guess, because the option logic, even if correct, is executed before the dialog even starts.

Hey! Apologies for not getting back to this sooner and marking it solved. I'd moved the fade-out section back to the main room's RepExec which seemed more logical (though I didn't know why). That sorted it out--thank you Khris for letting me know what was going on behind the scenes!

All the best!  ;-D