Timed-Teleport Script Problem

Post » Sun Sep 18, 2011 10:46 pm

Maybe im just too tired and cant see the obvious fix but basically for POA (see sig) here's the situation and the script thats not doing what it should:

[ most of the information is literal so the quest plot isnt spoiled :D ]

1. You complete a rescue mission. The captive thanks you, journals update and he offers to teleport you out of there using his mind/willpower/spell.
2. To do this, the final dialogue entry has a Journal updater, Startscript function (which should start the script posted below) and a Goodbye.
3. The script is then meant to wait 5 seconds (while he gets ready) before teleporting you to the cell and coordinates.

However upon testing it.. nothing happened. I clicked goodbye and nothing happened.
I'll admit i have little experience working with timers in scripts, usually because i can normally work around them and to be honest i probably dont even need the delay (as it could just send you off immediately) but i thought this might be a good time to learn.

Here's the script. Dont worry about the coordinates which ive censored just to maintain complete non-spoiler-ness :D

Begin alx_o_tharys_teleport_SCRPTFloat timerSet timer to ( timer + GetSecondsPassed )If ( timer > 5 )	Player->Position, [censored]	Journal alx_o_JE6 70	"alx_o_captive_IN"->disableendifStopScript alx_o_tharys_teleport_SCRPTEnd


- i suspect that i should also perhaps be using the PositionCell function, instead of Position.. my head says there shouldnt be a problem, but i am tp-ing to an external cell so maybe someone in the know can comment on this.
- im also not sure about how timers work when a menu is open (like the dialogue screen). Will the timer wait til the menu is closed? Or will it start even before i press Goodbye? If thats the case i suppose i should put in a check for that so it waits.... hmm

Cheers

Obviously if you feel like rewriting the script to demonstrate what you are talking about that would probably be the most benefit
User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm

Return to III - Morrowind