EvoEarth7 Posted August 4, 2021 Share Posted August 4, 2021 After more than 2 weeks of scouring the internet and these forums, I just can't get my mod to work. I've watched tutorials and tried to follow the instructions I found in these links, but to no avail. Any help would be very much appreciated. I'm creating a portable home that can be accessed by casting a spell. I got the teleport in spell to work but can't get the teleport out to my previous location to work. When I'm in the home and cast the spell to go out, it puts me at the mod entrance again. (I've tried using all of the portable home mods I could find but none of them had everything I wanted in them.) My script said it was compiling properly so I can't figure out where the missing link is to make it work. Here is what I have so far: Scriptname CampTeleportAbility extends activemagiceffect ObjectReference Property DDMarker001 Auto ;xMarker in mod cellObjectReference Property DDTeleportPoint Auto ;xMarker that is supposed to be placed in the world location I teleport fromGlobalVariable Property DDTeleportCount Auto ;Spell cast on count 1 to enter mod, cast on count 2 to exitEvent OnEffectStart(Actor akTarget, Actor akCaster) if DDTeleportCount.Getvalue() == 0 Utility.Wait(1.5) DDTeleportPoint.MoveTo(Game.GetPlayer()) Game.FadeOutGame(False, True, 2.0, 1.0) Game.GetPlayer().MoveTo(DDMarker001) Game.EnableFastTravel() Game.FastTravel(DDMarker001) DDTeleportCount.SetValue(1) Elseif DDTeleportCount.GetValue() == 1 Game.FadeOutGame(False, True, 2.0, 1.0) Game.GetPlayer().MoveTo(DDTeleportPoint) Game.EnableFastTravel() Game.FastTravel(DDTeleportPoint) DDTeleportCount.SetValue(0) EndifEndEventCompiler Output:Starting 1 compile threads for 1 files...Compiling "CampTeleportAbility"...Starting assembly of CampTeleportAbility0 error(s), 0 warning(s)Assembly succeededCompilation succeeded.Batch compile of 1 files finished. 1 succeeded, 0 failed. Thank you in advance for your time and assistance!Evo Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 4, 2021 Share Posted August 4, 2021 Put the wait after moving the xmarker to the player. That way the xmarker has time to get to the player before the player is stuck in a loading screen. Link to comment Share on other sites More sharing options...
EvoEarth7 Posted August 4, 2021 Author Share Posted August 4, 2021 Thank you for replying! Unfortunately, that change didn't work. I used the basic xMarker for the moving teleport point. Is there a different one I should have used? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 4, 2021 Share Posted August 4, 2021 I don't think so. Add some notification statements to see what is going on. The global variable should update but if for some reason it is not, the second cast of the spell would think it is still the first cast. You might want to consider setting up a second magic effect. One magic effect to teleport in and one to teleport out. Since you have a dedicated location to teleport into you could use a condition to determine which magic effect is triggered based upon the current location. Link to comment Share on other sites More sharing options...
NexusComa2 Posted August 5, 2021 Share Posted August 5, 2021 I'm guessing ... DDTeleportPoint.MoveTo(Game.GetPlayer())Never actually set the marker in the right spot.Here is one of mine that works well. ;* Enchanted Ship In a Bottle ...;* ModelShip - { Coaded by: NexusComa ... 12/03/2015 };----------------------------------------------------Scriptname Ship00_ModelShipTeleport Extends ActiveMagicEffectCell Property ModelShip AutoObjectReference Property Marking AutoObjectReference Property ModelShipMarker AutoObjectReference Property ModelShipItem AutoEvent OnEffectStart (Actor Target, Actor Caster)If (Caster.GetParentCell() != ModelShip)Marking.MoveTo(Caster)Caster.MoveTo(ModelShipMarker)Game.EnableFastTravel()Game.FastTravel(ModelShipMarker)EndIfEndEventEvent OnEffectFinish (Actor Target, Actor Caster)Caster.Moveto(Marking)Game.EnableFastTravel()Game.FastTravel(Marking);*Safety CatchIf Caster.GetItemCount(ModelShipItem) < 1Caster.AddItem(ModelShipItem)EndIfEndEvent Link to comment Share on other sites More sharing options...
SeraphimKensai Posted August 5, 2021 Share Posted August 5, 2021 Here's my script for my Shadow Blink Spell as this might be useful to you. In a nutshell casting the spell I have a messagebox pop up with three choices (essentially save my current location, teleport to my saved location, return to the previous location I last used the spell, or cancel).... scriptName z2018mjhMarkRecallScript extends activemagiceffect objectreference property z2018mjhMarkRecallMarker auto activator property SummonTargetFXActivator auto message property z2018mjhMarkRecallMenu auto objectreference property z2018mjhMarkRecallReturnMarker auto Event OnEffectStart(Actor akTarget, Actor akCaster) Int mjhChoice = z2018mjhMarkRecallMenu.show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000) if mjhChoice == 0 z2018mjhMarkRecallMarker.MoveTo(akCaster as objectreference, 0.000000, 0.000000, 0.000000, true) akTarget.PlaceAtMe(SummonTargetFXActivator as form, 1, false, false) debug.notification("Shadow Blink - Location Bound.") elseIf mjhChoice == 1 z2018mjhMarkRecallReturnMarker.MoveTo(akCaster as objectreference, 0.000000, 0.000000, 0.000000, true) akCaster.MoveTo(z2018mjhMarkRecallMarker, 0.000000, 0.000000, 0.000000, true) akTarget.PlaceAtMe(SummonTargetFXActivator as form, 1, false, false) elseIf mjhChoice == 2 akCaster.MoveTo(z2018mjhMarkRecallReturnMarker, 0.000000, 0.000000, 0.000000, true) akTarget.PlaceAtMe(SummonTargetFXActivator as form, 1, false, false) elseIf mjhChoice == 3 endIf endEvent Essentially, I use 2 xmarkers, 1 that the player can set directly, and the other is set indirectly when the player uses the 2nd option. This allows you to be able to teleport back to the location that you first used the spell, and houses everything in 1 spell. For your effect, I would use 2 xmarkers, 1 being the teleport in point that is never moved, and the other that is set at your location before teleporting to the teleport in marker, so that your teleport out effect, points to your mobile xmarker that is moved when you first cast the spell. You could use akCaster instead of calling Game.GetPlayer(), and you don't really need to use the fast travel stuff, you could just use MoveTo (only difference there if I recall correctly is the fast travel time would add to your game time, as the moveto is instant). Also I agree with Ishara, if you're calling utilitywait, have it after you move the invisible xmarker to your location, as there's no point in waiting before you your effect does anything, might as well have your marker move to you then wait. Hopefully this helps you. Link to comment Share on other sites More sharing options...
Recommended Posts