Jump to content

Recommended Posts

Posted

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?????
Posted
  On 6/16/2013 at 6:36 PM, FiftyTifty said:

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!!!!!!!!!!!!!!!!!!!!!!!!

Posted

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
Posted

Event will fire when player enters the trigger. Event will not fire when player moves away. Make the trigger box as large as you need it. Use OnTriggerLeave to stop the sound.

Posted

Thanks man tried this but the sound still would not stop playing. Instead I just set the sound to play for 4 seconds using the utility wait script command

Posted

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

Posted

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.

  • Recently Browsing   0 members

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