Teleporting the player?

Post » Mon Jun 18, 2012 4:38 am

So I'm really new to scripting, and I'm still trying to figure out the basics. I know you can teleport the player into a different cell, but is it possible to teleport the player into a different position WITHIN the cell? Without a loading screen (since it's within the cell). Thanks.
User avatar
Queen of Spades
 
Posts: 3383
Joined: Fri Dec 08, 2006 12:06 pm

Post » Mon Jun 18, 2012 4:32 am

http://www.creationkit.com/MoveTo_-_ObjectReference

Try that. The name is a little misleading. It teleports the object instead of "Walking" like you would think.
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am

Post » Mon Jun 18, 2012 8:11 am

So if you wanted to make a two phase "recall" spell, you would have it create an object (Like mage light does to make a sticky light source), then on the second cast maybe make the lefthand version place the recall point, while the righthand version teleports you) then call it like this?

if RecallNode   ; RecallNode is a reference to the object created by the spell earlier. Need to make sure there is one.  (Game.Getplayer() as Actor).MoveTo(RecallNode,0,0,1.0) ; the vertical offset ensures you don't arrive partly in the floor.endif
User avatar
Chenae Butler
 
Posts: 3485
Joined: Sat Feb 17, 2007 3:54 pm

Post » Mon Jun 18, 2012 10:08 am

if RecallNode   ; RecallNode is a reference to the object created by the spell earlier. Need to make sure there is one.  (Game.Getplayer() as Actor).MoveTo(RecallNode,0,0,1.0) ; the vertical offset ensures you don't arrive partly in the floor.endif

Dear lord. PLEASE let me know how the hell you managed to figure out how to place a node at the impact point of a spell!
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Mon Jun 18, 2012 10:08 am

thats super confusing for what the op is asking. Just make object references for the points you want to move. Use a xmarker or just about any kind of marker really and place it to the point you want to teleport too. then do something like this



 Scriptname teleportwithinacell extends ObjectReference   ObjectReference Property teleporttoxmarkeryoucreated Auto ObjectReference player  Event OnActivate(ObjectReference akActionRef)										 player = game.getPlayer()					 player.MoveTo(teleporttoxmarkeryoucreated)endevent

that will let you activate any item you choose and teleport to a marker you put down.
User avatar
Lindsay Dunn
 
Posts: 3247
Joined: Sun Sep 10, 2006 9:34 am

Post » Mon Jun 18, 2012 12:21 am

Dear lord. PLEASE let me know how the hell you managed to figure out how to place a node at the impact point of a spell!

Working on it...So far I've copied the MageLight spell, and I'm trying to figure out how to get a reference to the projectile for use in a script. So far I'm having trouble just finding out where the projectiles are stored...they only come up if I click "all" and filter for "Projectile"
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Mon Jun 18, 2012 9:33 am

Scriptname _TeleportMissileScript extends ObjectReference{Used in the ConjureSelf Spell Mod}import gameimport utilityActivator Property teleportMarker  AutoEffectShader Property fadeInFX  AutoEffectShader Property fadeOutFX  AutoObjectReference playerObjectReference markerRefEvent OnInit()player = game.getPlayer()fadeOutFX.Play(player, 0.4)markerRef = FindClosestReferenceOfTypeFromRef(teleportMarker, player, 8000);Utility.Wait(0.10)Utility.Wait(0.15)fadeInFX.Play(player, 1.5)player.setPosition(X,Y,Z)if game.getPlayer().GetCombatState() == 1  player.SetAngle(player.GetAngleX(), player.GetAngleY(), player.GetAngleZ() - 180)endIfmarkerRef.Delete()endEvent

Simple teleport missle script. it also turns you 180 degree if you are in combat so that if you teleport behind an enemy you will still be facing him.
User avatar
sunny lovett
 
Posts: 3388
Joined: Thu Dec 07, 2006 4:59 am

Post » Mon Jun 18, 2012 6:25 am

