Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Need help finding a script


xqeqlic
 Share

Recommended Posts

Hi people of TESA.First off i would just like to say i never been to this site before didnt really know it existed, I quite like it.

Looked around the forums but didnt seem to find a solution for me so i figured id register and ask you guys nicely.

Basically i made a teleport spell that teleports you to a fixed location but what i cant seem to find is a proper script for this effect to remember the location of the caster beforehand so that when you cast it again it recalls you to the place where you first casted it.

I think that is a easy task for a lot of people, but it is not for me.I might be wrong.

Help greatly appreciated. Thank you guys for your time.

Link to comment
Share on other sites

Basically, the easiest thing to do is to use a pair of Markers one for each teleport destination. In your case, it sounds like one of the 2 markers will be stationary. Before you teleport the player to the desired destination, just move the marker to their position so that you know where to return them.

 

As an example, here is the source from my Ethereal Ring mod:

Scriptname JaxonzEtherealRing extends ObjectReference  
{Script supporting the JaxonzEtherealRing item.}

ObjectReference property destWhereEquippedMarker auto
ObjectReference property destWhereUnequippedMarker auto
sound property soundTeleport auto

Event OnEquipped(Actor akActor)

	;move equipped marker to present location
	destWhereEquippedMarker.MoveTo(akActor)

	;teleport player to unequipped marker location
	akActor.MoveTo(destWhereUnequippedMarker )

	;start FX, visuals from attached enchantment
	soundTeleport.Play(akActor)
endEvent

Event OnUnequipped(Actor akActor)

	;move unequipped marker to present location
	destWhereUnEquippedMarker.MoveTo(akActor)

	;teleport player to unequipped marker location
	akActor.MoveTo(destWhereEquippedMarker )

	;start FX, visuals from attached enchantment
	soundTeleport.Play(akActor)

endEvent

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	if akOldContainer && !akNewContainer
		;ring dropped to the ground		
		;reset both markers to current location
		destWhereEquippedMarker.MoveTo(Game.GetPlayer())
		destWhereUnEquippedMarker.MoveTo(Game.GetPlayer())
	endIf
endEvent

Hope that helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...