Jump to content

Make a sound play from a static object instead of player


morrowind1979

Recommended Posts

I am trying to set up a sound that plays from a static object(DagAltar) rather than the player(self). The problem is when i substitute (self) for (DagAltar) the CK returns an error:

Scriptname DagWhisperScript extends ObjectReference  
  
Sound Property DGWhisp  Auto  

ObjectReference Property DagAltar  Auto  

Event OnTriggerEnter(ObjectReference akActionRef)
	If(akActionRef == Game.GetPlayer())
	DGWhisp.Play (DagAltar akSource)
	EndIf
EndEvent
C:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\DagWhisperScript.psc(7,15): no viable alternative at input 'DagAltar'
C:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\DagWhisperScript.psc(7,32): required (...)+ loop did not match anything at input ')'
No output generated for DagWhisperScript, compilation failed.
Can anyone tell me how to get this to work?????
Link to comment
Share on other sites

You haven't added the DagAltar property.

Yes I have check again LOL got it working by using (DagAltar) instead of (DagAltar akSource) but the problem is the sound still follows me around when I move away from the object I only want the sound to play when I come within about 5 yards of Dagaltar, not all the time. Any Help Pleeeeeeaaaaasseeeee!!!!!!!!!!!!!!!!!!!!!!!!

Link to comment
Share on other sites

Put this script together but the sound still dosent stop even when i move 5 units away from DagAltar. Some heellllppp please!!!!!!!!!!!

Scriptname DagWhisperScript extends ObjectReference  
  
Sound Property DGWhisp  Auto  

ObjectReference Property DagAltar  Auto  

Event OnTriggerEnter(ObjectReference akActionRef)
	If(akActionRef == Game.GetPlayer()) && DagAltar.GetDistance(Game.GetPlayer()) > 5
	int instanceID = DGWhisp.play(self)
	If DagAltar.GetDistance(Game.GetPlayer()) < 5
	Sound.StopInstance(instanceID)
EndIf
EndIf
EndEvent
Link to comment
Share on other sites

Yeah already seen that changing the attenuation just makes the sound muffled but it still doesn't stop playing lol. Half of the options on that link (like max and min distance) are no longer available in the Creation Kit. And I have the latest version of CK

Link to comment
Share on other sites

Scriptname DagWhisperScript extends ObjectReference  

Sound Property DGWhisp Auto

int instanceID

Event OnTriggerEnter(ObjectReference akActionRef)
If(akActionRef == Game.GetPlayer())
instanceID = DGWhisp.play(self)
EndIf
EndEvent

Event OnTriggerLeave(ObjectReference akActionRef)
If(akActionRef == Game.GetPlayer())
Sound.StopInstance(instanceID)
EndEvent

You said you already tried something like this, but I don't see why this wouldn't work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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