Mapping 101

Do we still need to map up and down from rooms?


I am just beginning to use maps in games.

While making the first few games, I added the code to map up and down from rooms as I created the exits.

...but I just started making a new game with the map enabled, and I forgot to add the bits to map up and down...

The map still seems to work correctly.

Maybe Quest has been updated to handle this itself since the guide I'm following was written?


From Showing a Map:

Vertical movement

You can add code to allow an exit to move the player between levels when travelling along the compass directions. The trick is to define one room relative to the other. Say we have two rooms, lower and upper. In upper, this code should go in the Enter script:

Grid_SetGridCoordinateForPlayer (game.pov, upper, "z", Grid_GetGridCoordinateForPlayer(game.pov, lower, "z")+1)

We use Grid_GetGridCoordinateForPlayer(game.pov, lower, "z") to get the current z value, and add one to it.

You also need to make sure it works the other way, so this goes in the Enter script of lower:

Grid_SetGridCoordinateForPlayer (game.pov, upper, "z", Grid_GetGridCoordinateForPlayer(game.pov, lower, "z")+1)

Wait...

Is this to change the map's level when a direction other than up or down moves you up or down? (Like going EAST, up the ramp?)


Yes, that "Vertical Movement" bit is for traveling east and up simultaneously, for example. If you only have 1 level, then you shouldn't need vertical mapping.


Ah.

That makes sense.


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

Support

Forums