Jump to content

Photo

Script help for portable dimension/pocket home

pocket dimension mark and recall script portable home

  • Please log in to reply
2 replies to this topic

#1
4Millimeter

4Millimeter

    Newbie

  • Members
  • Pip
  • 13 posts

Hi,
I would like to make a spell to a pocket home and have an item that takes the player back to where they where.
I'm good at the designing part but the scripting part...not so good.
I have looked at mark and recall mods on the Nexus and on a few pocket dimensions. I also looked at some scripts here at the forum too.
I get parts of the script but not all of it and I do not want to just grab someone elses scripts and use it as my own.
I be happy if someone could write the code and guide me through how to implement it.
Thank you.



#2
Dromundas

Dromundas

    Fan

  • Members
  • PipPipPip
  • 357 posts

You will only learn how to write scripts by looking at them. By that logic you will be grabbing these 2 from me...

First you would create your pocket world. Then add 2 x-markers to it. 1 x-marker will mark the "landing spot" for the player. The other will sit nearby.

Then you need to make a spell and a magic effect for it in CK. Afterwards you can add a script to the magic effect and paste this in.

Scriptname MyMod_TeleportPlayerHome extends ActiveMagicEffect

ObjectReference Property xMarkPocket Auto
ObjectReference Property xMarkRecall Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

    xMarkRecall.MoveTo(akCaster)
    akCaster.MoveTo(xMarkPocket)

EndEvent

Save the script. Make sure your custom script name matches the Scriptname within the script. Once you have successfully compiled the script, exit the script and right-click it to fill out the properties window. Set xMarkPocket to your x-marker "landing spot" and xMarkRecall to the x-marker off to the side.

Now you should be able to get to your pocket world.

To get back you need to create the activator object and add it to your pocket world. Also add the following script to your activator, rename the script contents as needed.

Scriptname MyMod_TeleportPlayerRecall extends ObjectReference

ObjectReference Property xMarkPocket Auto
ObjectReference Property xMarkRecall Auto

Event OnActivate(ObjectReference akActionRef)

    akActionRef.MoveTo(xMarkStart)
    xMarkRecall.MoveTo(xMarkPocket)

EndEvent

Save, exit, and once again fill out the properties with the x-markers from your pocket world.

Now when the player activates the object, they should be moved to their recall position and the recall x-marker will reset cleanly for uninstalls if needed.

Edit: I forgot to share my sources.

https://www.creation...tiveMagicEffect
https://www.creation...ObjectReference
https://www.creation...ObjectReference
https://www.creation...le=Magic_Effect
https://www.creation...title=Activator


Edited by Dromundas, 25 August 2021 - 05:58 PM.


#3
4Millimeter

4Millimeter

    Newbie

  • Members
  • Pip
  • 13 posts

Thank you so much. I have built a bunch of houses/homes/apartments that works fine but there the X-markers are static.
Now I will se if I can make a pocket home work with these scripts.
Happy dance.







Also tagged with one or more of these keywords: pocket, dimension, mark and recall, script, portable, home

IPB skins by Skinbox
Page loaded in: 1.224 seconds