antstubell Posted May 31, 2019 Share Posted May 31, 2019 Hi all.What I want to achieve is a OnTriggerEnter script that will cause a quick electrical effect. I already have the sound fx and I'm guessing PlaceAtMe will be involved, I'm way out of touch with scripting so help appreciated. Scene is: Player walks down a passage, there is a closed door. When player nears the door an electircal shock effect can be heard in the room behind the door, also the 'shocking' effect can be seen through the crack under the door. Meaning the effect will take place in the room behind the door and the player will know this as the door will be iiluminated (I know fx can be seen behind doors as I've dropped a torch in a room, closed the door and the illumination is visible through the door). Player sees and hears the very short 'shock', opens the door and... nothing - just a smoking chair - this part I've alreay done. Event will occur once - for now - maybe go back to this room (in history, kind of my mod's theme) to witness what happened but that will be much later in the mod.Hope I have explained myself clearly, thanks for any help. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 1, 2019 Share Posted June 1, 2019 I think you can place a disabled xMarker where you want the FX and such to play. Use the OnInit event on the xMarker's script to trigger all the stuff to run. Then when the player enters the trigger volume box use the OnTriggerEnter event on that script to enable the xMarker. There may be other possible methods. Feel free to see if anyone else has some ideas. Link to comment Share on other sites More sharing options...
antstubell Posted June 1, 2019 Author Share Posted June 1, 2019 I'm getting there. Just need a reminder on how to place sound at the xmarker, not emit from player. import soundActor Property PlayerREF Autoexplosion property MyFX autoObjectReference property xMarkerFX autoSound Property MySoundFX Autoint instanceID ;used to store sound refauto state waitingEvent OnTriggerEnter(ObjectReference akActionRef)if akActionRef == PlayerRefxMarkerFX.placeAtMe(MyFX)instanceID = MySoundFX. Play(PlayerRef)Utility.wait(0.5)GoToState("Done")else; Do nothingendifENDEVENTENDSTATEEVENT onTriggerLeave(ObjectReference akActionRef)if akActionRef == PlayerRef; Do nothingendifENDEVENT Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 1, 2019 Share Posted June 1, 2019 According to the Play documentation you need an object that has 3D loaded to play sound. Thus you might need to use the ObjectReference of your pre-placed chair (or other object in the room). Link to comment Share on other sites More sharing options...
antstubell Posted June 1, 2019 Author Share Posted June 1, 2019 Ok, I get using a 3D object to play the sound from I can add an Object Reference Property but how do I write that line of code? Please bear with me as I am getting back into moddind. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 2, 2019 Share Posted June 2, 2019 Ok, I get using a 3D object to play the sound from I can add an Object Reference Property but how do I write that line of code? Please bear with me as I am getting back into moddind. instanceID = MySoundFX. Play(SomeObjectRef) Link to comment Share on other sites More sharing options...
Recommended Posts