SOLVED - Problem with conversation between two characters

Started by SirLean, Wed 26/07/2023 01:57:57

Previous topic - Next topic

SirLean

So, I've tried to make this work for the last 4 hours. Tried almost everything. Densming's tutorials, manuals, you name it.

So basically what I'm tried to do is pretty simple:

Main character meets Character B. They exchange several lines (like 20 to be exact), Character B ends conversation with "You got something for me?"

And then, I need the next interaction (I'm using the Interact mode to start conversations) to not trigger the entire conversation again. Instead of the 20 lines, I need Character B to simply say "You got something for me?" with every click on him.

I tried everything, but when the conversation finishes I click on Character B and he keeps saying the same ol' 20 lines.

I need him to only say the 20 lines when I first click on him, the 2nd, 3rd, 4th and so on, he just have to repeat his last line.

Thanks so so so much.  :smiley:

NOTE: So, I think I solved it.

I did this. First I made the dialogCounter global varible Desming showed in his YT tutorial.


Code: ags
 if (dialogCounter<=0) {
//DIALOG
dialogCounter++;
 }
 
 else {
   cCharacterB.SayBackground("You got something for me?");
 }

Crimson Wizard

There's a function called Game.DoOnceOnly which is meant to do something only once during the game.
It allows to avoid making lots of variables for each case when you need something like this.

https://adventuregamestudio.github.io/ags-manual/Game.html#gamedoonceonly

Khris

Also note that your question title and lots of its text suggest this problem has something to do with characters or conversations, but that is absolutely not the case. It's simply about reacting differently to the same event.

Identifying what is irrelevant information will usually make it much easier to find existing solutions.

SMF spam blocked by CleanTalk