Jump to content

Blink Spell Scripting Help


Recommended Posts

I am currently trying to imitate the blink ability from dishonored in the form of a spell using the creation kit and I am hoping someone could give me some guidance. Currently my spell works as follows. It is an empty projectile spell that has a custom explosion attached to it. The explosion has an activator that runs this script...

Actor Property PlayerRef Auto

Event OnInit()
Game.GetPlayer().moveto(self)

self.delete()

EndEvent

So far after trial and error through what I've been able to find online, this has been what's made me progress. In its current form, the spell will instantly teleport my character to wherever my crosshairs are pointing and place my character facing north. But this isn't my desired outcome. I would like the spell to more so "move" my character to where I am pointing like it does in dishonored instead of an instantaneous teleport. If anyone knows how I would go about scripting that sort of thing I would like to know.

There are already a few mods that achieve this sort of effect, namely the "blink spell mod" by meh321. But unfortunately meh's mod wont work in 1.6. There is also "gifts of the outsider" that has a blink spell too. This one works quite well but I'm not a big fan of the visuals the mod author set for it. So I've taken an interest in making my own. If you have any insight on how I could script this sort of thing i would appreciate it.

Link to comment
Share on other sites

MoveTo(ObjectReference akTarget, float afXOffset = 0.0,
  float afYOffset = 0.0, float afZOffset = 0.0, bool abMatchRotation = true)

your simply matching the rotation of maybe the target try this

Game.GetPlayer().moveto(self, abMatchRotation = false)

if that fails we may need to get jiggle with it

	Float fAngleZ = Game.Getplayer().GetAngleZ()
	Game.Getplayer().MoveTo(self)
	Game.Getplayer().SetAngle(0, 0, fAngleZ)

Disclaimer untested code, may or may not need some trigonometry calculations to back it up..., but give it a go

https://ck.uesp.net/wiki/GetAngleZ_-_ObjectReference

https://ck.uesp.net/wiki/SetAngle_-_ObjectReference

BTW the Z in move to is XYZ axis, not angle Z, angle Z  is different and NOT included, except for the boolean, in MoveTo

 

EDIT in set angle leave the first two values alone, it is like Yaw and Pitch..  you do not need to play with it, unless you making a realistic flying mod too?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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