Hi, i'm making a house/home mod where i have created my own worldspace and i'm making a teleport spell for it, should the spell just be like this?
scn joeTeleportplayer.moveto islandxmarkerEnd
No. Using Player.MoveTo to get to another worldspace can result in serious problems with dialogue. Characters that should be able to talk to you will instead display "I have no greeting" when you try to talk to them. You can avoid this by using doors to get to and from your worldspace. To mimic a teleport spell using doors, follow these steps:
1. Place one door in your worldspace and another in Tamriel, then link them together. Make sure the Tamriel door is in a location you want the Player to appear when they leave your worldspace.
2. Make both doors persistent references and give them unique reference IDs (I'll use HomeWorldDoorRef & TamDoorRef as examples).
3. Move the doors below the ground so they can't be seen, but keep the teleport makers at the spots you want the Player to appear in.
4. Use the following script:
scn JoeTeleportBegin ScriptEffectStartIf Player.GetInWorldspace Tamriel == 1Player.Activate TamDoorRefElseIf Player.GetInWorldSpace YourHomeWorldSpaceName == 1Player.Activate HomeWorldDoorRefElseMessage "You cannot teleport from here."EndifEnd
^That will allow you to teleport to your worldspace when you're in Tamriel and back to Tamriel when you're in your worldspace.
Note: Sometimes other NPCs can use doors set up like this, even though they're below ground. To avoid this, make a unique key for your doors. Then make both doors owned by the PlayerFaction (not Player, but
PlayerFaction), set the lock level to 'Needs a Key' and select your newly created key from the list. DO NOT place your key in game and never give it to ANYONE. Since the doors are owned by the PlayerFaction, anyone belonging to the PlayerFaction (i.e. the Player, companions, etc.) can go through them without needing the key and the doors will remain locked to everyone else. If you go through one of them with the key, they will be unlocked and anyone can go through them.
How do i add this spell to the players inventory when they load their save? Do i just make a quest that somehow gives the player the spell?
Thank you very much!!
You can indeed make a quest that will add the teleport spell to the Player on startup. To do so, follow these steps:
1. At the top of the CS, click on 'Character' and select 'Quests'.
2. Right click in the quest list and select 'New'.
3. Give your quest a name (I'll use AAAJoeTeleportAddQuest as an example) and set the Priority above 0, then click 'Okay' (on the bottom right corner) and close the window.
4. Create the following script and set it as a Quest script:
scn JoeTeleportSpellAddBegin GameModePlayer.Addspell JoeTeleportSpellStopQuest AAAJoeTeleportAddQuestEnd
5. Open your quest again and select your newly created quest script for it, then click 'Okay' and close th window.
That should do it.
Edit: Typo