Swat715 Posted March 17, 2019 Author Share Posted March 17, 2019 So I booted up the game and activated the power switch and nothing happened. Either I put the script in the power switch but it was suppose to go into the teleport activator or I might have messed up the properties? For the activatorRef is that suppose to be the power switch or teleporter? Link to comment Share on other sites More sharing options...
LoneRaptor Posted March 17, 2019 Share Posted March 17, 2019 The script sould be on the power switch. Make sure you have all of the properties filled. ActivatorRef is the teleporter activator, EmitterRef is the objectReference of the static model of the emitter, OBJTeleporterJammerLP is the sound effect (can be auto filled) Link to comment Share on other sites More sharing options...
Swat715 Posted March 17, 2019 Author Share Posted March 17, 2019 Okay so here's what I've got. ActivatorRef 00CustomSwat715_Activator (Teleporter)EmiterRef 00Custom_Swat715_Emitter (Emitter)OBJTeleporterJammerLP OBJTeleporterJammerLP (Autofill) And this script is on the power Switch activator and the teleport script is on the teleport activator. the only thing I can think of is maybe sense I'm using a custom id reference for them? Link to comment Share on other sites More sharing options...
LoneRaptor Posted March 17, 2019 Share Posted March 17, 2019 (edited) Turns out it was my mistake, you copied the script before i noticed and changed it. replace ActivatorRef.Disable() with ActivatorRef.Enable() and ActivatorRef.Enable() in the section below elseIf with ActivatorRef.Disable(). see post #33 for reference Edited March 17, 2019 by LoneRaptor Link to comment Share on other sites More sharing options...
Swat715 Posted March 17, 2019 Author Share Posted March 17, 2019 Just wanna double check I changed the right one Event OnActivate(ObjectReference akActionRef) If ActivatorRef.IsEnabled() ActivatorRef.Disable() EmitterRef.PlayGamebryoAnimation("stage3loop", True) SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef) ElseIf !ActivatorRef.IsDisabled() ActivatorRef.Enable() If SoundEffectIncetanceID EmitterRef.PlayGamebryoAnimation("stage1", True) Sound.StopInstance(SoundEffectIncetanceID) EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
LoneRaptor Posted March 17, 2019 Share Posted March 17, 2019 I meant the one inside the if statement like this:Â Event OnActivate(ObjectReference akActionRef) If ActivatorRef.IsDisabled();if the teleporter activator is disabled enable it ActivatorRef.Enable();disables the teleporter activator EmitterRef.PlayGamebryoAnimation("stage3loop", True);starts animation stage3loop SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);starts the sound effects ElseIf !ActivatorRef.IsDisabled();if the teleporter activator is enabled disable it ActivatorRef.Disable();enables the teleporter activator If SoundEffectIncetanceID ; checks if there is sound playing EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop ;SoundEffectIncetanceID = None ; clears the inctance property so the script knows there is no sound playing EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
Swat715 Posted March 17, 2019 Author Share Posted March 17, 2019 You are amazing! it works! i cant thank you enough, seriously! is how hard would it be to add little effects here in there like sparks and smoke just minor stuff like that later? just to give the area the feeling like theres power. (if that makes sense lol) and 2 minor problems with the teleporting is when you load up the game it makes the same sound as when you teleport. and when you teleport it hurts you. other than that its golden. Link to comment Share on other sites More sharing options...
LoneRaptor Posted March 17, 2019 Share Posted March 17, 2019 (edited) For the sparks you can place some SplineSparks02 (a movableStatic) there might be others as well look around a bit in the CK, and set them to initially disable and link them to an enable parent and enable/disable that via the script on the power switch. there should also be some accompanying sound effects in the ck as well. I don't remember if the sound gets stopped when you disable it but i think it does so you should be able to add them to the same enable parent as the visual effects.There are also plenty of smoke effects (movable static category) in there as well, these can be enabled/disable the same way. Edited March 17, 2019 by LoneRaptor Link to comment Share on other sites More sharing options...
Swat715 Posted March 17, 2019 Author Share Posted March 17, 2019 (edited) So i went to the sparks and go to enable parents tab and selected the power switch activator. it allowed it to activate but not deactivate. so when i go to add it to the script do i add it through properties? Edited March 17, 2019 by Swat715 Link to comment Share on other sites More sharing options...
LoneRaptor Posted March 17, 2019 Share Posted March 17, 2019 (edited) There is an EnableMarker in the statc category that you can use. Place one (these are invisible in game) and use that as the enable parent.Then in the script add a property: (ObjectReference Property EnableMaker Auto) fill it with the ref for the enableMarker and change the script to this: Event OnActivate(ObjectReference akActionRef) If ActivatorRef.IsDisabled();if the teleporter activator is disabled enable it ActivatorRef.Enable();disables the teleporter activator EnableMaker.Enable() EmitterRef.PlayGamebryoAnimation("stage3loop", True);starts animation stage3loop SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);starts the sound effects ElseIf !ActivatorRef.IsDisabled();if the teleporter activator is enabled disable it ActivatorRef.Disable();enables the teleporter activator EnableMaker.Disable() If SoundEffectIncetanceID ; checks if there is sound playing EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop ;SoundEffectIncetanceID = None ; clears the inctance property so the script knows there is no sound playing EndIf EndIf EndEvent Edited March 17, 2019 by LoneRaptor Link to comment Share on other sites More sharing options...
Recommended Posts