Undivide Posted October 21, 2013 Share Posted October 21, 2013 Basically, I'm attempting to use a script to teleport my custom follower to the player upon activation, but all the script does is make my player hop. Scriptname ReiTeleport extends Activemagiceffect Activemagiceffect property teleportrei auto EVENT OnEffectFinish(Actor Reiko, Actor akCaster) akCaster = Game.GetPlayer() Reiko.MoveTo(akCaster, 5.0 * Math.Sin(akCaster.GetAngleZ()), 5.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 0) EndEventhttp://s21.postimg.org/61va76n47/prob1.pngI've tried both target actor and target self. Any clue on what I'm doing wrong? Link to comment Share on other sites More sharing options...
Derok Posted October 21, 2013 Share Posted October 21, 2013 Not really a pro scripter, but why you don't just use Game.GetPlayer?I'm not sure you can change the caster in that way. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 21, 2013 Share Posted October 21, 2013 Try this Reveal hidden contents Scriptname ReiTeleport extends Activemagiceffect Activemagiceffect property teleportrei auto EVENT OnEffectFinish(Actor Reiko, Actor akCaster) If akCaster == Game.GetPlayer() Reiko.MoveTo(akCaster, 5.0 * Math.Sin(akCaster.GetAngleZ()), 5.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 0) EndIf EndEvent Link to comment Share on other sites More sharing options...
Undivide Posted October 21, 2013 Author Share Posted October 21, 2013 Nope, nothing. =/ Link to comment Share on other sites More sharing options...
myztikrice Posted October 21, 2013 Share Posted October 21, 2013 This is from a spell or attached to an object? Link to comment Share on other sites More sharing options...
Undivide Posted October 21, 2013 Author Share Posted October 21, 2013 On 10/21/2013 at 8:10 PM, myztikrice said: This is from a spell or attached to an object?Spell Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 21, 2013 Share Posted October 21, 2013 Duh! Why didn't I see it?You changed the target inside the event call and you didn't set up a property for your follower. The below compiles. It may (and should) work for you. What I did was setup a property for your NPC actor, a property for the player, a property for current follower.When the effect starts, the follower is compared to your NPC actor. If it is a match, the follower should teleport to the player with the coordinates that you've calculated. Reveal hidden contents ScriptName ReiTeleport Extends ActiveMagicEffect Actor Property PlayerRef Auto ; auto-fills ReferenceAlias Property Follower Auto ;select DialogueFollower as the quest then Follower as the alias Actor Property Reiko Auto ;your follower Event OnEffectStart(Actor akTarget, Actor akCaster) ;finish might be fine but start may help with initial troubleshooting and setup If (Follower.GetReference() as Actor).GetActorBase() == Reiko.GetActorBase() ;does the follower reference match your NPC actor Float X = 5.0 * Math.Sin(PlayerRef.GetAngleZ()) Float Y = 5.0 * Math.Cos(PlayerRef.GetAngleZ()) Float Z = PlayerRef.GetHeight() - 0 Follower.GetReference().MoveTo(PlayerRef, X, Y, Z) EndIf EndEventBe sure to click the properties button and fill out the information properly. Link to comment Share on other sites More sharing options...
Undivide Posted October 22, 2013 Author Share Posted October 22, 2013 Thanks for the help, Ishara. Now I have another issue. The script only works when I'm near the follower and teleports inconsistently, but it's a huge step up from where I started. Haha. In papyrus logs, it gives me this: [10/21/2013 - 09:45:04PM] ae::monitor: Reiko registered with AE[10/21/2013 - 09:45:04PM] Error: Cannot call Is3DLoaded() on a None object, aborting function callstack:[ Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 22, 2013 Share Posted October 22, 2013 There is no Is3dLoaded() call in the script I provided. Where is that coming from? I used teleport locally to move the player and then the follower from one location to an internal cell. The follower wouldn't port till after the player moved out of a trigger in the internal cell so I know the MoveTo command can function without the follower being near. Link to comment Share on other sites More sharing options...
Undivide Posted October 23, 2013 Author Share Posted October 23, 2013 (edited) it was near the Reiko Script in the log, so I thought it had something to do with it. I was very wrong. Anywho, I've figured something out. Reveal hidden contents ScriptName ReiTeleport Extends ActiveMagicEffect ;import Utility ;import Game Actor Property PlayerRef Auto ; Player Actor Property Reiko Auto ; Reiko ObjectReference Property Marking auto ;Message Property msgKeyMenu Auto (reserved for a later version) ; Location int property OffX Auto int property OffY Auto ; int iButton (Reserved) Event OnEffectStart(Actor Reiko, Actor akCaster) PlayerRef = akCaster ; iButton = msgKeyMenu.Show() (Reserved) If (Reiko.GetParentCell() != PlayerRef.GetParentCell() || Reiko.GetParentCell() == PlayerRef.GetParentCell()) Marking.Moveto (PlayerRef) Reiko.MoveTo(Marking, OffX, OffY, 0, false) EndIf EndEvent I took a look at the way Haven Bag handled teleportation, so I created a marker that moves when the effect is activated . Thank you very much for your assistance! I'll be putting you in the credits section of my mod if you don't mind. :laugh: Edited October 23, 2013 by Undivide Link to comment Share on other sites More sharing options...
Recommended Posts