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...

How do i get the location of behind an NPC


Eldara
 Share

Recommended Posts

I've just started scripting and i wanted to make a basic spell that Teleports behind a target then slits their throat. So far i've figured out how to teleport to a target, the problem with this is that the NPC then instantly notices you. What i want is to teleport about a foot behind the target (The spell is silent so they shouldnt notice you)

Here is what i have to far

Scriptname EldScriptShadowStrike extends activemagiceffect

spell property StrikeEffect auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

StrikeEffect.Cast(akCaster,akCaster)

Utility.Wait(0.2)

akCaster.MoveTo(akTarget)

Utility.Wait(0.1)

akCaster.StartVampireFeed(akTarget)

EndEvent

The Vampire feed is just a place holder. As a second question does anyone know how you write the script to do the slit throat? I play an assassin style character and i currently have a mod that replaces pickpocket with slit throat when a dagger is equipt but i have no idea how i script the dagger slit throat in.

Link to comment
Share on other sites

Will place actor in location relative to direction target is not facing

 
float anglez = akTarget.GetAngleZ() + 180
;or +90 for right, -90 for left, 0 for in front
float distance = 100.0
float offsetx = distance * math.sin(anglez)
float offsety = distance * math.cos(anglez)
Game.GetPlayer().MoveTo(akTarget, offsetx, offsety, 0)
[/CODE]

If your not behind them, remove the +180 from anglez at the top.

Link to comment
Share on other sites

Thanks that works great! I also figured out how to add in animations i couldn't find the slit throat but found a back stab, it will work for the time being i need to clean up a few of the timings to make it smoother.

(Footage:

) not bad for my first time using the Creation Kit, the one other problem i have as can be seen in the video is often despite my crosshair being directly over the target nothing happens and i get the sound as if im not targeting anything, it seems to hit more in first person but as i like to play in 3rd person is there anyway to reolve this?

I tried making it a projectile spell over Target Actor but that seemed to break it. Is there anyway to make it do something like is Invalid target get nearest target within X feet of targeted location (Can set the distance low to say 3 feet, a sort of built in auto aim). Is this possible?

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...