Author Topic: [Fixed] Pause menu Dungeon Maps does not allow more than 8 floors  (Read 1269 times)

MetalZelda

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
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)
« Last Edit: March 22, 2016, 12:02:35 pm by MetalZelda »

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Pause menu Dungeon Maps does not allow more than 8 floors
« Reply #1 on: March 22, 2016, 09:20:18 am »
There might be bug in the script. What error exactly?

MetalZelda

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
Re: Pause menu Dungeon Maps does not allow more than 8 floors
« Reply #2 on: March 22, 2016, 09:33:27 am »
First error when starting the menu

Code: [Select]
Error: In on_started: [string "menu/pause_map.lua"]:89: attempt to compare number with nil
And then this error loops

Code: [Select]
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.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Pause menu Dungeon Maps does not allow more than 8 floors
« Reply #3 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.

MetalZelda

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
Re: Pause menu Dungeon Maps does not allow more than 8 floors
« Reply #4 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.

« Last Edit: March 22, 2016, 10:09:21 am by MetalZelda »

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Pause menu Dungeon Maps does not allow more than 8 floors
« Reply #5 on: March 22, 2016, 10:43:16 am »
Great, thanks.