I was having problems with a similar thing (I'm mainly just level/house designing and not a scripter). I've tried looking on the wiki and in other scripts but I'm not getting it working. So too keep the discussion together I\ll post my problem here.

I want a dwemerpuzzlecube (I've copied it and renamed it) and when I activate it I want to teleport somewhere AND I want it in my inventory. So if I'd drop anywhere in the world it I could teleport back by picking it up again.

Now.. I can just pick the thing up but nothing happens. I think it's because it's not an activator maybe but I'm not sure.

atm it just has this script:

Scriptname AezealsKeyscript extends ObjectReference
ObjectReference Property FortressKeyAezeal Auto
Auto State AtRest
Event OnActivate (ObjectReference akActionRef)
GoToState("Busy") ;
additem (FortressKeyAezeal, 1, False);
Debug.PlayerMoveToAndWait ("FortressHallwayCentre")




What am I doing wrong?
From reading the wiki I've tried adding a line with "If the RunOnActivateFlag is set to 1, then the OnActivate block of the object (if any) will be run instead of the default activation."

but I can't seem to implement it correctly (if that is even what is needed)

GoToState("AtRest")
EndEvent
EndState
State Busy
Event OnActivate(ObjectReference akActionRef)
debug.trace("I'm busy, so not doing anything.")
EndEvent
EndState
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am

Post » Sun Jun 17, 2012 11:49 pm

thats super confusing for what the op is asking. Just make object references for the points you want to move. Use a xmarker or just about any kind of marker really and place it to the point you want to teleport too. then do something like this



Scriptname teleportwithinacell extends ObjectReferenceObjectReference Property teleporttoxmarkeryoucreated AutoObjectReference playerEvent OnActivate(ObjectReference akActionRef)										 player = game.getPlayer()					 player.MoveTo(teleporttoxmarkeryoucreated)endevent

that will let you activate any item you choose and teleport to a marker you put down.

How do you do this for a quest fragment???
User avatar
Nice one
 
Posts: 3473
Joined: Thu Jun 21, 2007 5:30 am

Post » Mon Jun 18, 2012 1:31 pm

Simple teleport missle script. it also turns you 180 degree if you are in combat so that if you teleport behind an enemy you will still be facing him.

So what is your spell effect? Place object at target (like summon atronarch) and summon a marker?
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Sun Jun 17, 2012 9:51 pm

Nothing simple about that script...firstly, "FindClosestReferenceOfTypeFromRef" is not a standard function, and you have neglected to provide the definition. (Edit: My bad...I forgot to include utility...D'OH!)

What I really need to know is, http://s591.photobucket.com/albums/ss358/RedwoodElf/?action=view¤t=CKTeleport01.jpg

The script shown is in the light called "MagicTeleportTeleport Spell", which is the light used for the "TeleportSpellProjectile" (An object, presumably) which is fired by the "TeleportNodeFFAimed" effect, which is part of the "TeleportLeft" spell. (The lefthand and righthand versions are going to be different...Left will fire the teleport Node, and Right will teleport the user to the node.)

Now I obviously (as you can see) can't just reference the TeleportSpellProjectile object type directly from the script, or even the TeleportNodeFFAimed effect. There must be a way to do this, but I haven't figured it out yet.
User avatar
Rhiannon Jones
 
Posts: 3423
Joined: Thu Sep 21, 2006 3:18 pm

Post » Mon Jun 18, 2012 5:01 am

I already have this working. Just use a moveto on an xmarker heading to the player. There is your mark spell. Then opposite for recall. :P
User avatar
Alexis Estrada
 
Posts: 3507
Joined: Tue Aug 29, 2006 6:22 pm

Post » Mon Jun 18, 2012 1:24 pm

I already have this working. Just use a moveto on an xmarker heading to the player. There is your mark spell. Then opposite for recall. :tongue:

Well the one I want to make is one that allows you to fire a marker off into the distance, then teleport to where it lands.
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm

Post » Mon Jun 18, 2012 6:06 am

I already have this working. Just use a moveto on an xmarker heading to the player. There is your mark spell. Then opposite for recall. :tongue:
Yea that's what I created some days ago http://skyrim.nexusmods.com/downloads/file.php?id=8088 ;)

The real problem we face is create something(like a marker) at the impact location for tartgeted/combat (teleport)spells
And to register hit events on any Object (currently we only seem to be able if it hit an actor)

BTW FindClosestReferenceOfTypeFromRef is a standard function http://www.creationkit.com/FindClosestReferenceOfTypeFromRef_-_Game
But what I don't get is how he places his marker missile based
User avatar
Neil
 
Posts: 3357
Joined: Sat Jul 14, 2007 5:08 am

Post » Mon Jun 18, 2012 10:07 am

Yea that's what I created some days ago http://skyrim.nexusmods.com/downloads/file.php?id=8088 :wink:

The real problem we face is create something(like a marker) at the impact location for tartgeted/combat (teleport)spells
And to register hit events on any Object (currently we only seem to be able if it hit an actor)

BTW FindClosestReferenceOfTypeFromRef is a standard function http://www.creationkit.com/FindClosestReferenceOfTypeFromRef_-_Game
But what I don't get is how he places his marker missile based

Like I said...working on it...last step is figuring out how to reference (and search for with that FindClosestReferenceOfTypeFromRef) my created object type "TeleportSpellProjectile" and place the reference in my script
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Mon Jun 18, 2012 1:27 pm

I'm not sure if I understand correctly what your problem is, but if you want to access anything from the "game world" you have to create a property of the correct type and then use the ck property button (next to where the script is added) to provide the correct references to the script
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Mon Jun 18, 2012 3:13 am

I was having problems with a similar thing (I'm mainly just level/house designing and not a scripter). I've tried looking on the wiki and in other scripts but I'm not getting it working. So too keep the discussion together I\ll post my problem here.

I want a dwemerpuzzlecube (I've copied it and renamed it) and when I activate it I want to teleport somewhere AND I want it in my inventory. So if I'd drop anywhere in the world it I could teleport back by picking it up again.

Now.. I can just pick the thing up but nothing happens. I think it's because it's not an activator maybe but I'm not sure.

atm it just has this script:

Scriptname AezealsKeyscript extends ObjectReference
ObjectReference Property FortressKeyAezeal Auto
Auto State AtRest
Event OnActivate (ObjectReference akActionRef)
GoToState("Busy") ;
additem (FortressKeyAezeal, 1, False);
Debug.PlayerMoveToAndWait ("FortressHallwayCentre")




What am I doing wrong?
From reading the wiki I've tried adding a line with "If the RunOnActivateFlag is set to 1, then the OnActivate block of the object (if any) will be run instead of the default activation."

but I can't seem to implement it correctly (if that is even what is needed)

GoToState("AtRest")
EndEvent
EndState
State Busy
Event OnActivate(ObjectReference akActionRef)
debug.trace("I'm busy, so not doing anything.")
EndEvent
EndState


Anyone got advice on this one?
User avatar
Miranda Taylor
 
Posts: 3406
Joined: Sat Feb 24, 2007 3:39 pm

Post » Mon Jun 18, 2012 4:30 am

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)if akSourceContainer == Game.GetPlayer()  akSourceContainer.MoveTo(MyMarker)  endIfendEventObjectReference Property MyMarker auto


There.
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm


Return to V - Skyrim