Execute script after dialogue

Post » Tue Mar 15, 2011 12:41 am

Hey

I'm trying to make a script where the player is teleported somewhere instantly after the dialogue ends, similair to when you are arrested (but I can't use the GoToJail function)

The result script for the dialogue is

SetStage questnamehere 10

And the script attatched to the quest is

scn scriptnamehereshort doonceBegin GameModeif GetStageDone questnamehere 10 == 1 && doonce == 0       Player.MoveToMarker markernamehere       set doonce to 1endifEnd


The problem I'm having is that the script is executed before the dialogue is finished, so the seond you talk to the guy you're teleported to the new place, and the dialogue kinda carries on, but he's not there. Is there any workaround? I tried IsTimeRunning to delay the script during the dialogue but this didn't work (strangely, seen as time isn't running during dialogue)
User avatar
kristy dunn
 
Posts: 3410
Joined: Thu Mar 01, 2007 2:08 am

Post » Mon Mar 14, 2011 11:58 pm

Hey

I'm trying to make a script where the player is teleported somewhere instantly after the dialogue ends, similair to when you are arrested (but I can't use the GoToJail function)

The result script for the dialogue is

SetStage questnamehere 10

And the script attatched to the quest is

scn scriptnamehereshort doonceBegin GameModeif GetStageDone questnamehere 10 == 1 && doonce == 0       Player.MoveToMarker markernamehere       set doonce to 1endifEnd


The problem I'm having is that the script is executed before the dialogue is finished, so the seond you talk to the guy you're teleported to the new place, and the dialogue kinda carries on, but he's not there. Is there any workaround? I tried IsTimeRunning to delay the script during the dialogue but this didn't work (strangely, seen as time isn't running during dialogue)

Perhaps if you used a timer?
User avatar
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am

Post » Tue Mar 15, 2011 3:00 am

Perhaps if you used a timer?


How could I make it accurate? It's not VA'd so not everybody would finish reading the dialog at the same time
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Mon Mar 14, 2011 6:40 pm

I'm assuming this is NPC Dialogue-menu Dialogue (i.e., the Player Talking to an NPC) rather than an NPC talking to someone else, right?

If so, just put a Variable in the Quest Script, like "DoTeleport", and then give the Quest Script a low delay, maybe 0.5 or 1, depending how quick you want it. Once the NPC talks to the Player, set this Variable to 1, since you'll be in Dialogue mode, the Script shouldn't run.

This sounds very similar to what you're doing already (just with a Variable instead of a QuestStage), so why it's not working is bizzare... It always work for me.

Another work around would be to use MenuMode to set the Variable:
Begin MenuMode If ( GetQuestStage [QuestID] >= 10 ) && ( GetQuestStage <= 20 ; Or next stage )   Set DoTeleport to 1EndIfEndBegin GameMode If ( DoTeleport == 1 )   Set DoTeleport to 0   Player.MoveTo [MarkerID]EndIfEnd

This way, the Variable will be flagged during Dialogue, but the GameMode Block won't run until the end.
User avatar
Darlene DIllow
 
Posts: 3403
Joined: Fri Oct 26, 2007 5:34 am

Post » Tue Mar 15, 2011 1:33 am

That worked great, thanks :)
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am


Return to IV - Oblivion