Page 1 of 1

Help: How to correctly add a new dungeon entrance to the Maj’Eyal overworld (my hook does not fire)

Posted: Wed Nov 26, 2025 3:34 pm
by WIZARDING_WIZARD
Hi everyone,

I’m working on an addon that adds a new dungeon to the Maj’Eyal overworld.
I cannot get the overworld entrance to appear, I cannot figure out why my placement hook never runs or why it does not work
I want to place a volcano entrance on the West overworld at specific coordinates. The addon loads with no errors. All I want is to place a visible volcano icon on the Maj’Eyal overworld at (62,40) that loads my custom zone:
Is there anything wrong with my hook structure
Any help or examples of best practice for placing new overworld dungeons would be greatly appreciated!

Here is my current hooks/load.lua:



local class = require "engine.class"
local Map = require "engine.Map"
local Grid = require "mod.class.Grid"
local colors = require "engine.colors"

class:bindHook("Game:loaded", function(self, data)
game:onLevelLoad("wilderness", function(zone, level)
local map = level.map
if not map then return end

if level.ashen_lock_added then return end
level.ashen_lock_added = true

local x, y = 62, 40

map:addSpot{
x = x, y = y,
type = "zone-pop",
subtype = "ashen-lock",
change_zone = "ashen-lock",
change_level = 1,
}

local caldera = Grid.new{
name = "Ashen Caldera",
display = "&",
color = colors.LIGHT_RED,
image = "terrain/lava/volcano_01.png",
add_mos = { { image = "terrain/lava/volcano_02.png" } },
show_tooltip = true,
notice = true,
change_zone = "ashen-lock",
change_level = 1,
}

map(x, y, Map.TERRAIN, caldera)
end)
end)

Re: Help: How to correctly add a new dungeon entrance to the Maj’Eyal overworld (my hook does not fire)

Posted: Fri Nov 28, 2025 12:29 am
by Zizzo
Well, I can tell you why your code doesn't work: there's no "Game:loaded" hook. :wink: You're probably aiming for the "ToME:load" hook, but I don't remember whether the Game:​onLevelLoad() infrastructure has been set up by that point.

If you're looking to add a zone entrance to the world map, there are two approaches I could suggest:
  • A map overlay, via the 'MapGeneratorStatic:subgenRegister' hook. You can see, for instance, my Recalling Home addon for an example.
  • An event, like the one that adds the Noxious Caldera zone entrance to the map. You can see my Melinda on the Map addon for an example of how to use the 'Zone:loadEvents' hook to add the event.
(Also, just for future reference, you'll usually want to wrap code samples like this in [​code]…[​/code] to make it easier to read.)