Setting Room Layer (Height)

Watcher55
Hi, I've been playing with Quest and it is impressive, but I've hit a mapping snag.
My game has staircases etc which go both vertically and horizontally (as staircases do). As far as I can tell, if you have multiple exits (e.g. both west and down for staircase leading west and down), Quest takes the bottom one of the list of exits and if it is "down" puts the new room directly under the current one but at the same X/Y position, but if it is "west" puts the new room to the west but at the same height. This makes it difficult to make sensible maps when a corridor is winding around the place and going over and under. There are ways but they are clunky (e.g. the bottom exit is "west" which takes you to a fake room to the west, which after entry moves the player immediately down to a room of the same dimensions under it).
What would make this easier, at least for me, is if there was a way to program in the layer (Z coordinate) for the room. Thus, in the example above the bottom exit could be "west" and on entry to that room Quest could set the Z coordinate to one less than that of the room we came from.
Does anyone know if this is possible?

jaynabonne
I'm not sure if this is exactly what you want, but it's a try. :)

Note that I'm using Quest 5.6. The grid code in Quest seems to be continually evolving, so I'm not sure if this will work with 5.5 or earlier.

Here is the full test game.

<!--Saved by Quest 5.6.5510.29036-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="downmaptest">
<gameid>afca1937-7ae4-4bcf-af7e-73c3ba8ff12e</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<gridmap />
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="north" to="nroom">
<inherit name="northdirection" />
</exit>
<exit alias="south" to="sroom">
<inherit name="southdirection" />
</exit>
<exit alias="east" to="eroom">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="wroom">
<inherit name="westdirection" />
</exit>
</object>
<object name="nroom">
<inherit name="editor_room" />
<exit alias="south" to="room">
<inherit name="southdirection" />
</exit>
</object>
<object name="sroom">
<inherit name="editor_room" />
<exit alias="north" to="room">
<inherit name="northdirection" />
</exit>
</object>
<object name="wroom">
<inherit name="editor_room" />
<enter type="script">
Grid_SetGridCoordinateForPlayer (game.pov, dwroom, "z", Grid_GetGridCoordinateForPlayer(game.pov, wroom, "z")+1)
</enter>
<exit alias="east" to="room">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="dwroom">
<inherit name="westdirection" />
</exit>
</object>
<object name="eroom">
<inherit name="editor_room" />
<exit alias="west" to="room">
<inherit name="westdirection" />
</exit>
</object>
<object name="dnroom">
<inherit name="editor_room" />
<exit alias="south" to="dwroom">
<inherit name="southdirection" />
</exit>
</object>
<object name="dsroom">
<inherit name="editor_room" />
<exit alias="north" to="dwroom">
<inherit name="northdirection" />
</exit>
</object>
<object name="dwroom">
<inherit name="editor_room" />
<enter type="script">
Grid_SetGridCoordinateForPlayer (game.pov, wroom, "z", Grid_GetGridCoordinateForPlayer(game.pov, dwroom, "z")-1)
</enter>
<exit alias="east" to="wroom">
<inherit name="eastdirection" />
</exit>
<exit alias="north" to="dnroom">
<inherit name="northdirection" />
</exit>
<exit alias="south" to="dsroom">
<inherit name="southdirection" />
</exit>
</object>
</asl>


It's largely rooms I put in to see the map. It has a main room with four exits off in the normal cardinal directions. The room to the west has another room to the west, which is supposed to be a level down.

Each of the two special rooms (the west room ("wroom") and the down west room ("dwroom")) have "enter" scripts which fix up the levels of the rooms they connect to. It turns out that every time you enter a room, Quest will fix up all the rooms it connects to, so you have to continually update the z coordinates on entry.

Here is a sample "enter" script:

    <enter type="script">
Grid_SetGridCoordinateForPlayer (game.pov, wroom, "z", Grid_GetGridCoordinateForPlayer(game.pov, dwroom, "z")-1)
</enter>

What it does is to simply set the grid "z" coordinate to the one "down" from the current room.

Hope that helps!

HegemonKhan
aside from Jay's help above, at least with older versions of quest with the map~grid (as Jay says: it is evolving), here's some quick general commentary about quest's map~grid usage:

it was only 2D, no vertical layers~levels of mapping~grid'ing.

what people would do is when they would go to a different vertical level~layer, is to clear the map~grid (as it was for the previous vertical layer~level), and thus have it draw a new grid~map for your new vertical layer~level of horizontal mapping~grid'ing.

Jay's done some really fancy map~grid stuff (3d map~grid auto-random-generation and the like), so he's a good resource to be getting help from, hehe.

jaynabonne
Just an note: The multi-level grid support has been in there since at least 5.5. (I remember seeing it there.) By evolving, I mostly meant the internal code functions keep changing name, which makes it a bit dodgy sometimes calling them unless you know which version you're dealing with.

Some of the grid stuff I did in 5.4 didn't work untouched in 5.5, as new parameters had been added to functions, etc. :(

Watcher55
Ah, interesting, thanks, I reckon that will do it. The Quest documentation (at least, under Functions) doesn't appear to have Grid_GetGridCoordinateForPlayer (or Grid_SetGridCoordinateForPlayer) so thanks for the inside tip :-)

HegemonKhan
it might (probably is) an internal code command, which you can see and change SAFELY (due to the GUI~Editor's FORCED~REQUIRED 'copy' button):

in the GUI~Editor: left side's 'tree of stuff' (or jsut the lower left corner of the window~screen) -> Filter -> Show Library Elements -> this is a toggle to show~hide the underlying code commands, which will now appear (if toggled on of course) as light grey text up in your left side's 'tree of stuff'

or, if you're a good programmer and know what you're doing, you can write~change the underlying code directly (but this is UNsafe ~ if you mess it up and can't fix it, you'll have to DL quest again):

just go into (open up) the actual quest folders+files (the 'core' files) with a text software (notepad, wordpad, notepad++, apple: text editor, etc), and change the code.

jaynabonne
You can also go half-way in between - load up the files with a text editor to see how they work and see what's available to use, but don't change them. :) At least, that's what I do.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums