Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: j-Hed on Fri 27/02/2004 15:28:09

Title: "Doesn't work" -phrases
Post by: j-Hed on Fri 27/02/2004 15:28:09
Hi everyone!

2 Questions...

1) I have come this far of making my character say/think some phrases when the object/hotspot

isn't interactable:

 
// script for hotspot4: Look at hotspot
Random(4);
DisplayThought(EGO, "&3 No I wouldn't.");
DisplayThought(EGO, "&4 Nope.");
DisplayThought(EGO, "&5 SIGH...");
DisplayThought(EGO, "&6 I don't need that.");  
DisplayThought(EGO, "&7 I don't need to.");

BUT, now he thinks all of the phrases after each other, I wan't him to say one phrase at a time randomly. I tried "else" and "if" so on but I never got it to work.

2) I am trying to make the player character say these "doesn't work"- phrases when an

object/hotspot hasn't got any interaction.
I am very bad at scripting but I thought it would be put under "repeadedly execute" in

global script or something.


THank you all!
Title: Re:"Doesn't work" -phrases
Post by: Darth Mandarb on Fri 27/02/2004 15:35:03
I get a little iffy in this area ...

1) How about using if statements and return;
2) Search for unhandled event in the help file?

Might that work?
Title: Re:"Doesn't work" -phrases
Post by: Alynn on Fri 27/02/2004 15:57:14
Quote from: j-Hed on Fri 27/02/2004 15:28:09
Hi everyone!

2 Questions...

1) I have come this far of making my character say/think some phrases when the object/hotspot

isn't interactable:

 
// script for hotspot4: Look at hotspot
Random(4);
DisplayThought(EGO, "&3 No I wouldn't.");
DisplayThought(EGO, "&4 Nope.");
DisplayThought(EGO, "&5 SIGH...");
DisplayThought(EGO, "&6 I don't need that.");  
DisplayThought(EGO, "&7 I don't need to.");

BUT, now he thinks all of the phrases after each other, I wan't him to say one phrase at a time randomly. I tried "else" and "if" so on but I never got it to work.

2) I am trying to make the player character say these "doesn't work"- phrases when an

object/hotspot hasn't got any interaction.
I am very bad at scripting but I thought it would be put under "repeadedly execute" in

global script or something.


THank you all!

for 1

int rand = Random(4);
if (rand == 1) DisplayThought(EGO, "&3 No I wouldn't.");
else if (rand == 2) DisplayThought(EGO, "&4 Nope.");
else if (rand == 3) DisplayThought(EGO, "&5 SIGH...");
else if (rand == 4) DisplayThought(EGO, "&6 I don't need that.");  
else DisplayThought(EGO, "&7 I don't need to.");

For the no interaction just put the script in the anyclick on hotspot/object interaction.
Title: Re:"Doesn't work" -phrases
Post by: j-Hed on Fri 27/02/2004 16:46:28
THANK YOU Alynn and Darth!

It works perfectly!




...im now on my way to finish my playable demo...
Title: Re:"Doesn't work" -phrases
Post by: TerranRich on Sat 28/02/2004 05:38:24
You know, this is covered in the "unhandled_event" function completely. Just check the Manual for it.
Title: Re:"Doesn't work" -phrases
Post by: SillySue on Wed 03/03/2004 17:49:39
When you write:

"else DisplayThought(EGO, "&7 I don't need to.");"

what does &7 mean? Is it the dialog number?

Title: Re:"Doesn't work" -phrases
Post by: Gilbert on Thu 04/03/2004 01:45:42
It's related to the speech sound file played, see

Other Features --> Advanced Features

from the manual for more details.