Map Levels and other question about Maps
m4u
16 Apr 2014, 16:03How do map levels work? I wrote names but it doesn't show on the map...
And how can I disable the frame map for the intro and then reactive it again? The set variable for this purpose doesn't work.
And when using maps, how can I move the player to a random room where the map has been created yet? It gives me an error of coordinates. Or is it possible that the whole map be created since the beggining?
And how can I disable the frame map for the intro and then reactive it again? The set variable for this purpose doesn't work.
And when using maps, how can I move the player to a random room where the map has been created yet? It gives me an error of coordinates. Or is it possible that the whole map be created since the beggining?
m4u
21 Apr 2014, 16:44Anybody?

jaynabonne
21 Apr 2014, 18:19From bottom to top:
I actually just answered this one recently. Check out this thread:
viewtopic.php?f=18&t=4280
To hide it:
To show it again:
I don't know what this means. Can you describe more what you have done so far? (That will give me a start to look at it.)
how can I move the player to a random room where the map has been created yet?
I actually just answered this one recently. Check out this thread:
viewtopic.php?f=18&t=4280
And how can I disable the frame map for the intro and then reactive it again?
To hide it:
JS.ShowGrid(0)
To show it again:
JS.ShowGrid(game.mapsize)
How do map levels work? I wrote names but it doesn't show on the map...
I don't know what this means. Can you describe more what you have done so far? (That will give me a start to look at it.)
m4u
21 Apr 2014, 19:45Thank you Jay! About the last question I just filled the map level option in a room:
But that name doesn't show on the map. My font is white with black background.
<attr name="grid_label">Garden</attr>
But that name doesn't show on the map. My font is white with black background.

jaynabonne
21 Apr 2014, 20:55There's a bug in the room draw code. You can work around it by adding the following function to your game file:
The code that calls JS.Grid_DrawLabel was passing "room.grid_z", which doesn't exist any more. I'll file a bug for this.
Edit: It turns out there already was a bug filed. I've updated it with my fix above.
<function name="Grid_DrawRoom" parameters="room, redraw, playerobject">
<![CDATA[
if (room.grid_render) {
if (redraw or not Grid_GetRoomBooleanForPlayer(playerobject, room, "grid_isdrawn")) {
if (room.parent <> null) {
Grid_DrawRoom (room.parent, redraw, playerobject)
}
JS.Grid_DrawBox(Grid_GetGridCoordinateForPlayer(game.pov, room, "x"), Grid_GetGridCoordinateForPlayer(game.pov, room, "y"), Grid_GetGridCoordinateForPlayer(game.pov, room, "z"), room.grid_width, room.grid_length, room.grid_border, room.grid_borderwidth, room.grid_fill, room.grid_bordersides)
if (LengthOf(room.grid_label) > 0) {
label_x = Grid_GetGridCoordinateForPlayer(game.pov, room, "x") + room.grid_width/2.0
label_y = (Grid_GetGridCoordinateForPlayer(game.pov, room, "y") + room.grid_length/2.0) - 0.5
// Grid_DrawLabel(x, y, z, text)
JS.Grid_DrawLabel(label_x, label_y, Grid_GetGridCoordinateForPlayer(game.pov, room, "z"), room.grid_label)
}
foreach (exit, AllExits()) {
if (exit.grid_render and exit.parent = room and exit.grid_length > 0) {
Grid_DrawLine (Grid_GetGridCoordinateForPlayer(game.pov, exit, "x"), Grid_GetGridCoordinateForPlayer(game.pov, exit, "y"), Grid_GetGridCoordinateForPlayer(game.pov, exit, "end_x"), Grid_GetGridCoordinateForPlayer(game.pov, exit, "end_y"), "black", 1)
}
}
Grid_SetRoomBooleanForPlayer(playerobject, room, "grid_isdrawn", true)
}
}
]]>
</function>
The code that calls JS.Grid_DrawLabel was passing "room.grid_z", which doesn't exist any more. I'll file a bug for this.
Edit: It turns out there already was a bug filed. I've updated it with my fix above.