Teleport script assigned to a object help?

Post » Sat Aug 02, 2014 12:51 pm

Hello,

I'v searched and scraqed the internet for any guides on how to do this, or perhaps i'm just being unlucky, but i cannot for the life of myself figure out how to do what i'm about to say here.

Basically, what i want is a object, such as a orb, which when you hover the crosshair over it, it says "[e] Riverwood", which, when you press e teleports you to riverwood. Basically a one way teleport from my house to riverwood. I understand how to add scripts to a object but not creating them, so i haven't tried to make myself a script because i have no idea how. I have my house and all the objects set up, i just need to add the scripts (Or what it needs to do what i said) for it to be complete, Hope someone can help me here, Thank you.

'Overview'

Object turned into a activator, you press e on the object and it sends you (one way) to riverwood.

User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Sat Aug 02, 2014 3:44 pm

Well, everyone's got to start learning. You probably first want to look at http://www.creationkit.com/OnCrosshairRefChange_-_Form. You will need SKSE installed to use it.

Don't be afraid of SKSE, it's very easily installed, and will do no harm whatsoever to your computer or computers performance. It's just a tool making your scripting so much more easy. Script could be put on any form, or even better, on a quest alias that needs to be filled. Take this script as example and then learn over at the http://www.creationkit.com/Category:Papyrus to code.

Event OnInit()	InitMod()EndEventEvent OnPlayerLoadGame()	InitMod()EndEventFunction InitMod()	RegisterForCrosshairRef()EndFunctionEvent OnCrosshairRefChange(ObjectReference ref)	If ref ;Used to determine if it's none or not.	EndIfEndEvent

Basically what you want to do is putting this script on your form (your orb, moveable static, activator, container whatever it may be), learn how to register for keypress and execute your teleport. You can also achieve this with using OnKeyDown Event, which probably is much more easy. This are the specific code snippets you will want to have a look at...

RegisterForKey()

OnKeyDown()

MoveTo()

All StringUtil functions

User avatar
kirsty williams
 
Posts: 3509
Joined: Sun Oct 08, 2006 5:56 am

Post » Sat Aug 02, 2014 1:18 pm

Thank you, Don't suppose you could knock up a script or two for it? Totally cool if you can't

User avatar
Wanda Maximoff
 
Posts: 3493
Joined: Mon Jun 12, 2006 7:05 am

Post » Sat Aug 02, 2014 4:54 am

Make the orb an activator(activators can have any model).

Scriptname TeleportRiverwoordOrb extends ObjectReference Actor property PlayerRef auto ObjectReference property Riverwood01 auto  Event OnActivate(ObjectReference akActionRef)      if akActionRef == PlayerRef          PlayerRef.MoveTo(Riverwood01)      endifEndEvent

You'll have to specify in the property where in Riverwood01 you wanna land at.

As for the labeling, that's gonna take some extra work involving a perk.

Create a perk. In the bottom half of the window, right click and choose new.

In the following window, check "Perk Entry Point". By default you'll see "Activate" and "Activation choice". You'll notice "Button Label". Change that to Riverwood. Check "Run Immediately" and "Replace Default".

Head over to the "Conditions" section and click on the "Target" tab.

Right click → New

GetIsID: NameofOrbID == 1.00 AND

And you're done. Make sure to apply the perk to the player. (make sure "playable" box is checked)

User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Sat Aug 02, 2014 3:07 pm

Thanks to Mofa and terra, I understand the basics of scripting, which furthermore lead me to understand the following script and what it meant, Thank you two very much for it has worked like a charm, Here's a token of my appreciation, its not much, but its what I have '+2500 septims' Lil' joke in there for you ;) Thanks again
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm


Return to V - Skyrim