Jump to content

How to get a script to play a sound effect in a script fragment?


Recommended Posts

Guest Messenjah
Posted (edited)

So, I am trying to create a simple script that will fade out the screen, play a short sound effect, and then fade back in. However, even though the creation kit page claims you can still use the "PlaySound" portion of the script, it refuses to work and the script will fail.

 

http://www.creationkit.com/PlaySound <----- link where it describes this.

 

Basically, I am using this on a script fragment within dialogue.

 

Here is the property I added to the fragment source:

 

<code>Sound Property mySound Auto</code>

 

So within the fragment, I added this:

 

Game.FadeOutGame(false, true, 35.0, 1.0)
PlaySound mySound

 

The sound points to my sound marker, NOT the descriptor. What am I doing wrong?

 

This sound should only really effect the player and should be at full volume, so it doesn't need a source to refer to. Thus, playsound is the best opiton but doesn't seem to work and the fragment will not save. I've tried this a number of different ways and I can't get it to work. Any ideas?

Edited by Messenjah
Guest Messenjah
Posted

Ah, I'll check it out. It tried it last night and it didn't work though. Is there anything I need to do with (self) to define it better? Like set "self" as a property?

Guest Messenjah
Posted (edited)

Oops, wrong window lol.

Edited by Messenjah
  • 1 year later...
Posted

well to play sounds I usually do it this way:

 

mySound.Play()

 

sometimes it doesn't compile like this so another way that always works for me is this (100% works):

 

mySound.Play(Game.GetPlayer())

 

if you want to play the sound on the player if you want to play it on another actor then you have to make an actor property and in the () put the property:

 

Actor Property myActor Auto

 

mySound.Play(myActor)

 

hope it helps.

  • 6 months later...
  • 4 months later...
Posted (edited)
  On 3/8/2015 at 5:21 PM, SmultronBusken said:

Hi!

 

Iam having a issue when Iam using my own sounds. How did you import your own sound files?

some people use Wav files, but Ive found Skyrim to be buggy when using wavs, what you can do is use multiXWM to convert the files then load them into your Data/Music/ (custom music file) then insert them into the game using the CK.

Edited by JoKelly
  • Recently Browsing   0 members

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