Jump to content

[LE] Teleport Scripting Help


Recommended Posts

I've made a teleport spell that I'm finally comfortable with, and I have made a script that teleports the player like a doorway, but I really want to know: How do I make it so when the activator is interacted with, it will fire a spell on the player, then teleport them?

Edited by Guest
Link to comment
Share on other sites

You need to put on your script (if it is attached to the activator), that uppon activate.

- First will fire the spell from casting point the activator.

- At the Actor Ref, target the spell will be fire uppon.

- Then do the rest of the actions ( you need a few seconds between them to actualy see the spell ).
Link to comment
Share on other sites

 

You need to put on your script (if it is attached to the activator), that uppon activate.
- First will fire the spell from casting point the activator.
- At the Actor Ref, target the spell will be fire uppon.
- Then do the rest of the actions ( you need a few seconds between them to actualy see the spell ).

 

 

How exactly do you do that? Can you please list an example? I'm still relatively new to scripting.

Link to comment
Share on other sites

This is a rough example, it would be more helpful if you would post your script.
I didn't compile it but it should be working.

 
Scriptname aXMDdwemerButtonTeleportScript01 extends ObjectReference

Spell Property SpelltoCast Auto
{spell to cast}
 
objectReference property castPoint01 auto
{Source - From where the spell is casted}
 
Actor Property PlayerREF Auto
{Target to cast the spell - Actor self)
 
ObjectReference Property TeleportMarker auto
 
 
GlobalVariable Property LexiconPlaced auto
 
 
 
Event OnActivate(ObjectReference akActionRef)
                 if LexiconPlaced.GetValue() == 1
                    SpelltoCast.Cast(castPoint01, PlayerREF)
                    Utility.wait(3.0)
                    Self.InterruptCast()
                    Game.GetPlayer().MoveTo(TeleportMarker)
            else
                   Debug.Notification("Nothing happens")
           endif
EndEvent

 

 

 

PS : The self.interruptCast() is there just in case your spell is a constant casting spell like Flames.

The Utility.wait(3.0) can be set to whatever time you need it to be. (it's in seconds).

Edited by maxarturo
Link to comment
Share on other sites

Here is the script I created and have on my teleporter at the moment.
The second is the script I have on my teleport spell which teleports the player back to the house, which I created with the help of Darkfox127's Teleport Spell Tutorial. I'm not sure how to modify the lower one to make it do what I want it to do. Any help would be much appreciated.
Scriptname AoATeleportActivatorScript extends ObjectReference
{Use this on Activators for Teleportation}
ObjectReference property Loc01 auto
Event OnActivate(ObjectReference akActivator)
akActivator.MoveTo(Loc01)
EndEvent
-
-
-
-
Scriptname AoATeleportScript extends activemagiceffect
ObjectReference Property Loc01
Function OnEffectStart(Actor akTarget, Actor akCastor)
Utility.Wait(1.5)
Game.FadeOutGame(False, True, 2.0, 1.0)
Game.GetPlayer().MoveTo(Loc01)
Game.EnableFastTravel()
Game.FastTravel(Loc01)
EndFunction

 

Link to comment
Share on other sites

Just for clarification, in your first post you wrote that you want the "Activator" (Lever or Button...) to cast the spell and then teleport.

" How do I make it so when the activator is interacted with, it will fire a spell on the player, then teleport them? "


From what i understand you want some kind of visual FX (with casting spell) between the time of activation (Lever interaction) and the teleportation.


* The second spell you created is for self casting - meaning you cast the spell on yourself.


* Help me understand what are you trying to do.


* I'll answer in a few hours reight now i'm going to sleep... too tired.

Link to comment
Share on other sites

So, you used this script to make - create a spell. ( Let's call the spell "GodzillaTeleportSpell" ).




Scriptname AoATeleportScript extends activemagiceffect

ObjectReference Property Loc01

Function OnEffectStart(Actor akTarget, Actor akCastor)
Utility.Wait(1.5)
Game.FadeOutGame(False, True, 2.0, 1.0)
Game.GetPlayer().MoveTo(Loc01)
Game.EnableFastTravel()
Game.FastTravel(Loc01)
EndFunction



And you want this spell "GodzillaTeleportSpell" to be casted from an ACTIVATOR, if so :




Spell Property TeleportSpell01 Auto
{Select your Spell}

objectReference property castPoint01 auto
{Source where to cast the spell from}

Actor Property PlayerREF Auto
{Select Target - Player}


Event onActivate(ObjectReference akActionRef)
TeleportSpell01.Cast(castPoint01, PlayerREF)
ENDEVENT




Place this Script in your ACTIVATOR and fill in the properties :


- TeleportSpell01 = Find and select you spell "GodzillaTeleportSpell".


- PlayerREF = Select "PlayerRef"


- castPoint01 = Select the ACTIVATOR


* A more appropriate castPoint would be, instead of selecting the Activator, place an xMarker (name it) and select the xMarker as a casting source. The reason is that by selecting the xMarker you can control the exact point from where the Spell is casted by moving the xMarker. If you select the Activator the spell will be casted from the center of its geometrical shape, so if you have let's say a "Lexicon stand" the spell won't get fire from the top (from where you actually trigger the Lexicon Stand) but from its center - middle.


* To see your spell been casted to the player the spell needs to be a projectile spell.


And you are done !.

Edited by maxarturo
Link to comment
Share on other sites

  • Recently Browsing   0 members

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