I just tried it with a sound and it will not work you will need to import it as music. Also add a timer for the change game.sound so make it When actor pressed and game.sound = 0 After 0.1 second [x] run to completion change attribute game.sound to 1
and add a timer on the other change sound attribute
nooo dont use a rule like that with a timer to toggle that attribute, thats silly
Make your own attribute called musicoff
Have a rule in your music on off button when touch is pressed:
change attribute musicoff to (musicoff+1)%2
that will toggle it back and forth beween 0 and 1 no timer needed
then just have a rule when attribute music off=1 change attribute game music volume to then in the otherwise section of that rule change attribute game music volume to 1
To do it as sound set a secondary actor to spawn that plays sound when your button change attribute is 1 and destroy that sound playing actor when the attribute is 0
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
Chaser said: To do it as sound set a secondary actor to spawn that plays sound when your button change attribute is 1 and destroy that sound playing actor when the attribute is 0
I hope you dont plan on playing that sound much. There will probably be some lag time also.
I need it as a sound to control the volume, i just need to turn the sound on and off with a button thats all no biggy tshirtbooth has a fix for it but i can't find it
JohnPapiomitis said: @chaser and its the stupidest thing ive ever heard lol no offense, you can stop sound probably alot more effeicently, AND easier and with less rules
do what i posted above itll work like a charm for you
Let's keep it positive John! He asks for advice on a sound and not music therefore I provide one. Perhaps you can provide one of your SMART easy examples on how to stop a sound as I'm sure we'd all like to know.
Chaser said: Let's keep it positive John! He asks for advice on a sound and not music therefore I provide one. Perhaps you can provide one of your SMART easy examples on how to stop a sound as I'm sure we'd all like to know.
haha i didnt mean that as me attacking you, im just saying that not really good advice to give
i posted the best and easiest way above, which is also the same way shown in the video im pretty sure
you use modulo to toggle a attribute between 1 and 0 for each touch, and base your sounds off that. its like 4 rules if that
Comments
attribute game.sound = 1
play music
change attribute game.sound to 0
when actor is pressed and
attribute game.sound = 0
stop music
or you can use pause music instead of stop music if you dont want it to start over
change attribute game.sound to 1.
Also add a timer for the change game.sound
so make it
When actor pressed and
game.sound = 0
After 0.1 second [x] run to completion
change attribute game.sound to 1
and add a timer on the other change sound attribute
Make your own attribute called musicoff
Have a rule in your music on off button when touch is pressed:
change attribute musicoff to (musicoff+1)%2
that will toggle it back and forth beween 0 and 1 no timer needed
then just have a rule when attribute music off=1 change attribute game music volume to
then in the otherwise section of that rule change attribute game music volume to 1
@fiabanfriends
do what i posted above itll work like a charm for you
Heres TSB's video.
Same thing John has posted.
He asks for advice on a sound and not music therefore I provide one.
Perhaps you can provide one of your SMART easy examples on how to stop a sound as I'm sure we'd all like to know.
i posted the best and easiest way above, which is also the same way shown in the video im pretty sure
you use modulo to toggle a attribute between 1 and 0 for each touch, and base your sounds off that. its like 4 rules if that
cheers