Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 29/08/2003 00:50:42

Title: mouse over hotspot & sound
Post by: on Fri 29/08/2003 00:50:42
i've got a vocal sound effect, that i want to play on mouse over hotspot but it plays it more than once, so it sounds like an echo and plays it again as the mouse comes off the hotspot, how can i stop this?

thanks
Title: Re:mouse over hotspot & sound
Post by: Ishmael on Fri 29/08/2003 09:41:20
How did you put this to work? Did you script it? If you did, then seeing the script might help solving the problem ;)
Title: Re:mouse over hotspot & sound
Post by: on Fri 29/08/2003 10:02:47
Globalscript:

int onhotspot = 0;


repeatedly_execute:

if (GetLocationType(mouse.x,mouse.y)==WHATEVERITISFORHOTSPOTS && onhotspot == 0) {
 onhotspot = 1;
 PlaySound(X);
}
else if (GetLocationType(mouse.x,mouse.y)!=WHATEVERITISFORHOTSPOTS && onhotspot == 1) onhotspot = 0;


maybe this'd work?
Title: Re:mouse over hotspot & sound
Post by: on Fri 29/08/2003 11:13:40
thanks guys, sorted it ;D