Teleport problem

Post » Tue Jun 19, 2012 1:39 am

I'm trying to make a spell to teleport you back to Breezehome and then back to location where you teleported from. I used this script.

Scriptname zTeleportBothWays extends activemagiceffect {A spell that teleports you back and forth.}ObjectReference Property setlocation AutoObjectReference Property Leavemarkerbehind Autoevent OnEffectStart ( Actor Target, Actor Caster )Leavemarkerbehind.MoveTo (Caster)Caster.Moveto (setlocation)endevent

I've put down and Xmarker and linked the setlocation to it, but it doesn't seem to work as intended. The spell does teleport me back to Breezehome, but when I use it again, it doesn't teleport me back to where I was, it teleports me to Breezehome again.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Mon Jun 18, 2012 10:32 pm

make a seperate spell for recalling, spells seem to only serve a single purpose at a time... btw awesome mod idea ive wanted mark and recall back from morrowind for a while now
User avatar
Janine Rose
 
Posts: 3428
Joined: Wed Feb 14, 2007 6:59 pm

Post » Tue Jun 19, 2012 6:54 am

Are you sure? I thought someone used this and it worked, but not sure.
User avatar
Add Meeh
 
Posts: 3326
Joined: Sat Jan 06, 2007 8:09 am

Post » Mon Jun 18, 2012 9:27 pm

I add this script to my 'Magic Effect' that I copied from a conjuration spell to get its spell effects. The properties are attached to the script as follows:

'HomeTarget' you link to the Xmarker in Breezehome.
'TeleTarget' is an Xmarker that you place in Breezehome that is moved to your location before you teleport. That is so you can go back from wence you came.
'QuestionMSG' is a message box object that allows you to select if you want to go home or return. It contains two button indexes. Link to your message object.

Scriptname LevelersSpellHomeScript extends activemagiceffect{Teleport Home Spell Script}ObjectReference property HomeTarget autoObjectReference property TeleTarget autoMessage Property QuestionMSG  AutoActor casterObjectReference casterRefint ButtonEvent OnEffectStart(Actor akTarget, Actor akCaster)caster = akCastercasterRef = (caster as ObjectReference)TeleTarget.MoveTo(caster)Utility.Wait(2.0)Button = QuestionMSG.Show()Utility.Wait(0.5)if Button == 0  casterRef.MoveTo(HomeTarget)elseif Button == 1  casterRef.MoveTo(TeleTarget)endifendEVENT
User avatar
Kara Payne
 
Posts: 3415
Joined: Thu Oct 26, 2006 12:47 am

Post » Tue Jun 19, 2012 2:42 am

I add this script to my 'Magic Effect' that I copied from a conjuration spell to get its spell effects. The properties are attached to the script as follows:

'HomeTarget' you link to the Xmarker in Breezehome.
'TeleTarget' is an Xmarker that you place in Breezehome that is moved to your location before you teleport. That is so you can go back from wence you came.
'QuestionMSG' is a message box object that allows you to select if you want to go home or return. It contains two button indexes. Link to your message object.

Scriptname LevelersSpellHomeScript extends activemagiceffect{Teleport Home Spell Script}ObjectReference property HomeTarget autoObjectReference property TeleTarget autoMessage Property QuestionMSG  AutoActor casterObjectReference casterRefint ButtonEvent OnEffectStart(Actor akTarget, Actor akCaster)caster = akCastercasterRef = (caster as ObjectReference)TeleTarget.MoveTo(caster)Utility.Wait(2.0)Button = QuestionMSG.Show()Utility.Wait(0.5)if Button == 0  casterRef.MoveTo(HomeTarget)elseif Button == 1  casterRef.MoveTo(TeleTarget)endifendEVENT

Thanks a lot man, I'll try that out in a bit.
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Tue Jun 19, 2012 7:35 am

