Playing a sound in my script

Post » Tue Jun 19, 2012 10:34 am

It's a small thing, but sadly i can't get it to work for some reason , if someone can give me a quick help with this, thanks.

Basically the script is : if you pick an item on a dead body called " Warrior's Soul " it will show a message, fade your screen for 3 secs, and then place a burnt corpse at the body place.

Works great, but i need a fire sound or something like that to play during the 3 black screen ( fade ) seconds. Also if someone knows how to add a fire effect to this script, would be the cherry on the cake. Thanks.

Scriptname BloodyRibcageScript extends ObjectReference  Container Property TreasBurntCorpse04COPY0000 AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)		If akNewContainer == Game.GetPlayer()				Debug.Notification("The smell of burning flesh...")				Game.FadeOutGame(false, true, 3.0, 3.0)				akOldContainer.PlaceAtMe(TreasBurntCorpse04COPY0000)				akOldContainer.Disable()		EndIfEndEvent  
User avatar
Mark
 
Posts: 3341
Joined: Wed May 23, 2007 11:59 am

Post » Tue Jun 19, 2012 2:53 am

You need to define a property of type Sound. Then, in the CK, navigate to Audio --> Sound Descriptor in the Object window. Find a fire sound you like (modify however you wish, but make sure it's a new form, if you do that), go to the Sound Marker thingy, make a new one, give it a FormID and choose your sound descriptor from the drop down list. To play it in your script, you'd do something like this:

Scriptname BloodyRibcageScript extends ObjectReference  Container Property TreasBurntCorpse04COPY0000 AutoSound	  Property aaaSomeNoises              Auto ; Sound defined here.Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)  If ( akNewContainer == Game.GetPlayer() )	Debug.Notification("The smell of burning flesh...")	Game.FadeOutGame(false, true, 3.0, 3.0)	aaaSomeNoises.Play(Self) ; The parameter is from where the sound is played.	akOldContainer.PlaceAtMe(TreasBurntCorpse04COPY0000)	akOldContainer.Disable()  EndIfEndEvent
Edit: You can play the sound anywhere in your script, I just placed it there because I assumed that's where you'd want it.

As for the visual effect: no clue. Haven't worked with those yet.
User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

Post » Mon Jun 18, 2012 11:17 pm

Thanks.

Tried it, the script complie well ,but sadly ingame no sound is playing.
User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Tue Jun 19, 2012 9:18 am

Halp :blush:
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Tue Jun 19, 2012 1:22 am

Someone ? Still can't manage to hear the sound.
User avatar
Lexy Dick
 
Posts: 3459
Joined: Mon Feb 12, 2007 12:15 pm

Post » Mon Jun 18, 2012 9:20 pm

Try this? I'm not exactly sure what your script is attached to so this could work better:
aaaSomeNoises.Play(TreasBurntCorpse04COPY0000) ; The parameter is from where the sound is played.
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Tue Jun 19, 2012 6:45 am

For an example I added the script DefaultPlaySoundAtLinkSCRIPT on the trigger, and then manually selected itself as the Linked Ref, and it works, so try that out as a start and work towards to what you need it for.
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm


Return to V - Skyrim