Teleport spell?

Post » Thu Jun 21, 2012 10:50 am

I usually don't work with papyrus, but i want to create a spell, which takes my player to a hideout and back to where I was, when I cast it again.
I know just a little about scripting, so please help and explain every step.
User avatar
phillip crookes
 
Posts: 3420
Joined: Wed Jun 27, 2007 1:39 pm

Post » Thu Jun 21, 2012 6:16 am

fast travel.. don't be so lazy.
User avatar
Sebrina Johnstone
 
Posts: 3456
Joined: Sat Jun 24, 2006 12:58 pm

Post » Thu Jun 21, 2012 2:43 am

But I want, my hideout to be only reachable with the spell
User avatar
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Thu Jun 21, 2012 8:22 am

Check out Levelers Tower on the Nexus. It has the 'Home' spell which does what you want. Plus a bit more.
http://skyrim.nexusmods.com/downloads/file.php?id=14152
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Thu Jun 21, 2012 1:50 pm

thank you but i don't want all extra features, if someone could just tell me how to do it
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Thu Jun 21, 2012 2:27 am

thank you but i don't want all extra features, if someone could just tell me how to do it
He means look at how its done in the mod. Derp.
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Thu Jun 21, 2012 8:54 am

This would be pretty simple to set up I imaging. You could make a spell like this:

Scriptname TeleportScript extends activemagiceffectActivator Property COCmarker autoEvent OnEffectStart(Actor Target, Actor Caster)   Caster.MoveTo(COCMarker)endEvent
User avatar
Chenae Butler
 
Posts: 3485
Joined: Sat Feb 17, 2007 3:54 pm

Post » Thu Jun 21, 2012 6:37 am

This would be pretty simple to set up I imaging. You could make a spell like this:

Scriptname TeleportScript extends activemagiceffectActivator Property COCmarker autoEvent OnEffectStart(Actor Target, Actor Caster)   Caster.MoveTo(COCMarker)endEvent
Add on to that some simple 'if' statements to figure out whether or not the player is already in your hideout cell, then either move them to it, or back to a marker placed where they teleported in from.
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Thu Jun 21, 2012 5:25 am

The two responses above are both good but this thread made me think of another thread where RandomNoob gave http://www.gamesas.com/topic/1370508-anyone-know-how-to-move-objects-from-non-parented-cells/page__view__findpost__p__20714107 of a Mark/Recall script--which is what you're asking for. :)
User avatar
Vicki Gunn
 
Posts: 3397
Joined: Thu Nov 23, 2006 9:59 am

Post » Thu Jun 21, 2012 11:44 am

The two responses above are both good but this thread made me think of another thread where RandomNoob gave http://www.gamesas.com/topic/1370508-anyone-know-how-to-move-objects-from-non-parented-cells/page__view__findpost__p__20714107 of a Mark/Recall script--which is what you're asking for. :smile:

I'm going to try with this but, what do i have to put in the properities? Like I said I don't really work with papyrus.
User avatar
Crystal Clear
 
Posts: 3552
Joined: Wed Aug 09, 2006 4:42 am

Post » Thu Jun 21, 2012 12:38 am

Using placeatme() is bad since it has the same problems as in Oblivion. I would just use this script:

Scriptname  extends ActiveMagicEffectimport gameObjectReference Property Marker auto   ; the marker inside your cellFloat xPFloat yPFloat zPInt checkEvent OnEffectStart(Actor Target, Actor Caster)if(check == 0)  if(getplayer().getparentcell() != marker.getparentcell())	xP = getplayer().X	yP = getplayer().Y	zP = getplayer().Z	check = 1	getplayer().moveto(marker)  else	  debug.notification("No need to use it here!")  endifelse	getplayer().setposition(xP, yP, zP)	check = 0endifEndEvent
User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Post » Thu Jun 21, 2012 1:47 am

What problems are you talking about specifically? I've been using placeatme a lot and i have been having some problems...
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm

Post » Thu Jun 21, 2012 3:26 pm

@Kahmul

Papyrus comes with a http://www.creationkit.com/Delete_-_ObjectReference function. However, I am not sure whether or not this resolves the problems with http://www.creationkit.com/PlaceAtMe_-_ObjectReference similar to how OBSE's http://cs.elderscrolls.com/index.php/DeleteReference function since I haven't tried spawning a couple thousand objects yet.

Also, there are some problems with the script you posted. Like in Oblivion, each time a spell is cast, it creates a new instance of the magic effect. Therefore, you cannot save the X, Y, Z coordinates that way. Also, each interior is its own worldspace. Each worldspace has its own coordinates. For example, the coordinates (0, 0, 0) in WhiterunBreezehome are not the same as the coordinates (0, 0, 0) in Tamriel.


@Dakok

The example you were linked to doesn't exactly fit your request, because you want to have a permanent location to teleport to. The example is when you want to have two different teleport locations that move along with you.

You should use a script like this:

Scriptname Example extends ActiveMagicEffectObjectReference Property Marker01 Auto{Some object reference in your custom cell.}ObjectReference Property Marker02 Auto{Some object reference such as an XmarkerHeading you'll create just for this spell.}Activator Property Portal Auto{The SummonTargetFXActivator if you want to have a portal pop up.}Event OnEffectStart(Actor akTarget, Actor akCaster)	ObjectReference PortalRef = akTarget.PlaceAtMe(Portal)	Utility.Wait(2)	if (akTarget.GetParentCell() == Marker01.GetParentCell())		akTarget.MoveTo(Marker02)	else		Marker02.MoveTo(akTarget)		akTarget.MoveTo(Marker01)	endif	PortalRef.MoveTo(akTarget)	Utility.Wait(3.5)	PortalRef.Disable()	PortalRef.Delete()EndEvent

If you don't want to have a portal show up, delete any lines with the word portal or wait. You can read http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Introduction_to_Properties to learn how to set properties, specifically section 5.2.
User avatar
Dustin Brown
 
Posts: 3307
Joined: Sun Sep 30, 2007 6:55 am

Post » Thu Jun 21, 2012 5:21 am

I tried both and Kahmul's version didn't teleported me back, it always showed "No need to use it here", and RandomNoobs version worked just like I wanted. Thank you all
User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am

Post » Thu Jun 21, 2012 8:06 am

Is there a way to make my character stay where he is while he's being teleported? I'm using the Portal Randomnoob proposed and just before my character is teleported I can move him around but the portal doesn't moves with him. So what can I write for my player not to move or for the portal to move with my character?
User avatar
Ells
 
Posts: 3430
Joined: Thu Aug 10, 2006 9:03 pm

Post » Thu Jun 21, 2012 3:52 am

You could disableplayercontrols.
User avatar
Jon O
 
Posts: 3270
Joined: Wed Nov 28, 2007 9:48 pm

Post » Thu Jun 21, 2012 12:14 pm

Thank you, now it does exactly what I wanted.
User avatar
Iain Lamb
 
Posts: 3453
Joined: Sat May 19, 2007 4:47 am


Return to V - Skyrim