How do exits move player.
TBear
06 Apr 2015, 21:34So when I go through an exit, without having the "Run a script" checkbox enabled, how does quest handle the movement?
I want to change some of the behaviour for the exits. But changing the moveObject method does not seem to work in this case, unless I have made the exit move the player through a script.
I would be immensely grateful for any help.
Thanks.
Edit: Ment "MoveObject"
I want to change some of the behaviour for the exits. But changing the moveObject method does not seem to work in this case, unless I have made the exit move the player through a script.
I would be immensely grateful for any help.
Thanks.
Edit: Ment "MoveObject"

XanMag
06 Apr 2015, 21:57What kind of behavior do you want when exiting exactly? And maybe I'm wrong here, but I'm not sure you can alter behavior of an exit without scripting it either as 'run a script' or as 'run a script when entering/exiting room.' Let me know if that helps at all and I'll do what I can. I'm sure HK or Jay will be along soon to help and I'll be obsolete though 


jaynabonne
06 Apr 2015, 22:08If you want to see what the default behavior is, do this:
1) In the bottom left corner of the desktop editor, click Filter. This will pop up a menu.
2) Select "Show Library Elements". This will show all the built-in verbs, commands, types, etc.
3) Find "go" under Commands.
You'll be able to see what the default command script does. You can also copy it into your game if you wish to modify it. When you type "n" or "go north" or something like that, it runs that command, with the appropriate exit from the current room selected as the "exit" parameter.
In case you'd rather just see the code (as opposed to the steps above), it's here (as of Quest 5.5):
You can see that in the case where it moves the player, it does it by simply assigning the "exit.to" parameter as the player's parent.
1) In the bottom left corner of the desktop editor, click Filter. This will pop up a menu.
2) Select "Show Library Elements". This will show all the built-in verbs, commands, types, etc.
3) Find "go" under Commands.
You'll be able to see what the default command script does. You can also copy it into your game if you wish to modify it. When you type "n" or "go north" or something like that, it runs that command, with the appropriate exit from the current room selected as the "exit" parameter.
In case you'd rather just see the code (as opposed to the steps above), it's here (as of Quest 5.5):
<command name="go">
<pattern type="string"><![CDATA[^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]></pattern>
<unresolved>You can't go there.</unresolved>
<script>
if (exit.visible) {
if (exit.locked) {
msg (exit.lockmessage)
}
else if (exit.runscript) {
if (HasScript(exit, "script")) {
do (exit, "script")
}
}
else if (exit.lookonly) {
msg ("You can't go there.")
}
else {
game.pov.parent = exit.to
}
}
else {
msg ("You can't go there.")
}
</script>
</command>
You can see that in the case where it moves the player, it does it by simply assigning the "exit.to" parameter as the player's parent.
TBear
07 Apr 2015, 05:26Thanks, guys. This is helpful. I guess I was simply looking at the wrong place. I should probably look at the respective command next time. 

xordevoreaux
07 Apr 2015, 14:48[snip] figured out what I needed.
xordevoreaux
07 Apr 2015, 14:57[snip]