Solarus-Games English Forum

Solarus => Bugs & Feature requests => Topic started by: MetalZelda on March 22, 2016, 09:12:41 AM

Title: [Fixed] Pause menu Dungeon Maps does not allow more than 8 floors
Post by: MetalZelda on March 22, 2016, 09:12:41 AM
Hi.

So I was using MoS map system for the pause menu.
The problem is, I am making a dungeon that have more then 8 floors, the maps are done, but if I put in dungeons.lua

Code (lua) Select
  [7] = {
    floor_width = 2256,
    floor_height = 2256,
    lowest_floor = -4, -- can't go lower
    highest_floor = 3, -- can't go higher
    maps = { final_path .. "Dungeon/ETemple/Floor-7" }, -- final_path = value to check HMode, reversed map wise.
    boss = {
      floor = -4,
      x = 1035, -- todo
      y = 560, -- todo
      savegame_variable = "b1046",
    },
  },


If lowest is inferior to -4 and highest is superior to 3, the map won't display, I got an error in highest_floor_display.
Tested with Mystery of Solarus, same result, the floor image allows 33 floors (34 if you include the "unknown" stairs)
Title: Re: Pause menu Dungeon Maps does not allow more than 8 floors
Post by: Christopho on March 22, 2016, 09:20:18 AM
There might be bug in the script. What error exactly?
Title: Re: Pause menu Dungeon Maps does not allow more than 8 floors
Post by: MetalZelda on March 22, 2016, 09:33:27 AM
First error when starting the menu

Error: In on_started: [string "menu/pause_map.lua"]:89: attempt to compare number with nil

And then this error loops

Error: In on_draw: [string "menu/pause_map.lua"] 290: attempt to perform arithmetic on field 'highest_floor_displayed' (a nil value)

Again, it only happen if the total floor number is > 8, if lower then it works.
Title: Re: Pause menu Dungeon Maps does not allow more than 8 floors
Post by: Christopho on March 22, 2016, 09:43:49 AM
Ok, I think the bug is that we should replace self.floor by self.hero_floor at lines 89 and 91. Please tell me if it works and then I will fix it in my games too.
Title: Re: Pause menu Dungeon Maps does not allow more than 8 floors
Post by: MetalZelda on March 22, 2016, 10:02:53 AM
Yes, your solution fixed the issue  ;)

Edit : Wrightmat's pause menu had the same bug as well, fixed too.

(http://i.imgur.com/rXYwc7w.png)
Title: Re: Pause menu Dungeon Maps does not allow more than 8 floors
Post by: Christopho on March 22, 2016, 10:43:16 AM
Great, thanks.