Spudscorner Posted May 31, 2007 Share Posted May 31, 2007 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? CheersSpudscorner Link to comment Share on other sites More sharing options...
Povuholo Posted May 31, 2007 Share Posted May 31, 2007 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 endYou 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 More sharing options...
Spudscorner Posted May 31, 2007 Author Share Posted May 31, 2007 Wow thank you I really appreciate it. Next time do you think you could be quicker, I had to wait at a full minute before I got an answer. :P CheersSpudscorner Link to comment Share on other sites More sharing options...
Hsandman_1 Posted May 31, 2007 Share Posted May 31, 2007 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 Link to comment Share on other sites More sharing options...
mezlo Posted May 31, 2007 Share Posted May 31, 2007 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 More sharing options...
Hsandman_1 Posted May 31, 2007 Share Posted May 31, 2007 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 More sharing options...
BehindYouSucker Posted May 31, 2007 Share Posted May 31, 2007 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 More sharing options...
Povuholo Posted May 31, 2007 Share Posted May 31, 2007 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 :PIt'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 More sharing options...
Spudscorner Posted May 31, 2007 Author Share Posted May 31, 2007 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 More sharing options...
Vagrant0 Posted May 31, 2007 Share Posted May 31, 2007 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? SpudscornerAre 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.