ApocalypticPictures Posted April 30, 2011 Share Posted April 30, 2011 Hi! I'm new on this forum, but not new to modding. I am ok at scripting, and I can make small scripts..like make items equip on you when you equip a ring and take them off when you unequip the ring.(In the mod!) What I need is a script that will teleport me to my EXTERIOR WORLD SPACE that I used to make a small "home" on a serious of small connected islands. The script will also need to teleport you back to the location you were before teleporting(I know this is possible, I have seen it done in a video.) This script will be added to a spell that will be able to be purchased. If anyone will be generous and take time to make me this script it would be great! You will be given credit! The world spaces ID is.... zzRealmofBliss Link to comment Share on other sites More sharing options...
fg109 Posted May 1, 2011 Share Posted May 1, 2011 There are plenty of mark and recall mods available, why don't you use one of those? Link to comment Share on other sites More sharing options...
ApocalypticPictures Posted May 1, 2011 Author Share Posted May 1, 2011 Do you mean like the ones in midas magic? Because you would be buying a spell to teleport you there in my mod. In those mods you have to set the location after you have already been there. IE: You reach the destination then set it for teleportation, while what I want to do is just have you teleport there and back, kinda like what happens in "The Nether" mod. Link to comment Share on other sites More sharing options...
alex2avs Posted May 1, 2011 Share Posted May 1, 2011 scn spell ref Xmarkerref ref xmarkerref2 short state begin ScriptEffectStart if state==0 Xmarkerref.moveto player player.moveto xmarkerref2 set state to 1 endif if state ==1 player.moveto Xmarkerref setstate to 0 endif end this should do.Xmarkerref - the marker that will be placed in the location before the teleportxmarkerref2 - the teleport target Link to comment Share on other sites More sharing options...
fg109 Posted May 1, 2011 Share Posted May 1, 2011 scn spell ref Xmarkerref ref xmarkerref2 short state begin ScriptEffectStart if state==0 Xmarkerref.moveto player player.moveto xmarkerref2 set state to 1 endif if state ==1 player.moveto Xmarkerref setstate to 0 endif end this should do.Xmarkerref - the marker that will be placed in the location before the teleportxmarkerref2 - the teleport target That's good, except that variables in spell scripts only stay in memory while the spell is active. So the "state" variable will always be 0 at the time you cast the spell. You should make it a global variable instead. And instead of using an X marker for Xmarkerref, it's better to use a disabled dead rat with the quest item property checked. This is because moving X markers around isn't reliable. Link to comment Share on other sites More sharing options...
ApocalypticPictures Posted May 1, 2011 Author Share Posted May 1, 2011 (edited) scn spell ref Xmarkerref ref xmarkerref2 short state begin ScriptEffectStart if state==0 Xmarkerref.moveto player player.moveto xmarkerref2 set state to 1 endif if state ==1 player.moveto Xmarkerref setstate to 0 endif end this should do.Xmarkerref - the marker that will be placed in the location before the teleportxmarkerref2 - the teleport target That's good, except that variables in spell scripts only stay in memory while the spell is active. So the "state" variable will always be 0 at the time you cast the spell. You should make it a global variable instead. And instead of using an X marker for Xmarkerref, it's better to use a disabled dead rat with the quest item property checked. This is because moving X markers around isn't reliable. Alright...so I should make a dead rat checked as quest item for the Xmarkerref? Also for the global variable I replace the "state" with "global variable"? scn zzTeleportToRealmOfBlissref Xmarkerrefref Xmarkerref2short global variablebegin ScriptEffectStart if global variable==0Xmarkerref.moveto player player.moveto xmarkerref2set global variable to 1endif if global variable ==1player.moveto Xmarkerrefset global variable to 0endif end ok...would that be right? Again I am kinda bad with scripts.... But again your help is really really appreciated! Also...will the rats be visible? Edited May 1, 2011 by ApocalypticPictures Link to comment Share on other sites More sharing options...
fg109 Posted May 1, 2011 Share Posted May 1, 2011 (edited) A global variable is a persistent variable which can be accessed by and is not local to any script. You create a global variable by clicking "Gameplay" at the top of the CS, and choosing "Globals..." To use it in your script, just use the name of the global variable. And the rats won't be visible as long as you set them to as disabled. Edited May 1, 2011 by fg109 Link to comment Share on other sites More sharing options...
ApocalypticPictures Posted May 1, 2011 Author Share Posted May 1, 2011 (edited) So...will I replace state with my global variable? Would this be the working script? scn zzTeleportRealmofBlissref Xmarkerrefref xmarkerref2short zzteleportrefbegin ScriptEffectStart if zzteleportref ==0Xmarkerref.moveto player player.moveto xmarkerref2set zzteleportref to 1endif if zzteleportref ==1player.moveto Xmarkerrefset zzteleportref to 0endif end where zzteleportref is my global variable. Also will the rats be my zzteleportref? Edited May 1, 2011 by ApocalypticPictures Link to comment Share on other sites More sharing options...
fg109 Posted May 1, 2011 Share Posted May 1, 2011 Yes, that would be the script except you do not need the line "short zzteleportref"; your global variable is already defined outside of the script. And no, the rats are not your zzteleportref. You just need to use a rat for Xmarkerref. You can also use it for Xmarkerref2 if you want, although that's not necessary. Link to comment Share on other sites More sharing options...
ApocalypticPictures Posted May 2, 2011 Author Share Posted May 2, 2011 Ok one more quick question... Do I need to name the rat's ID Xmarkerref? or do I need to set a ref to it? If so how?(I'm using the dead rat from Actors-Creatures) Link to comment Share on other sites More sharing options...
Recommended Posts