Osheanity Posted July 31, 2012 Share Posted July 31, 2012 I just finished a script that brings up a message box when the object is activated, you have two choices either get teleported or just leave it alone. But when the player gets teleported i want to add an effect to it anyone know how to do this?My Script looks like this: [i]Scriptname AAATeleportScript extends ObjectReference [/i] [i] [/i] [i] [/i] [i] [/i] [i]ObjectReference Property TeleportMarker Auto[/i] [i]Message Property YourMessageMSG Auto[/i] [i] [/i] [i] [/i] [i]Event OnActivate (ObjectReference AKActionRef)[/i] [i] int iButton = YourMessageMSG . Show ()[/i] [i]If iButton == 0[/i] [i]Game.GetPlayer().MoveTo(TeleportMarker) [/i] [i]ElseIf iButton == 1[/i] [i]Debug.Notification ("You feel the power of the stone fade as you remove your hand")[/i] [i] [/i] [i]EndIf[/i] [i] EndEvent[/i] Thanks for you help :) Link to comment Share on other sites More sharing options...
steve40 Posted August 1, 2012 Share Posted August 1, 2012 (edited) Depends. What sort of effect do you want to add. IMOD, explosion, sound, camera shake, controller vibration, shader, particles, etc etc. Scriptname AAATeleportScript extends ObjectReference ObjectReference Property TeleportMarker Auto Message Property YourMessageMSG Auto Event OnActivate (ObjectReference AKActionRef) int iButton = YourMessageMSG.Show() If iButton == 0 Game.GetPlayer().MoveTo(TeleportMarker) ElseIf iButton == 1 Debug.Notification("You feel the power of the stone fade as you remove your hand") EndIf EndEvent Edit1: playing a sound: Scriptname AAATeleportScript extends ObjectReference ObjectReference Property TeleportMarker Auto Message Property YourMessageMSG Auto Sound Property SoundEffect auto Event OnActivate (ObjectReference AKActionRef) int instanceID int iButton = YourMessageMSG.Show() If iButton == 0 instanceID = SoundEffect.play(self) Sound.SetInstanceVolume(instanceID, 1.0) ; plays the sound at full volume Game.GetPlayer().MoveTo(TeleportMarker) ElseIf iButton == 1 Debug.Notification("You feel the power of the stone fade as you remove your hand") EndIf EndEvent Edit2: play a sound and an effect shader on the player: Scriptname AAATeleportScript extends ObjectReference ObjectReference Property TeleportMarker Auto Message Property YourMessageMSG Auto Sound Property SoundEffect Auto EffectShader Property Shader Auto ; the shader to apply to the player when teleported Event OnActivate (ObjectReference AKActionRef) int instanceID int iButton = YourMessageMSG.Show() Actor player = Game.GetPlayer() If iButton == 0 instanceID = SoundEffect.play(self) Sound.SetInstanceVolume(instanceID, 1.0) ; plays the sound at full volume Shader.Play(player, 2) player.MoveTo(TeleportMarker) ElseIf iButton == 1 Debug.Notification("You feel the power of the stone fade as you remove your hand") EndIf EndEvent Edit3: all of the above plus an image space modifier: Scriptname AAATeleportScript extends ObjectReference ObjectReference Property TeleportMarker Auto Message Property YourMessageMSG Auto Sound Property SoundEffect Auto EffectShader Property Shader Auto ; the shader to apply to the player is teleported ImageSpaceModifier property myIMOD auto ; image space modifier effect to play. Must be a non-looping effect. Float Property fImodStrength = 1.0 auto ; IMod Strength from 0.0 to 1.0 Event OnActivate (ObjectReference AKActionRef) int instanceID int iButton = YourMessageMSG.Show() Actor player = Game.GetPlayer() If iButton == 0 instanceID = SoundEffect.play(self) Sound.SetInstanceVolume(instanceID, 1.0) ; plays the sound at full volume myIMOD.Apply(fImodStrength) ; apply isMod at full strength Shader.Play(player, 2) player.MoveTo(TeleportMarker) ElseIf iButton == 1 Debug.Notification("You feel the power of the stone fade as you remove your hand") EndIf EndEvent Edited August 1, 2012 by steve40 Link to comment Share on other sites More sharing options...
Osheanity Posted August 4, 2012 Author Share Posted August 4, 2012 Thanks this is great! I'll give you lots of credit when I release it, again thanks so much! and sorry for the late reply was camping with some friends :) Link to comment Share on other sites More sharing options...
Recommended Posts