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!
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?
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.
THANK YOU Alynn and Darth!
It works perfectly!
...im now on my way to finish my playable demo...
You know, this is covered in the "unhandled_event" function completely. Just check the Manual for it.
When you write:
"else DisplayThought(EGO, "&7 I don't need to.");"
what does &7 mean? Is it the dialog number?
It's related to the speech sound file played, see
Other Features --> Advanced Features
from the manual for more details.