If you wanted to do it without a button you could create a global and just flip the value everytine you teleport. Ignoring syntax errors/omissions (I'm on my phone), it would look something like this:

Global Property breezeGlobak AutoObjectReference Property marker1 AutoObjectReference Property marker2 AutoEvent OnEffectStart(Actor target, Actor caster)if breezeGlobal == 0        caster.moveto(marker1)       breezeGlobal = 1else        caster.moveto(marker2)       breezeGlobal = 0endifendevent
User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Mon Jun 18, 2012 7:34 pm

Yeah, I also made one with the global.
You need to first create the global object which is in >Miscellaneous >Global

You then attach the global to your script as a 'global' property.
User avatar
sunny lovett
 
Posts: 3388
Joined: Thu Dec 07, 2006 4:59 am

Post » Mon Jun 18, 2012 8:23 pm

Alright, I'll look into it all in a few minutes, and see if it works. Thanks guys!
User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am

Post » Tue Jun 19, 2012 3:48 am

About QuestionMSG, you said to link that one to my message object, I'm not sure what that means. :ermm:
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Mon Jun 18, 2012 6:44 pm

About QuestionMSG, you said to link that one to my message object, I'm not sure what that means. :ermm:

You'll need to create a message in the CK (under miscellaneous > message).
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Tue Jun 19, 2012 3:40 am

Ah, gotcha. I'll try it out right now.
User avatar
April
 
Posts: 3479
Joined: Tue Jun 20, 2006 1:33 am

Post » Mon Jun 18, 2012 7:17 pm

Alright, I just tested it, but for some reason both Home or Return teleport me to the same location, outside of the Breezehome even though both my Home and Return Xmarkers are in Breezehome. :ermm: :bunny:
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm

Post » Tue Jun 19, 2012 2:28 am

It sounds like you dont have the marker properties linked to the correct xmarker inside breezehome.
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am

Post » Tue Jun 19, 2012 7:43 am

Here's what I did. I've placed two XMarkers. One is Ref ID Teleport_00, other is Teleport_01. They are next to each other in the middle of the room. I've linked the HomeTarget to Teleport_00 (since my 0 Index pick in the Message is Breezehome) and I've linked the TeleTarget to Teleport_01(since Index 1 in the Message is Return).
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Tue Jun 19, 2012 4:05 am

Are you using a clean save game? One that has never had your mod as part of the save game?
Its called save game corruption and when you are making a mod, you should always use a clean save or unpredictable things can happen.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Tue Jun 19, 2012 3:07 am

Are you using a clean save game? One that has never had your mod as part of the save game?
Its called save game corruption and when you are making a mod, you should always use a clean save or unpredictable things can happen.

Ah, nope it's not a clean save. I'll try it out.
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Tue Jun 19, 2012 9:32 am

Arlight just tested with a clean save and it did teleport me to the house when I picked Breezehome. BUT, picking Return, did not return me to Riften where I teleported from, instead it just like teleported me to where I was standing. I kinda just bumped a bit and that was it.
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Post » Tue Jun 19, 2012 6:29 am

Post your script. It sounds like your not moving the XMarkerHeading BEFORE you move to Breezehome.
I put 'waits' in my script to make sure it made the move before I moved the player.

Also, when you move the player, it used to 'end' the script right there. Not sure if it still does that in Skyrim.
User avatar
Blessed DIVA
 
Posts: 3408
Joined: Thu Jul 13, 2006 12:09 am

Post » Tue Jun 19, 2012 7:41 am

Ok so, I'm a scripting noob, but looking at the script I think I found out what's wrong. Basically, as you start to cast the spell you reach the part TeleTarget.MoveTo(caster) It moves the Xmarker referenced by TeleTarget in properties to where you are right. So, then the Button = QuestionMSG pops the message up and you hit Home, which teleports you to Breezehome. So all is good. BUT, when you start to cast the spell AGAIN the script will re-execute, thus hitting the TeleTarget.MoveTo(caster) AGAIN, and thus moving the marker right under your feet, so when you hit Return, it would do exactly what it does to me. Teleport me to where I stand. Here's the script.

Scriptname zTeleportBothWays extends activemagiceffect{Teleport Home Spell Script}ObjectReference property HomeTarget autoObjectReference property TeleTarget autoMessage Property QuestionMSG  AutoActor casterObjectReference casterRefint ButtonEvent OnEffectStart(Actor akTarget, Actor akCaster)caster = akCastercasterRef = (caster as ObjectReference)TeleTarget.MoveTo(caster)Utility.Wait(2.0)Button = QuestionMSG.Show()Utility.Wait(0.5)if Button == 0  casterRef.MoveTo(HomeTarget)elseif Button == 1  casterRef.MoveTo(TeleTarget)endifendEVENT
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Mon Jun 18, 2012 7:30 pm

Thats true. I wrote the script but have not tested it much yet. :lmao:

In your Button == 0, you could move the "TeleTarget.MoveTo(caster)' and place a short wait(0.2) before you move the player, just to make sure.

I think i have that right. It was a hard day at work today and my brain is fried.
User avatar
Thema
 
Posts: 3461
Joined: Thu Sep 21, 2006 2:36 am

Post » Mon Jun 18, 2012 8:08 pm

Thats true. I wrote the script but have not tested it much yet. :lmao:

In your Button == 0, you could move the "TeleTarget.MoveTo(caster)' and place a short wait(0.2) before you move the player, just to make sure.

I think i have that right. It was a hard day at work today and my brain is fried.

That's ok. :) Me and my friend managed to fix it, it seems! Here's how it looks now.

Scriptname zTeleportBothWays extends activemagiceffect{Teleport Home Spell Script}ObjectReference property HomeTarget autoObjectReference property TeleTarget autoMessage Property QuestionMSG  AutoActor casterObjectReference casterRefint ButtonEvent OnEffectStart(Actor akTarget, Actor akCaster)caster = akCastercasterRef = (caster as ObjectReference)Utility.Wait(2.0)Button = QuestionMSG.Show()Utility.Wait(0.5)if Button == 0  TeleTarget.MoveTo(caster)  Utility.Wait(2.0)  casterRef.MoveTo(HomeTarget)elseif Button == 1  casterRef.MoveTo(TeleTarget)endifendEVENT

So yeah, putting a little Wait() there did the trick it seems. Tested it a few times, worked great. :bunny: Thanks for the original script! Without it, it wouldn't have worked at all. :biggrin:
User avatar
phil walsh
 
Posts: 3317
Joined: Wed May 16, 2007 8:46 pm

Post » Tue Jun 19, 2012 2:12 am

Your welcome, it was the second script I ever wrote. :lol:

But, I would change the wait times.
This way, the home and recall has the same time before your moved.

Event OnEffectStart(Actor akTarget, Actor akCaster)caster = akCastercasterRef = (caster as ObjectReference)Utility.Wait(2.5)Button = QuestionMSG.Show()if Button == 0  TeleTarget.MoveTo(caster)  Utility.Wait(0.2)  casterRef.MoveTo(HomeTarget)elseif Button == 1  casterRef.MoveTo(TeleTarget)endifendEVENT
User avatar
ILy- Forver
 
Posts: 3459
Joined: Sun Feb 04, 2007 3:18 am

Post » Tue Jun 19, 2012 3:01 am

Yeah, gonna tweak that now. Thanks a bunch! Also, that is quite good for a second script xD. I sure couldn't have wrote it myself.
User avatar
Nicole Mark
 
Posts: 3384
Joined: Wed Apr 25, 2007 7:33 pm

Post » Tue Jun 19, 2012 7:49 am

Well, second 'Skyrim' script.
I am a programmer, so there you have it. :rofl:
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Tue Jun 19, 2012 9:58 am

Well, second 'Skyrim' script.
I am a programmer, so there you have it. :rofl:

Well, that explains it. :D So what do you think of Papyrus? Is it easier than other languages out there?
User avatar
Brian LeHury
 
Posts: 3416
Joined: Tue May 22, 2007 6:54 am

Next

Return to V - Skyrim