d4em Posted April 11 Share Posted April 11 (edited) I do this: extends ObjectReference Sound Property TriggerSound Auto Event OnOpen(ObjectReference akRef) TriggerSound.play(self) endEvent this works then I do this: Event OnLockStateChanged() TriggerSound.play(self) endEvent this does not work So I replace self with an object I just created Event OnLockStateChanged() MyHazard = placeatme(TriggerHazard) TriggerSound.play(MyHazard) Still no dice. I know the event is firing because I get irradiated How to play sounds? Edit: Event OnLockStateChanged() if !(DoOnce) MyHazard = placeatme(TriggerHazard) int soundId = TriggerSound.play(MyHazard) starttimer(5, 10) DoOnce = True if (soundId == 0) Debug.MessageBox("ID is zero") else Debug.MessageBox("ID is not zero") endIf endIf endEvent does not create any messageboxes (but it does create the hazard) Edited April 11 by d4em Link to comment Share on other sites More sharing options...
d4em Posted April 11 Author Share Posted April 11 Alternatively: how to fire script when a door starts opening instead of when the opening ends? Event OnOpen() fires when the door finishes opening, I need an event that fires at the start. OnLockStateChanged works, but I'm going to have to open the door manually so it still works with that "lockpick no auto activate" mod Link to comment Share on other sites More sharing options...
DieFeM Posted April 11 Share Posted April 11 If the lock state changes because you're lockpicking it, maybe the lockpicking interface counts as being in "menu mode", and it is possible that the sound descriptor you're trying to play uses a sound category which pauses it during menu mode. 1 1 Link to comment Share on other sites More sharing options...
d4em Posted April 11 Author Share Posted April 11 Brilliant! Changed the sound category, it works now Link to comment Share on other sites More sharing options...
DieFeM Posted April 11 Share Posted April 11 Glad it helped Link to comment Share on other sites More sharing options...
Recommended Posts