Page 1 of 1

Sound on/of ???

PostPosted: Sun Feb 03, 2008 6:17 pm
by wsc24
Hallo Leute,
wie kann ich es anstellen, einen Sound per Mausklik auf einen Actor ein und auszuschalten? Der Sound soll im eingeschalteten Zustand immer wiederholt werden. Gibt es ein Tutorial dazu?

Danke für Eure Hilfe

wsc24



Hi Folks,
How can I do so that a sound a mouse click on an Actor and off? The sound should have been pressed state always repeated. Is there a tutorial on this?

Thank you for your help

Wsc24

Wsc24

Re: Sound on/of ???

PostPosted: Sat May 17, 2008 5:57 pm
by DST
So there's a way for this that works for anything, not just sound. Just use a case switch to change a variable....and anything can be turned on or off.
Mousebuttondown:
Code: Select all
switch(onoff){
case 0:
PlaySound(etc);
onoff=1;
break;
case 1:
StopSound(etc);
onoff=0;
break;
}

Re: Sound on/of ???

PostPosted: Tue Jun 10, 2008 12:08 pm
by 4erv'
Hm.... why not stop the sound using :
Code: Select all
stopSound(1);

?
Or it will not work? :mrgreen:

Re: Sound on/of ???

PostPosted: Tue Jun 10, 2008 1:38 pm
by DST
lol yeah ur right. stopSound starts with a lower case s. dunno why.

And yes 0 is sounds and 1 is music.

Re: Sound on/of ???

PostPosted: Tue Jun 10, 2008 4:42 pm
by 4erv'
Explain me 1 thing: why for are words break? :mrgreen:

Re: Sound on/of ???

PostPosted: Tue Jun 10, 2008 5:46 pm
by DST
break? what you mean? as in a case switch?

break tells a case switch to stop. It will not continue down the page once it finds a true case.

this is one of the things that makes a switch superior to multiple 'if's.

Re: Sound on/of ???

PostPosted: Tue Jun 10, 2008 6:25 pm
by 4erv'
Oh... and what mean AI?
Something random? :mrgreen:
P.S. sorry for so many questions, i just want to understand all this... :mrgreen:

Re: Sound on/of ???

PostPosted: Tue Jun 10, 2008 6:38 pm
by DST
Artificial Intelligence.....

It means programming the computer to play against you.

Re: Sound on/of ???

PostPosted: Wed Jun 11, 2008 9:42 am
by 4erv'
Oh..... now i understand... :mrgreen:
Thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx ! :D