Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: zeta_san on Fri 15/12/2023 17:39:25

Title: random talk (SOLVED)
Post by: zeta_san on Fri 15/12/2023 17:39:25
Hi everyone
I would like to find a solution to a problem.
My character enters the quesroom and there are 2 talking
I would like them to say random sentences, different sentences every time I enter.
I also read some solutions here but I can't solve it
Title: Re: random talk
Post by: Rik_Vargard on Fri 15/12/2023 18:41:32
I suggest this for random stuff:

int Talk1 = Random (2);  //character 1 talking (3 possible answers here > 0, 1 & 2)

if (Talk1 == 0) cCharacter.Say ("Blah blah."); // random = 0
else if (Talk1 == 1) cCharacter.Say ("Bah bah."); // random = 1
else cCharacter.Say ("Bye"); //random = 2
Title: Re: random talk
Post by: zeta_san on Fri 15/12/2023 19:09:05
Thank you ! I'll try and let you know
Title: Re: random talk (SOLVED)
Post by: zeta_san on Fri 15/12/2023 19:42:19
Perfect
Title: Re: random talk (SOLVED)
Post by: Rik_Vargard on Fri 15/12/2023 19:51:47
Glad I could help :)