Jump to content

Script error questions on Activator Teleport Script with follower


Kyubitron

Recommended Posts

So I'm Trying to make a special door teleport script to remove entrances from the awareness of the games AI pathing system, as MinUse flags seem not to work. I really don't want it to send NPCs towards the door in question, or point quests at it.

 

So, after looking at forums and experimentation, I have come up with this.

 

 

 

 

Scriptname BRZRB_TeleportDoor extends ObjectReference  
{Makes Doors teleport, with a built in delay to allow animation and then sets them closed}


ObjectReference property TeleportMarker auto
Actor Property PlayerRef Auto
ReferenceAlias[] Property Follower Auto


Event OnActivate(ObjectReference akActionRef)
   If akActionRef == Game.GetPlayer()
       Utility.Wait(2.5);
      Game.GetPlayer().MoveTo(TeleportMarker, abMatchRotation = true)


            Int FAlength = Follower.Length
            Int FAIndex = 0
           While FAIndex < FALength
                 If Follower[FAIndex]
                      Follower[FAIndex].MoveTo(TeleportMarker, abMatchRotation = true)


                 EndIf
           FAIndex += 1
           EndWhile


       Self.SetOpen(False)
   EndIf
EndEvent

 

However, compilation fails with this Error:

Starting 1 compile threads for 1 files...
Compiling "BRZRB_TeleportDoor"...
C:\Games\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\BRZRB_TeleportDoor.psc(17,40): MoveTo is not a function or does not exist
No output generated for BRZRB_TeleportDoor, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on BRZRB_TeleportDoor

 

Any insight would really help.

Edited by Kyubitron
Link to comment
Share on other sites

Alright, it was just to handle multiple followers, but I can do away with the array if there's just a simple solution to a single follower.

 

I'm trying to make a faux vanilla door essentially.

 

I have a non follower version working partially, though for some reason the target Heading Xmarker direction is ignored.

Working version:

Scriptname BRZRB_TeleportDoor extends ObjectReference  
{Makes Doors teleport, with a built in delay to allow animation and then sets them closed}


ObjectReference property TeleportMarker auto


Event OnActivate(ObjectReference akActionRef)
   If akActionRef == Game.GetPlayer()
       Utility.Wait(2.5);
       akActivator.MoveTo(TeleportMarker, abMatchRotation = true)
       Self.SetOpen(False)
   EndIf
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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