Jump to content

Starting / Stopping sounds help


crazytechnokid

Recommended Posts

From your explanation and example, ESMMusicFollower should be an object (Movable Static, Activator, or anything that has the "Looping Sound" button on its form), where you assigned your Sound through the "Looping Sound" button, and the bobblehead mesh as its model, correct? I would think that would work to play the sound when that bobblehead (your ESMMusicFollower object) appears).

 

A note: if you get that part working, in your ScriptEffectFinish block you should add:

 

        rMusicFollower.Disable
       rMusicFollower.MarkForDelete

 

My guess is that something might not be set up right with the Sound object. I haven't tried to create and test a setup like this, but it's essentially what happens in Feng Shui if you're in Spawn Mode and you cycle through some objects that have a looping sound - so there should be a way to get it working. As a test try using an existing vanilla object that has a looping sound, such as "GenericConsolePanel05" - it's a small wall console that is created as a MSTT and has a low hum as a looping sound. In your script simply replace ESMMusicFollower with GenericConsolePanel05, and see what happens.

 

I downloaded the file you posted above - a bit later I'll take a look and let you know if I have any suggestions.

 

EDIT:

Actually, try using ComputerRack01 for the test instead of GenericConsolePanel05. It uses a more noticeable looping sound.

Link to comment
Share on other sites

Alright i just did that, replaced the object with ComputerRack01, but no sound came from it.. =\, its either my script or possibly a game setting? every other pre-placed object in the game have their normal looping sounds playing, oh and the file you downloaded is probably to old one, it doesn't use the invisible object to play the sound, just calls the playSound function, which SHOULD work in theory but doesn't, at least not when i tried it haha. If you cant find the Chems by the way i think i put the ID codes in the READ ME.txt file.
Link to comment
Share on other sites

Ok, I think the problem is because the object with the looping sound is being added during MenuMode (while the PipBoy is open). I'll see if I can find a simple way around that.
Link to comment
Share on other sites

Alright, give this a try:

 

ScriptName ESMActivatorsSCRIPT
ref rMusicFollower
int bRunOnce

Begin ScriptEffectStart
Player.AddItem ESMActivator 1
set rMusicFollower to Player.PlaceAtMe ESMSoundPlayer 1
rMusicFollower.Disable
SGTM .4
End

Begin ScriptEffectUpdate
if bRunOnce == 0
	if MenuMode == 0
		rMusicFollower.Enable 0
		set bRunOnce to 1
	endif
endif
End

Begin ScriptEffectFinish
SGTM 1
rMusicFollower.Disable
rMusicFollower.MarkForDelete
End

 

One drawback this has, is that the music won't follow you through door transitions or fast-travel, like it would if played with PlaySound. You could add a little extra code to make it do that, but the music would start over again from the beginning - with PlaySound it continues from where it left off. Also on your Sound object, you want to uncheck "2D Radius", otherwise it will get quieter as you move away from where you started it. Besides being able to stop the sound whenever you want, it seems that it also adds a nice little fade out when the reference is disabled.

 

But actually, if you are only going to use this with an effect that has a known duration, I guess you might as well just use PlaySound, and either create your wav so it is the same duration as your Chem effect, or use a scripted timer like first suggested, if your wav is shorter than your effect duration.

 

Anyway, I attached a modified ESP that uses the script above. I also reduced the effect to 20 seconds for quicker testing.

Link to comment
Share on other sites

Awesome now I have sound coming from the object, but now I have 1 last problem, the sound itself is in slow motion as well as gameplay haha, seeing as radio stations arent slowed down but all other sound effects are (shooting, reloading, etc.), should i just make a new radio station with that music only and attach it to the object, and if so how do i go about making a new radio station? Or is it because the sound is being activated after i go into slow motion?
Link to comment
Share on other sites

Alright scratch that last sentence, just tested and it slows down all sounds, besides radio stations it seems, so how do i go about making my own radio station? Is there a tutorial for it or is it relatively straight forward? Thanks.
Link to comment
Share on other sites

Interesting - it seems that Radio Stations are only thing not affected by SGTM? Because sounds played with PlaySound are. I've never tried to set up a Radio Station myself. I could be wrong but from what I've looked at it's not trivial, and the documentation on the wiki doesn't seem to be very thorough.

 

I suppose if you're making a custom sound/music, you could just speed it up by the same factor that you'll later be slowing it down by with SGTM.

Link to comment
Share on other sites

Yes it is very interesting, caught me by surprise. And yea i looked into making radio stations, not easy haha, and i wouldn't be able to start the music from the beginning, just resume. And yea speeding it up by the same factor is a good idea, if i have SGTM set to .4 does that meen i'd have to speed up the song to x6 regular speed, x1.6 regular speed, or what? whats the conversion on that.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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