Trouble with Teleport

Post » Wed Jul 20, 2011 12:03 pm

In my quest I want the player to be teleported to an interior location after talking to an NPC. The teleport itself works actually... but it works a little too much! When the player has been teleported to the location, it continues to teleport again and again and again. Here is first the dialogue result script and then the quest script:
- - - - - - - - - - - - - - - - - - - -
setstage aaaTeleportQuest 10
player.additem InteriorKey 1
player.setfactionrank TQFaction 0
set aaaTeleportQuest.Move to 1
- - - - - - - - - - - - - - - - - - - - -
scn aaaTeleportQuestScript

short Move

Begin GameMode
If ( Move == 1 )
player.movetomarker InteriorTeleportMarker
set Move to 0
endif

End
- - - - - - - - - - - - - - - - - - - -
What's wrong? I just can't figure it out! Please help!
User avatar
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm

Post » Wed Jul 20, 2011 10:10 am

In my quest I want the player to be teleported to an interior location after talking to an NPC. The teleport itself works actually... but it works a little too much! When the player has been teleported to the location, it continues to teleport again and again and again. Here is first the dialogue result script and then the quest script:
- - - - - - - - - - - - - - - - - - - -
setstage aaaTeleportQuest 10player.additem InteriorKey 1player.setfactionrank TQFaction 0set aaaTeleportQuest.Move to 1- - - - - - - - - - - - - - - - - - - - -scn aaaTeleportQuestScriptshort MoveBegin GameMode If ( Move == 1 )  player.movetomarker InteriorTeleportMarker  set Move to 0 endifEnd

- - - - - - - - - - - - - - - - - - - -
What's wrong? I just can't figure it out! Please help!

You have Move set as a short, but you never actually set it to 1 before moving the Player in the GameMode block. Try reversing the variables assigned to Move, like this:

Spoiler
setstage aaaTeleportQuest 10player.additem InteriorKey 1player.setfactionrank TQFaction 0set aaaTeleportQuest.Move to 1- - - - - - - - - - - - - - - - - - - - -scn aaaTeleportQuestScriptshort MoveBegin GameMode If ( Move == 0 )  player.movetomarker InteriorTeleportMarker  set Move to 1 endifEnd


Also, what is aaaTeleportQuest.Move? Are you trying to set Move to 1 prior to the actual move? If so, eliminate that part and see if the reversed variables work.

Edit: Also, is InteriorTeleportMarker an XMarker, XMarkerHeading or something else?
User avatar
Megan Stabler
 
Posts: 3420
Joined: Mon Sep 18, 2006 2:03 pm


Return to IV - Oblivion