Jump to content

Teleport a NPC to a location


MoonlightArcher

Recommended Posts

How can I teleport a NPC to a specific location(or XMarker) when a quest stage has been done?

What script do I need to use? Or what Package?

I tried to make a scene for it but it didn't work and also the scriptline alias_NPC.ForceToRef(XMarker) did not work. Also the line game.GetPlayer().PlaceAtMe(XMarker) did not work.

I really need help with this.

Link to comment
Share on other sites

This is a script from one of my mods it's attached to a spell, but you should be able to change it to work for you.

This is untested, but I think it's at least close to what you want.

Scriptname FR_AelaTheHuntress extends activemagiceffect

ObjectReference property AelaTheHuntressREF auto
Quest property questnamebelow Auto

Event OnEffectFinish(Actor target, Actor caster)
if (SideQuestProperty.GetStageDone(10))
AelaTheHuntressREF.MoveTo(Game.GetPlayer(), 120 * Math.Sin(Game.GetPlayer().GetAngleZ()), 120 * Math.Cos(Game.GetPlayer().GetAngleZ()), Game.GetPlayer().GetHeight() + 2)
endif
EndEvent

Change AelaTheHuntressREF to who ever you want to teleport.
Change game.getplayer to the marker reference.
Change SideQuestProperty to your quest.

Don't forget to set them in the script property or it won't work.

 

The math part the moveto line will set the teleported npc slightly infront of and a bit above the marker, so you'll want to play around with hte number.
Placeatme just create clones instead of moving who you want.

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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