MarkRecall Hybrid?

Post » Sat Feb 15, 2014 5:26 am

So in Oblivion I could have scripted this in 5 minutes, but Papyrus eludes me. I have no real intention of doing major modding for Skyrim that will involve scripting, this will pretty much be the extent of it, so I guess that's a plus.

I did a tutorial on making a simple teleport to location spell. And it taught me primarily that Papyrus works in a way that my brain simple doesn't.

What I want to do is have a spell that acts as a hybrid between teleport to specific location and a mark/recall.

So I have a new location, let's call it Sanctuary. It's really out of the way.

I want to make a spell that will do certain things depending on conditions and locations.

1) If I am not in the Sanctuary and cast the spell, it teleports me to the Sanctuary.

2) If I cast it again while inside the Sanctuary, it will send me back to the location I teleported from before (my origin).

3) If I physically leave Sanctuary (through the door), nothing will change unless I cast it again while outside, and then we go back to step 1.

Can anyone help me with this? I really.. truly despise Papyrus and I would like my relationship with it to be a short one.

Thanks for any replies.

User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am

Post » Sat Feb 15, 2014 1:00 am

This has been several times already by numerous modders and for magic it was one of the first things people attempted to do with papyrus. Search on the nexus and you'll find them, and if they provided the source, you can learn how they did it. :smile:

And also you can search in some of the topics here in the CK forum, just type in mark and recall.

If I knew how to do this my self(I can only do it one way with my experience) I'd type it out for you.

User avatar
john palmer
 
Posts: 3410
Joined: Fri Jun 22, 2007 8:07 pm

Post » Fri Feb 14, 2014 7:32 pm

I think this would work:

Spoiler
Scriptname TeleportSpell extends ActiveMagicEffectActor Property PlayerRef AutoCell Property kSanctuary AutoObjectReference Property kSanctuaryMarker AutoObjectReference Property kWorldMarker AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)	If(akCaster == PlayerRef)		If(PlayerRef.GetParentCell() == kSanctuary)			PlayerRef.MoveTo(kWorldMarker)		Else			kWorldMarker.MoveTo(PlayerRef)			PlayerRef.MoveTo(kSanctuaryMarker)		EndIf	EndIfEndEvent

- PlayerRef can be auto-filled.

- kSanctuary should be filled with the cell form of your new location.

- kSanctuaryMarker should be an object reference that exists in the new location. You can use a marker (for example XMarker).

- kWorldMarker should be an object reference like a marker (or even another object) that can be moved to the player's location.

EDIT: Alternative script that replaces the kSanctuary cell property with calling the GetParentCell function on the kSanctuaryMarker property.

Spoiler
Actor Property PlayerRef AutoObjectReference Property kSanctuaryMarker AutoObjectReference Property kWorldMarker AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)	If(akCaster == PlayerRef)		If(PlayerRef.GetParentCell() == kSanctuaryMarker.GetParentCell())			PlayerRef.MoveTo(kWorldMarker)		Else			kWorldMarker.MoveTo(PlayerRef)			PlayerRef.MoveTo(kSanctuaryMarker)		EndIf	EndIfEndEvent 
User avatar
Noely Ulloa
 
Posts: 3596
Joined: Tue Jul 04, 2006 1:33 am


Return to V - Skyrim

cron