Jump to content

Recommended Posts

Posted (edited)

Here is the script

And the message I got is the following: PlaySound is not a function or does not exist

Scriptname aaaMWHPlaySoundScript extends ObjectReference  
{play this sound when activating the Soulfiller}

ObjectReference Property  MySoulgemFillerRef Auto
Sound property MAGMysticismSoulTrapCaptureSD auto

Event OnActivate(ObjectReference akActionRef)
	Debug.Trace("Activated by " + akActionRef)
	PlaySound (MAGMysticismSoulTrapCaptureSD)
EndEvent
	

What do I do wrong? Please help

 

Edited by MasterAub
Posted

Thanks a lot. It doesn't seem like it but this little bugger of a script will go a long way.

Posted

Ok my script does not work it compiles but it does not do the job. I am missing something

The script goes on a type of custom workbench. And to be clear I would like the workbench to play the sound upon being activated by the player.

Scriptname aaaMWHPlaySoundScript extends ObjectReference  
{play this sound when activating the Soulfiller}
	ObjectReference Property  MySoulgemFillerRef Auto
Sound property MAGMysticismSoulTrapCaptureSD auto
	Event OnActivate(ObjectReference akActionRef)
    MAGMysticismSoulTrapCaptureSD.Play(Self)
    Debug.Trace("Activated by " + akActionRef)
EndEvent

Property Name: MagMysticismSoulTrapCaptureSD

Type: Sound

Value: Default

 

Property Name: MySoulgemFillerRef

Type: ObjectReference 

Value: MySoulgemFillerRe(Id #)

Somebody help and explain to me what I do wrong

Posted

Assign the correct sound to the MagMysticismSoulTrapCaptureSD property.  A default value means that it is using what is assigned to it in the script.  The script has nothing assigned to that variable.  Thus no sound will play.  If you named the property the same as the actual sound record, you should be able to use the auto-fill button to have it correctly assigned automatically.

Properties are just variables.  They have not data associated with them unless explicitly assigned in the Creation Kit or given a value within the script itself.

  • Thanks 1
Posted (edited)

Thanks

I understand what you are saying however

I did name the property the same as the actual record sound (so I think) but the CK does not auto fill it

In the CK I found a sound in Sound Descriptor named: MagMysticismSoulTrapCaptureSD

But when press auto the CK tels me: "0 property autofilled"

Am I picking the wrong id for the sound? or the wrong sound? I am perplex

Edited by MasterAub
Posted

ok it's working

I picked up another sound and the autofilled worked just fine. The sound is playing as wanted.

Thank you so much for your patience. 

Thanks

  • 2 weeks later...
Posted

A 'Sound' property is filled with a Sound Marker object, not Sound Descriptor.

So, if you specifically want it to play the sound from "MagMysticismSoulTrapCaptureSD" descriptor,  you create a new Sound Marker form, name it however you want, and choose MagMysticismSoulTrapCaptureSD as its descriptor.   Then you can populate a script Sound property with that Sound Marker. 

  • Recently Browsing   0 members

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