Jump to content

[LE] How to use the MoveTo() Function in Skyrim CK? [New Modder]


FurbyMine

Recommended Posts

Hey, I'm FurbyMine.

I'm currently working on a mod that enhances the view of religions in Skyrim.

 

I've been trying to use the MoveTo function.

I am stuck with it.

You see, In my mod. You go to a cell. When in the cell you approach the god you want to pick, You the activate their shrine.

It'll then ask if you want to join, You press join and it gives you some Items/Books/Weapons.

 

PROBLEM:

Now, after all of that. I want it to teleport me to Markarth Silver Blood Inn.

I started by using the, debug.CenterOnCell("MarkarthSilverBloodInn")

But then in the next build of my mod it always crashed my game.

Then I checked on the functions Object Reference Page from the Creation kit Website.

It said that it was known to cause crashes. I then attempted to use the MoveTo() Function.

 

Here is my script:

https://pastebin.com/NGYgtgut

 

NOTICE:

 

I know in this script I used Warrens but I would rather use Silver Blood Inn!

Link to comment
Share on other sites

Well I presume you understand using MoveTo() requires using an object reference. You don't necessarily need to use a COC Marker. Any object will work. Typically authors will find a vanilla xmarker of some sort at or near where they want. There's one right in front of the door named SilverBloodInnCleanFrontMarker 0x0f9952. That will probably do what you want. Just make sure whenever you pick a vanilla marker (or any object for that matter) that it is already persistent. Otherwise when you set it in a property the CK will convert it to persistent making an edit in the original cell as such.

Link to comment
Share on other sites

Well I presume you understand using MoveTo() requires using an object reference. You don't necessarily need to use a COC Marker. Any object will work. Typically authors will find a vanilla xmarker of some sort at or near where they want. There's one right in front of the door named SilverBloodInnCleanFrontMarker 0x0f9952. That will probably do what you want. Just make sure whenever you pick a vanilla marker (or any object for that matter) that it is already persistent. Otherwise when you set it in a property the CK will convert it to persistent making an edit in the original cell as such.

I am quite new to scripting, Do you think you could give an example?

Link to comment
Share on other sites

If your 'press join' is some from activator you can attach this script to it

 

Scriptname MyTelportScript extends ObjectReference

ObjectReference Property TargetLocation Auto

Event OnActivate(ObjectReference akActionRef)
Game.GetPlayer().MoveTo(TargetLocation)
EndEvent

 

 

or if you are just moving a quest on to new queststage just put Game.GetPlayer().MoveTo(TargetLocation) as a fragment and create and set the property in the stage.

 

TargetLocation is usually an Xmarkerheading you have placed in the world.

Link to comment
Share on other sites

 

Well I presume you understand using MoveTo() requires using an object reference. You don't necessarily need to use a COC Marker. Any object will work. Typically authors will find a vanilla xmarker of some sort at or near where they want. There's one right in front of the door named SilverBloodInnCleanFrontMarker 0x0f9952. That will probably do what you want. Just make sure whenever you pick a vanilla marker (or any object for that matter) that it is already persistent. Otherwise when you set it in a property the CK will convert it to persistent making an edit in the original cell as such.

I am quite new to scripting, Do you think you could give an example?

 

Thank you so much xD Make sure to join my DISCORD for a better Ty:https://discord.gg/nXp574F

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...