Jump to content

Help: Teleport spell - crosshairs


soulbladex

Recommended Posts

I have learned the scripting language fairly fast and I have developed a working teleport spell. Currently, I can cast the spell and it teleports me to a location that I have specified in the Creation Kit. My question is, is it possible to use the same spell (only modified) to teleport mt to where the crosshairs are currently pointed? Is there a way for referencing the crosshairs through the script?

 

Current Script:

ObjectReference Property TargetLocation Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

Game.GetPlayer().MoveTo(TargetLocation)
Game.EnableFastTravel()
Game.FastTravel(TargetLocation)

 

EndEvent

 

Link to comment
Share on other sites

Why are you moving the player and fast travelling?

 

Anyway, I have yet to find a way to get the location the player is looking. However, using SKSE, there might be a way. But I don't think it would be a normal function. I think you'd have to make an SKSE plugin to manage that. This is speculation, however.

Link to comment
Share on other sites

First of, you should use

 

Game.GetPlayer().MoveTo(TargetLocation)

 

as using fast travel increases the time of the day while this does not.

 

To teleport to the cross hair you need to make a missile spell. This spell uses a custom missile. The missile has a custom explosion assigned to it. The explosion spawns a custom activator. The activator has the teleport script attached to it:

 

Actor Property PlayerRef Auto

 

Event OnInit()

PlayerRef.moveto(self)

self.delete() ; thanks for reminding me

 

EndEvent

 

That's just the core of the script though. You can have it play special effects and do other stuff.

 

Edited by Sjogga
Link to comment
Share on other sites

To whoever figured that out, that's a very creative solution. I've only used explosions to spawn things once, and that was for enchanting arrows. Thinking about it, though, of course that would work. Sometimes it's nice to be wrong :)

Link to comment
Share on other sites

  • 5 years later...

First of, you should use

 

Game.GetPlayer().MoveTo(TargetLocation)

 

as using fast travel increases the time of the day while this does not.

 

To teleport to the cross hair you need to make a missile spell. This spell uses a custom missile. The missile has a custom explosion assigned to it. The explosion spawns a custom activator. The activator has the teleport script attached to it:

 

Actor Property PlayerRef Auto

 

Event OnInit()

PlayerRef.moveto(self)

self.delete() ; thanks for reminding me

 

EndEvent

 

That's just the core of the script though. You can have it play special effects and do other stuff.

If you're still a Nexus regular, thought I'd tell you that your post here was clear and helpful even 6 years later. A bit of piddling and I was working straight away.

 

Thanks!

Edited by monsto
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...