Warping between rooms?
dellobenedetto
26 Jan 2016, 22:11I'm developing a game in Quest, and something I want to do is have the player talk to someone, warp to another room because of that. Unfortunately, my attempts to do it through scripts have yielded no results, just the player remaining in the room with the someone.
Any tips on how to do this?
Any tips on how to do this?
lightwriter
26 Jan 2016, 22:15Use the MoveObject script and select the player object as your object and select the room to move the player to.
dellobenedetto
26 Jan 2016, 22:19lightwriter wrote:Use the MoveObject script and select the player object as your object and select the room to move the player to.
Where should I put the MoveObject script - in the room that contains the warper, or in the warper itself?
HegemonKhan
26 Jan 2016, 22:20this is probably a bit too advanced for you if you're just starting out with quest and~or especially if you know nothing of coding, but if you're ready or you want to, you can take a look here:
viewtopic.php?f=18&t=5138 (HK's 'explore' and 'travel' code)
viewtopic.php?f=18&t=5137 (HK's Lists and Dictionaries guide)
-------------
as for jsut simply moving to another room, there's two scripts that do it:
MoveObject (moving_object, destination_object)
(you can find this in the GUI~Editor's scripts, I think it's under the 'object' script category, but am not sure)
or
moving_object.parent = destination_object
(this is done in the GUI~Editor through the 'set a variable or attribute' Script -> [expression] or whatever specific [option] it is)
---------
you're going to have to understand basic code-if structure, nesting scripts, and etc, and for the more advanced "goto~warping" stuff, Lists and Dictionaries.
viewtopic.php?f=18&t=5138 (HK's 'explore' and 'travel' code)
viewtopic.php?f=18&t=5137 (HK's Lists and Dictionaries guide)
-------------
as for jsut simply moving to another room, there's two scripts that do it:
MoveObject (moving_object, destination_object)
(you can find this in the GUI~Editor's scripts, I think it's under the 'object' script category, but am not sure)
or
moving_object.parent = destination_object
(this is done in the GUI~Editor through the 'set a variable or attribute' Script -> [expression] or whatever specific [option] it is)
---------
you're going to have to understand basic code-if structure, nesting scripts, and etc, and for the more advanced "goto~warping" stuff, Lists and Dictionaries.
dellobenedetto
26 Jan 2016, 22:22Ah, thanks for helping!
HegemonKhan
26 Jan 2016, 22:32I have school classes, but if no one else has helped you and when I got the time, I can try to help you through with what you want to do more directly and specifically.

OurJud
26 Jan 2016, 22:38Just in case you're still struggling, and to answer a couple of your previous questions...
You would use the 'move' script in the room where you want to move the player from.
So, assuming you've got the conversation part of this already covered, select that room and:
• Change description to 'Run script' from the drop-down menu
• Click the 'Add new script' button
• Choose 'Move' from the button across the top of the window that pops up.
• Use the drop-down menus so that the move script reads: Move object, object, player, to, object [pick the room from the list that you want to move the player to].
The bits in red are the one you will need to choose from the drop-down menu.
You would use the 'move' script in the room where you want to move the player from.
So, assuming you've got the conversation part of this already covered, select that room and:
• Change description to 'Run script' from the drop-down menu
• Click the 'Add new script' button
• Choose 'Move' from the button across the top of the window that pops up.
• Use the drop-down menus so that the move script reads: Move object, object, player, to, object [pick the room from the list that you want to move the player to].
The bits in red are the one you will need to choose from the drop-down menu.

XanMag
26 Jan 2016, 22:40Here is the code for doing this.
Here is the .aslx file if you want to see it in the GUI.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Teleporter">
<gameid>c5337f9c-7928-453c-91d0-1141d814a3f9</gameid>
<version>1.0</version>
<firstpublished>2016</firstpublished>
</game>
<object name="teleporter room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="teleporter">
<inherit name="editor_object" />
<look>It's a teleporter. 'Use teleporter' to warp to the other room!</look>
<feature_usegive />
<use type="script"><![CDATA[
msg ("You get a strange feeling and before you know it you have been warped to the...<br/><br/>the other room!")
MoveObject (player, other room)
]]></use>
</object>
<exit alias="south" to="other room">
<inherit name="southdirection" />
</exit>
</object>
<object name="other room">
<inherit name="editor_room" />
<description>This room looks like the bridge from Spaceballs.</description>
<exit alias="north" to="teleporter room">
<inherit name="northdirection" />
</exit>
</object>
</asl>
Here is the .aslx file if you want to see it in the GUI.