Jump to content

Stop playing sounds


eleglas

Recommended Posts

Hi, I'm trying to make a helmet that will play the MZ Space Helmet breathing sound if it is equipped, and not when its not equipped, but I'm having some trouble.

 

The script works for the first part, the sound plays continuously while it is equipped, however it doesn't stop even when I unequip the helmet!

 

I have tried alot of ideas: Variables, moveto commands, etc but nothing seems to work, and because there doesn't seem to be a stop sound command I'm out of ideas, I was wondering if anyone could help me with this problem?

 

Thanks guys.

Link to comment
Share on other sites

Would you agree on posting it? What did you exactly use to trigger it? Did you try to overrule it with a sound that only runs once when unequipped? I've heard this before, continues plays of sound can let it do so for a long time. You could also try to time it. Now it'll probably run every frame, so a command is given while it hasn't run yet...maybe it'll run nicely if you time it to play when the sound is over. (even if it just a second or so!)
Link to comment
Share on other sites

Well I'll show you a few of the scripts I've tried:

 

This one I tried to just Disable the sound on unequip:

 

Begin Gamemode

BreathingREF.Moveto Player

If Player.GetEquipped 000BrellaSSHelmet == 1

BreathingREF.Enable

Else

BreathingREF.Disable

Endif

END

 

This one I used to try and move the sound away:

 

Begin Gamemode



If Player.GetEquipped 000BrellaSSHelmet == 1

BreathingREF.Moveto Player
BreathingREF.Enable

Else

BreathingREF.Moveto SoundBreathingREF
BreathingREF.Disable

Endif

END

 

And this is my Variable one:

 

Short DoOnce

Begin OnEquip

Set DoOnce to 0

END

Begin Gamemode

If Player.GetEquipped 000BrellaSSHelmet == 1 && DoOnce == 0

BreathingREF.Moveto Player
BreathingREF.Enable

Set DoOnce to 1

ElseIf Player.GetEquipped 000BrellaSSHelmet == 0 && DoOnce == 1

BreathingREF.Moveto SoundBreathingREF
BreathingREF.Disable

Set DoOnce to 0

Endif

END

 

None of these scripts worked.

 

Hope that helps.

Link to comment
Share on other sites

Sounds are initially not made to get moved and can be quite strange. It's the same problem that people found when they deleted oblivion gates...while the crisis didn't even started or was already ended..and while they removed the sound..it seems to stick in the game. Have you tried just moving it?

 

Something might be related to the 000s you're using before the helmet you're using. It expects a form-id to come and therefore it might malfunction. You should always start with a letter to be sure it won't. So putting an A before it (A000BrellaSSHelmet ) might solve things. It might be useful to do this anyway as future problems may be averted.

It might be better to remove the helmet out of the second block, as it will not run without the DoOnce anyway and will stop the sound that way if the helmet is off, (as the first will not run).

 

Another try would be to play the sound from an object instead of a sound, but that would need a timer and variables as it's constantly moving. You didn't tick the loop at the sound btw? As it will run and move every frame right now so it wouldn't need to. You could also tick the random-location and see if that anything to do with moving sounds (It's not supported, therefore unknown what it does.).

 

You put DoOnce to 0 at equip, but that wouldn't be necessary when you ask the helmet to be equipped at Gamemode.

variables start at 0 anyway. I just go them both out, as the script runs from the helmet right?

 

===

Before this I totally missed the script a bit. (As I was wearing just one contact lens ;D.)

 

It might also be better to use this format in gamemode. &&s always get checked for BOTH. Even though one is false

Try one of these.. maybe it'll work:

 

Short DoOnce

Begin OnEquip
BreathingREF.Moveto Player
BreathingREF.Enable
set DoOnce to 1
End

Begin OnUnequip
set DoOnce to 0
BreathingREF.Disable
BreathingREF.Moveto SoundBreathingREF
End

Begin Gamemode

If DoOnce == 1
BreathingREF.Moveto Player
Endif

END

Short DoOnce

Begin OnEquip
set DoOnce to 1
End

Begin OnUnequip
set DoOnce to 0
BreathingREF.Disable
End

Begin Gamemode

If DoOnce == 1
BreathingREF.Moveto Player
BreathingREF.Enable
Set DoOnce to 2

ElseIf DoOnce == 2
BreathingREF.Disable
BreathingREF.Moveto SoundBreathingREF

Set DoOnce to 1
Endif

END

Link to comment
Share on other sites

While it is true that sounds can be managed and viewed as objects, you can also create a script that uses PlaySound to make the player hear a sound that seems to be centered at his location. That could be used simulate the sound of breathing inside a closed helmet. Does the MZ Space Helmet breathing sound loop? If you have a nonlooping sound that is timed to repeat play only if the player has the helmet equipped, then it will stop playing if the helmet is unequipped. It would not require following the player with a sound.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...