Kyubitron Posted August 16, 2019 Posted August 16, 2019 (edited) 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 existNo 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 August 16, 2019 by Kyubitron
Evangela Posted August 16, 2019 Posted August 16, 2019 (edited) The problem is that you're trying to move a referencealias array with MoveTo but MoveTo can't be called on such. Edited August 16, 2019 by Rasikko
Kyubitron Posted August 16, 2019 Author Posted August 16, 2019 Ah, that explains it. What would be a good way to get the follower actor ref then?
Evangela Posted August 16, 2019 Posted August 16, 2019 I don't really remember how to handle arrays that need to be called on functions. I think you gotta cast the array to ObjectReference or Actor.
Kyubitron Posted August 16, 2019 Author Posted August 16, 2019 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
Recommended Posts