Jump to content

In Dire Need Of A Script!


Recommended Posts

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

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

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 teleport

xmarkerref2 - the teleport target

Link to comment
Share on other sites

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 teleport

xmarkerref2 - 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

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 teleport

xmarkerref2 - 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 zzTeleportToRealmOfBliss

ref Xmarkerref

ref Xmarkerref2

short global variable

begin ScriptEffectStart

if global variable==0

Xmarkerref.moveto player

player.moveto xmarkerref2

set global variable to 1

endif

 

if global variable ==1

player.moveto Xmarkerref

set global variable to 0

endif

 

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 by ApocalypticPictures
Link to comment
Share on other sites

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 by fg109
Link to comment
Share on other sites

So...will I replace state with my global variable?

 

Would this be the working script?

 

scn zzTeleportRealmofBliss

ref Xmarkerref

ref xmarkerref2

short zzteleportref

begin ScriptEffectStart

if zzteleportref ==0

Xmarkerref.moveto player

player.moveto xmarkerref2

set zzteleportref to 1

endif

 

if zzteleportref ==1

player.moveto Xmarkerref

set zzteleportref to 0

endif

 

end

 

where zzteleportref is my global variable. Also will the rats be my zzteleportref?

Edited by ApocalypticPictures
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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