Jump to content

How to make an activator teleport the player?


JBrightstar

Recommended Posts

Hi there.

 

I'm currently working on a player house mod, and what I'd like to do is have an activator in the Tamriel worldspace teleport me to the Interior, and vice versa. The same functionality as a door, essentially. But I can't work out how to do this. I've tried mimicking the process used to make the Boat to Castle Volkihar but I can't seem to make that work here. If anyone could take the time to help me out, or even just point me to a relevant tutorial, I'd appreciate it.

Link to comment
Share on other sites

Simple as:

Scriptname ExampleTeleporter extends ObjectReference

ObjectReference property TeleportMarker auto

Event OnActivate(ObjectReference akActivator)
     akActivator.MoveTo(TeleportMarker)
EndEvent

Attach the script to your object that is activated. Place a marker where you want the player to go and set the property TeleportMarker to that. This above script will make anything that activates the object teleport to TeleportMarker. If you want to limit it to the player put an if condition around the MoveTo line that checks to see if akActivator is the player.

Link to comment
Share on other sites

Oh something could be done, but the script would need adjustment.

 

I do have a working teleport script but it uses a trigger box as I had intended to make a entry area that looked like a summoning circle. It was capable of handling one follower. Let me look over my script and see what would need to be added to the above script which is for use with object activation.

Link to comment
Share on other sites

Alternatively, what you could do is make a new Door form (in the Object Window). Give it a unique editor id, uncheck all the flags, and set the model to whatever piece of clutter you like. It could be any piece of clutter really, whatever suits what you are trying to do. Doesn't have to be a door model either. Also, there does not need to be any scripts attached to the new Door object. You can also set sounds that play when you teleport by setting the Open field. Drag the Door into the render window and start editing the reference (not the base form, the reference in the Render Window). Go to the Teleport tab and check the Teleport box. Set it up exactly as you would a normal door. Voila! NPCs should follow you through them as well!

Edited by DragonDude1029
Link to comment
Share on other sites

I think DragonDude1029 has the right idea. Creating a unique door with a specific mesh would probably be preferable.

 

However, if you still want, the following should work for a scripted object.

 

 

 

Scriptname ExampleTeleporter extends ObjectReference

ObjectReference property TeleportMarker auto
Actor Property PlayerRef Auto
ReferenceAlias[] Property Follower Auto

Event OnActivate(ObjectReference akActivator)
	If akActivator == PlayerRef 
     akActivator.MoveTo(TeleportMarker)
	 Int FALength = Follower.Length
	 Int FAIndex = 0
	 While FAIndex < FALength
		If Follower[FAIndex]
			Follower[FAIndex].MoveTo(TeleportMarker)
		EndIf
		FAIndex += 1
	EndWhile	
EndEvent 

The Follower variable points to an array of reference aliases on a quest that you create which finds and fills aliases that match what you need to be true in a follower. Typically a specific faction value. The reason I added the array is so that you could transport more than one follower.

 

 

Link to comment
Share on other sites

So I did as Dragondude suggested and it worked perfectly. It looks like such an obvious solution, but it just never dawned on me to try making a new door. Stupid beginner mistakes eh? ;)

 

Big thanks to both of you for helping me out. I'll definitely take note of that script and see if I can learn a thing or two for the future though. Thanks again!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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