Jump to content

Need Help Please!


Osheanity

Recommended Posts

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

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 by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...