Jump to content

Walk through portal


Spudscorner

Recommended Posts

Morning all,

I am working on a mod and I was wondering if there is a way to have a portal teleport you to another place as soon as you walk through it. I don't want to have to activate it using the space bar, I just want to walk through.

 

Is this possible and how would I accomplish this if it is?

 

Cheers

Spudscorner

Link to comment
Share on other sites

Go to the Activators section of the objects list and find a trigger box (TrigZone). Create a new trigger box by changing the original trigger box's Editor ID. Add this script to it:

 

scn YourScript

short triggered
float timer

begin onTrigger player

if triggered == 0
player.moveto YourCell X,Y,Z
	set triggered to 1
	set timer to 2
endif

end

begin gameMode

if triggered == 1 && timer <= 0
	set triggered to 0
endif

if timer >= 0
	set timer to timer - getSecondsPassed
endif

end

You only have to give the cell ID (YourCell) when the player is teleported to an interior cell. For an exterior cell you have to use only the XYZ coordinates. To find the correct X,Y,Z coordinates, place a small item at the spot you want to make the player appear. You can delete it when the script is done. Double click on it and copy the XYZ coordinate values, and put them in the script. Then you have to place the trigger box on this portal, so the player walks through it when he walks through the portal.

 

(The portal will only work for the player)

Link to comment
Share on other sites

Might wana remove that extra "end" there in the middle of the script , but otherwise this is preaty good response http://members.gamingsource.net/images/profile/kudos.gif :D

 

That "end" closes the OnTrigger block so it needs to stay.

 

Mez

Link to comment
Share on other sites

Might wana remove that extra "end" there in the middle of the script , but otherwise this is preaty good response http://members.gamingsource.net/images/profile/kudos.gif :D

 

That "end" closes the OnTrigger block so it needs to stay.

 

Mez

 

 

Yep.. my bad :blush:

Link to comment
Share on other sites

lol how do you guys learn this things. i like was trying this kinda things scripting, or programing we said but in swedish so programering. Our computer teacher at school learned himself scripting without internet so he haved to learn this things with only simple book manuals :P
Link to comment
Share on other sites

lol how do you guys learn this things. i like was trying this kinda things scripting, or programing we said but in swedish so programering. Our computer teacher at school learned himself scripting without internet so he haved to learn this things with only simple book manuals :P

It's not that hard. Especially when you can copy some stuff from Bethesda's scripts. I never write the trigger scripts myself. I take a base, throw away what I don't need and add setstage, moveto, additem, or whatever command. Still, even by copying you learn a lot. I'm sure I can write the trigger script, but copying is much faster. :D

Link to comment
Share on other sites

Thanks for the script but I am having one problem.

 

when ever I try to save the script the CS gives me an error message that states

 

" Invalid Object reference'zzStargate2' for parameter ObjectReferenceID "

 

player.moveto zzStargate2 2072,1711,6110 is the command I am using

 

Please help this is driving me nuts. I have tried the cell id, the marker id and every other id I can think of but the script will not save. What am I doing wrong?

 

Spudscorner

Link to comment
Share on other sites

Thanks for the script but I am having one problem.

 

when ever I try to save the script the CS gives me an error message that states

 

" Invalid Object reference'zzStargate2' for parameter ObjectReferenceID "

 

player.moveto zzStargate2 2072,1711,6110 is the command I am using

 

Please help this is driving me nuts. I have tried the cell id, the marker id and every other id I can think of but the script will not save. What am I doing wrong?

 

Spudscorner

Are you using player.moveto <marker> or player.movetomarker <marker>? Also, are both within the same mod? At any rate, when supplying an object, and not a cell, you don't need to include positioning.

 

You may also want to considder just having the trigger box activate the portal, and then not having to worry about having to specify a specific location within the script (this way the portal can also be used like a standard doorway). But this can become an issue if you want a single gate to link to multiple destinations based on specific parameters.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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