morrowind1979 Posted June 16, 2013 Posted June 16, 2013 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 EndEventC:\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?????
FiftyTifty Posted June 16, 2013 Posted June 16, 2013 (edited) You haven't added the DagAltar property. Edited June 16, 2013 by FiftyTifty
morrowind1979 Posted June 16, 2013 Author Posted June 16, 2013 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!!!!!!!!!!!!!!!!!!!!!!!!
morrowind1979 Posted June 16, 2013 Author Posted June 16, 2013 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
Ghaunadaur Posted June 16, 2013 Posted June 16, 2013 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.
morrowind1979 Posted June 19, 2013 Author Posted June 19, 2013 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
ffe3214 Posted June 19, 2013 Posted June 19, 2013 (edited) doesn't sound like a script problem to me...which output model does the sound use? in the output model you can define a specific distance to the source at which the sound can be heard, as well as attenuation...look here: http://www.creationkit.com/Sound_Output_Modelmaybe this helps... Edited June 19, 2013 by ffe3214
morrowind1979 Posted June 20, 2013 Author Posted June 20, 2013 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
ffe3214 Posted June 20, 2013 Posted June 20, 2013 i didn't get the point that the sound should only play once.but the options in the ck work fine...
Maverick827 Posted June 20, 2013 Posted June 20, 2013 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.
Recommended Posts