Attaching a Sound Effect to a Book

Post » Sun May 18, 2014 8:47 am

When I read my custom book, I get a screen message box telling me I have done it, but there is no sound effect.

How would I add the sort of BOOM sound effect you get when you complete a quest?

I want to use something like ui_quest_update.wav when I read the book.

I found http://www.creationkit.com/Sound.Play_(Papyrus)but I cannot get it to work with int Function Play(ObjectReference akSource) native.

I also http://www.creationkit.com/PlaySound3D, but I cannot find a way to attach UILevelUp (which is a similar sound) to the book and it won't go in the script.

I think it may be because the sound script extends form = ScriptName Sound extends Form

but my script extends ObjectReference.

Is there any way to make a sound lay in an ObjectReference Script?

Cheers

~.~

User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Sun May 18, 2014 10:51 am

This is how i get the sound UISpellLearned to play when the player learns a spell from a book (not spell tome).

I created a new Sound Marker, named it as appropriate, ie mySoundMarker.

In the drop down box filled it with UISpellLearned (Category - Sound Descriptor)

On the script attached to the book,

Sound Property mySoundMarker AutoSpell Property mySpell Auto Event OnRead()     Game.GetPlayer().AddSpell(mySpell)        mySoundMarker.Play(Game.GetPlayer()) EndEvent 
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Sun May 18, 2014 1:45 am

Play is a function from the Sound script, so you have to import a sound marker as a Sound property and call Play on it. There is no existing sound marker for the sound you mentioned, but UISkillIncrease is similar. An example:

Sound Property UISkillIncrease AutoEvent OnRead()    UISkillIncrease.Play(Game.GetPlayer())EndEvent

And, for funsies, in your complete script:

ScriptName _shb_HP_FeybloodScript  Extends ObjectReferenceSound Property UISkillIncrease AutoIngredient   Property   ScalyPholiotaBits  AutoIngredient   Property   MoraTapinellaBits  AutoIngredient   Property   CreepClusterRoot   Auto  Event OnRead()       utility.Wait(0.0100000)       UISkillIncrease.Play(Game.GetPlayer())       Debug.Notification("You learned the recipe!")           ScalyPholiotaBits.LearnEffect(0)           ScalyPholiotaBits.LearnEffect(1)           ScalyPholiotaBits.LearnEffect(2)           ScalyPholiotaBits.LearnEffect(3)           MoraTapinellaBits.LearnEffect(0)           MoraTapinellaBits.LearnEffect(2)           MoraTapinellaBits.LearnEffect(3)           CreepClusterRoot.LearnEffect(0)           CreepClusterRoot.LearnEffect(2)           CreepClusterRoot.LearnEffect(3)EndEvent

Now I recommend that you find a way to make the script only run once.

User avatar
Chloe Lou
 
Posts: 3476
Joined: Sat Nov 04, 2006 2:08 am

Post » Sun May 18, 2014 11:06 am

That was a test script for a recipe scroll, but the full script I the book has several states, and the final state after reading is nothing happens.

User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Sun May 18, 2014 12:18 am

Nice! So is this the end of the alchemy book saga in creation kit questions? :wink:

By the way, I looked at that PlaySound3D page, and it's a console command, so you can't use it in scripts. It's functionally identical to Play in Papyrus though, except you call it on a reference and specify the sound as a parameter.

User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Sun May 18, 2014 5:10 am

So I could use custom sound files, then?

~.~

User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Sat May 17, 2014 10:11 pm

LOL!

Umm... well, there might be a few more things I'd like to do with it. Like set off an alarm when it is stolen in a wide enough radius to attract some guards and everyone in the building.

And maybe have a DING! DING! DING! DING! DING! proximity alarm bell actually ring unless you pass a Sneak skill check.

And perhaps add some levelled locks to the doors that do not have locks in Vanilla, with a chance to set off an Alarm Trap, so if you have sufficient Lock Picking skill, you could spot the trap and try to disarm it. Then pick the lock to open the door.

Otherwise, "The Bells! the Bells!" :bonk:

Cheers!

~.~

User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Sun May 18, 2014 3:42 am

I haven't tried

User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm

Post » Sun May 18, 2014 11:33 am

Yep :)

I use a new custom sound in my Buried Treasures mod (http://m.youtube.com/watch?v=Vanluonhijs). During the fade-to-black, that digging SFX isn't vanilla

Like Heilghast said, first you make a new sound descriptor that contains your sound file, then you make a new sound marker and fill it with your custom descriptor. Then lastly in your script:

Sound Property mySFX  AutoActor Property playerREF  AutoEvent OnSomething()   mySFX.Play(playerREF)EndEvent
(You fill the Sound property with your new Sound Marker)

- Hypno
User avatar
luke trodden
 
Posts: 3445
Joined: Sun Jun 24, 2007 12:48 am

Post » Sat May 17, 2014 11:30 pm

I like that. I wish Bury The Dead had that digging animation in it.

User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm


Return to V - Skyrim