Jump to content

Teleport Spell Help


Recommended Posts

Hello, i made a teleport spell about 4-6 years ago which works fine, but has a bug, but first i will detail what the teleport spell does then say what the bug is, here is what the spell does

 

1. on Spell cast move a marker to player

2. then move player to a different marker

3. change a Global Variable to 1(to switch between enter and exit states)

4. when player casts the spell again they move to the marker from point 1

 

sounds simple, and it works very well, but the bug here might be what i am using but i'm not sure, when you save/autosave in the area after point 2, and close the game/CTD then load the save, and use the spell to leave it doesnt do anything at first, but when casted again it will do point 2, i am wondering if this is because i am using the static XMarker as the Ref for the markers, would changing these to Activators be more reliable?

Link to comment
Share on other sites

Why don't you create one spell for each teleportation point?

i don't like clogging up my spell book if i can help it, if its possible to do with one spell using a global variable that changes which direction it takes, then i am happy

Link to comment
Share on other sites

You could open a MessageBox when the spell is cast where the player chooses which location to teleport to.

i prefer to not use messagebox for the teleport, as it would slow the spell a little, just want stable markers that wont break after a CTD, as i think static objects reset their positions, but i want to know if i were to change them to activators if it will be more reliable, as i have stated above, the spell works fine it is just after a CTD, the marker that moves to the player resets itself and traps in the area

Link to comment
Share on other sites

I had a little time yesterday, so I made "To Testing Hall and Back" spell. Today after further testing it seems I can present the spell script here. Spell was tested against saving and restarting Oblivion and also against waitng for 72 hours, which is default for performing cell reset.

 

 

scn RomRTeleportScript
float pos
float angle

begin ScriptEffectStart
	if RomRAddTeleportSpell.marker_set == 0
		set angle to player.GetAngle Z
		if RomRTeleportMarkerRef.GetInSameCell player == 0
			set RomRAddTeleportSpell.marker_set to 1
			RomRTeleportMarkerRef.SetAngle Z angle
			RomRTeleportMarkerRef.MoveTo player
		else
			set pos to player.GetPos X
			RomRTeleportMarkerRef.SetPos X pos
			set pos to player.GetPos Y
			RomRTeleportMarkerRef.SetPos Y pos
			set pos to player.GetPos Z
			RomRTeleportMarkerRef.SetPos Z pos
			RomRTeleportMarkerRef.SetAngle Z angle
			set RomRAddTeleportSpell.marker_set to 1
		endif
	endif
	if RomRAddTeleportSpell.marker_set == 2
		set RomRAddTeleportSpell.marker_set to 0
		player.MoveTo RomRTeleportMarkerRef
	endif
end

begin ScriptEffectUpdate
	if RomRAddTeleportSpell.marker_set == 1		
		set RomRAddTeleportSpell.marker_set to 2
		player.MoveTo "244EB"
	endif
end

 

 

I hope it will help, even it's made for player only and overall is too simple.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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