Dialouge-Response initiated travel

Post » Sat Feb 19, 2011 7:01 am

Alright so in my mod I am trying to make a travel agent (like shipmasters or guildguides in morrowind) ... so you can like talk to someone to be transported to somewhere else.

I have rather little scripting experience so I tried getting an idea from some mod on the nexus. Their method uses the command, "Player.Moveto" from within the dialouge window to teleport the PC when he chooses a certain response (and deducts some cash as well). Goodbye is selected as well which I presume is supposed to exit the dialouge mode.

Anyways the problem I am having with this method is that whenever I travel in this way and then talk to any person for the first time ... the camera shakes around wildly.

EDIT: I just found that its a known bug: http://cs.elderscrolls.com/constwiki/index.php/Common_Bugs#MoveTo_Oddities


Can someone please tell me what I can do to solve this. A draft script would be appreciated.
User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Fri Feb 18, 2011 8:44 pm

I just read your post and I am also having a problem with teleporting from within the dialogue mode. This is dialogue with a NPC.

I have been using the "player.movetomarker" command and placing "X" markers where I wish the player teleported to. This seems to work very well EXCEPT when the player is on a horse. Then the player just remains in the same place unable to move for maybe 30 seconds and then the game resumes normally. Now what is odd is that the second time the player engages in the same dialogue with the NPC, he is teleported perfectly (with his mount). From testing I have noted that this works every second time without fail.

For your solution u might want to try the "movetomarker" command rather than "moveto". I really have no idea if there is a difference or not. I'm also new to scripting and know basically nothing. I hope someone else will read this and shed some light on our problems.
User avatar
steve brewin
 
Posts: 3411
Joined: Thu Jun 21, 2007 7:17 am

Post » Sat Feb 19, 2011 3:44 am

From the UESP wiki.
"Do not use MoveTo in a dialogue result script. Instead, set variables in an NPC or quest script and use those variables to determine where your script should move the player."

What that's saying is that instead of the result script containing the moveto command, you have the dialog result set a quest variable to the destination reference chosen, and then have the moveto command in the quest script.
E.g. in the dialog result
set .MoveRef to destinationname ; where he's goingset .MoveHim to 1 ; flag to indicate a move is pending

and then have
if MoveHim    player.moveto MoveRef    set MoveHim to 0 ; turn it back offendif

in the quest script for . It does nothing until the MoveHim flag is turned on, and then moves the player to wherever MoveRef points. There will be a small delay after the dialog ends before the quest script gets it turn to run and does the work and you can adjust this if needed with the fQuestDelayTime variable, but you may not need to bother.
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Fri Feb 18, 2011 8:15 pm

From the UESP wiki.
"Do not use MoveTo in a dialogue result script. Instead, set variables in an NPC or quest script and use those variables to determine where your script should move the player."

What that's saying is that instead of the result script containing the moveto command, you have the dialog result set a quest variable to the destination reference chosen, and then have the moveto command in the quest script.
E.g. in the dialog result
set .MoveRef to destinationname ; where he's goingset .MoveHim to 1 ; flag to indicate a move is pending

and then have
if MoveHim    player.moveto MoveRef    set MoveHim to 0 ; turn it back offendif

in the quest script for . It does nothing until the MoveHim flag is turned on, and then moves the player to wherever MoveRef points. There will be a small delay after the dialog ends before the quest script gets it turn to run and does the work and you can adjust this if needed with the fQuestDelayTime variable, but you may not need to bother.

User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Sat Feb 19, 2011 12:51 am

Thanks for the response. Unfortunately it behaves worse by using the separate quest script. I am obviously doing something wrong.

Here is what I have in the script area of my dialogue:

set tollunpaid.moveref to NonpayingTolls
set tollunpaid.movehim to 1

And here is the quest script it refers to:

scn TollUnpaidScript

short movehim
ref moveref

begin gamemode

if movehim
player.moveto moveref
set movehim to 0
endif
end

Sorry, but I have no idea of how to make the script go in the little box like u did yours.

Now what happens when the player encounters that script is that he is teleported to the proper location, but every few seconds he is re-teleported back there. If he does a fast travel subsequent to the teleportation, he will arrive where he wishes but then immediately returns to the place where the "TollUnpaidScript" teleported him.

But the reaction is much different if the player is on a horse... the screen flashes and he is not teleported anywhere.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Sat Feb 19, 2011 2:25 am

I am thinking maybe I should go about this in a different direction.

If I could find a way to force the player to dismount and then teleport him, the "movetomarker" command in the dialogue would work (since it works perfectly already for the unmounted player). The player could then regain his mount if he wished to by fast travelling normally to a Tamriel worldspace location.

So far I have not found a method of scripting a forced dismount upon the player. And I have searched several forums for several hours too.
User avatar
OTTO
 
Posts: 3367
Joined: Thu May 17, 2007 6:22 pm

Post » Fri Feb 18, 2011 6:12 pm

Ok so I figured out how to fix the teleporting repeat thing.
Apparently the "player.moveto" command also executes a return so that whatever is placed after it does not get executed.

scn TollUnpaidScriptshort movehimshort doonceref moverefbegin gamemode	if movehim		if doonce != 1			set doonce to 1			player.moveto moveref					elseif doonce == 1			set movehim to 0		endif		set doonce to 0	endifend


But now we are back to the exact same behaviour that occurred when the "movetomarker" command was in the dialogue script area.
User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm


Return to IV - Oblivion