Jump to content

How do I play a sound when player is not moving, and stop otherwise?


Recommended Posts

This would be a question for the CS thread I guess. :wink: Yes it is possible with an activator and you use the playsound command in a script. If it is an object that is meant to have a working collision as well, then the script also must have at least 3 stages...

  1. Move the object to the player
  2. Disable it and let at least 1 frame to run
  3. Enable it.

If it is an object that will not be visabe nor have collisions, then the green framed invisible trigger object could be used, well copy it, give it a new objectname and move it as you please in game and do not forget to add the script with conditions to it.

Edited by Pellape
Link to comment
Share on other sites

Just move the object to the player before running it. Reference.MoveTo should work. You can use offsets if you need it

 

I tried myref.MoveTo player but it's not working. I have the persistent & initially disabled flags checked on the sound object, but those don't have anything to do with it as I've already tested it by having them checked off.

Edited by PapaLegaBooboo
Link to comment
Share on other sites

Hmm, I'm far from knowledgeable in this regard, but going by what was said in your other topics, could it be MoveTo'ing the sound object will stop the sound just like disabling it does? Or what method do you use to diagnose "it's not working" after a MoveTo call?

MoveTo is already known to cancel several other running things on the object that's moved. Maybe a playing sound effect is just one more to the list.

Link to comment
Share on other sites

 

Just move the object to the player before running it. Reference.MoveTo should work. You can use offsets if you need it

 

I tried myref.MoveTo player but it's not working. I have the persistent & initially disabled flags checked on the sound object, but those don't have anything to do with it as I've already tested it by having them checked off.

 

The 7z I provided on the other thread works for the title of this one...

  • Stand still at one end of the hall for 10 second and a sound plays.
  • Move and it stops.
  • Go to the other end of the hall, stand for 10 seconds and a different sound plays.

1 Quest Script for the Start/Stop of Sound on Player, a Function Script to reduce number of variables (game save storage) and keep it clean.

Whatever Triggers/Activators to change that sound.

I mentioned more responsive ways than a Quest Script and their caveats.

 

As I posted there, message me if you are having trouble.

As I added there, it would be ideal for either xOBSE or a plugin to resolve StopSound.

In the mean time I am more than happy to help you program what you want to achieve.

 

If anyone else sees a problem in the way this solution functions then please let me know so I can revoke it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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