666fb2858a454

666fb2858ab6b
1 Guest is here.
 

Topic: Switching sound on and off Read 1297 times  

666fb2858b025
Anybody?

Basically want to switch a sound on during an event, then switch it off after event.

666fb2858b0f1lostone1993

666fb2858b13f
hmm, I dont think you can switch sound on and off, but you might be able to use a trap to move a sound object back and forth, or destory and spawn to achieve the same effect

Il have a more detailed look once I am back on my laptop with shocked
666fb2858b4e8
hmm, I dont think you can switch sound on and off, but you might be able to use a trap to move a sound object back and forth, or destory and spawn to achieve the same effect

Il have a more detailed look once I am back on my laptop with shocked

I was getting mildly tired of moving things around with teleport traps, but I suppose if I have to do it I will lol

If there is another way to do it, that would be great :) I'll play around awaiting your response.
666fb2858b63b
You can turn sounds on and off with the appropriate signal type, turn off from a signal via inverter turns off a sound trap as eg.

Or make a sound clip of correct length.

666fb2858b7e5Nameless Voice

666fb2858b835
If your sound is an ambient sound (AmbientHacked property), you can turn it on or off with the TrapAmbientOff script.

TurnOn should turn the sound on, and TurnOff should turn it off.

666fb2858bb03voodoo47

666fb2858bb54
You can turn sounds on and off with the appropriate signal type, turn off from a signal via inverter turns off a sound trap as eg.
any chance you could explain this a bit more? I need to set up an enviro sound to start turned off, then turn it on via a triggerdelay.

666fb2858bc3fZylonBane

666fb2858bc8d
Try adding the "TurnedOff" flag?
666fb2858bdb9
If it's a sound trap (actually, trapsoundamb for ambients), then a turn on (ie a standard switchlink from any controller, or via scripting) will turn the sound schema set in sound: object sound to on. To turn it off, send it via an inverter to switch it to a TurnOff signal, or use something that generates turn offs automatically like twostatebutton script. If it's ambient, use NV's solution instead as ambient have better propagation controls, add the script to the ambient marker and set it to be inactive by default/ at start on the standard ambienthacked property as per ZB.

666fb2858c24avoodoo47

666fb2858c2a5
If it's a sound trap (actually, trapsoundamb for ambients), then a turn on (ie a standard switchlink from any controller, or via scripting) will turn the sound schema set in sound: object sound to on.
ok, this worked pretty well, but is there a way to control the radius? it is quite small when using a sound trap, and (seems) infinite when using ambient sound trap.

use NV's solution instead as ambient have better propagation controls, add the script to the ambient marker and set it to be inactive by default/ at start on the standard ambienthacked property
I will need some more/simpler explanation I'm afraid. not the brightest bulb here, remember?

//I've tried to set up a tripwire switchlinked to an inverter, switchlinked that to an ambient soundtrap with ambienthacked prop, with the intention of turning the sound off once the tripwire is triggered. this did not work.
« Last Edit: 20. October 2013, 18:29:33 by voodoo47 »
666fb2858c4ad
You need to add TrapAmbientOff to the ambient marker as well, not sure if you did. If you want radius control then you will need to use ambienthacked as the soundtrap will either have no dispersion if ambient or a set dispersion based on the sound level/ flags of the schema.

To turn the sound off, add the above script to the marker, create a trigger (tripwire/ button) and link that to an inverter, and the inverter to the ambient marker. If you use a standard tripwire there may be problems triggering it multiple times, if you just want it turned on->off, once, then you may want to use a once tripwire, or to piggyback something plot related that happens once only.
Acknowledged by: voodoo47

666fb2858c5d0voodoo47

666fb2858c626
ok, apparently I'm dumb. tried this:

tripwire(player,enter,once)->switchlink->inverter->switchlink->marker(ambienthacked with the desired sound,script TrapAmbientOff)

if I understand correctly, this should start out with the sound being played, and disable it once player enters the tripwire. well, it does play, but doesn't stop when the tripwire is triggered. tried it with plain marker, sound trap, ambient sound trap, all the same.

what am I missing here?
666fb2858c75f
Try it without the inverter.

I think NV's instructions may be wrong way around, ie TurnOn turns the sound off and TurnOff turns the sound on. My quick test had it work (ie turn sound off) with a straight tripwire -> marker. Should be the other way around as that is the way everything else works including the sound traps, but seems to be other way round by actual testing, so...

666fb2858c82dvoodoo47

666fb2858c87e
confirming - a TurnOn signal (no inverter) will turn the sound off, and TurnOff (inverter) will turn it back on (at least for a marker with an ambienthacked prop, that is).

we should probably make a note about this somewhere in the Shocked guides.


thanks for the help.
1 Guest is here.
Nathaniel Hawthorne: No man, for any considerable period, can wear one face to himself, and another to the multitude, without finally getting bewildered as to which may be true.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
666fb2858d1e9