Zireael wrote:If I were you, I'd look at how Zizzo did it in his ToME 2 port. I'm using his code for the worldmap and it seems much more robust than ToME 4's (less prone to stranding you

)
*blush* [bows]
Actually, though, the answers to your questions depend a lot on whether you're asking from the perspective of a module writer or an addon writer:
XLambda wrote:2) Is there any way to change or disable the calendar on the world map? Maybe even from inside a running game rather than at world-gen? I looked through the code and don't really understand how that whole system works.
This, for instance; if you're writing a module, I don't think you actually even have to have a calendar at all, and it only logs the date when you tell it to. The T4 module creates its calendar in either mod.class.Game:runReal() or mod.class.Game:newGame(), apparently based on whether you're starting a new character or loading a savefile, and it logs the current calendar date in mod.class.Game:onTurn(). [And I just noticed that the T2 module is missing corresponding code...

] Ooh, I see a Clever Hack™ if you're working at the T4 addon level: the relevant code in T4's Game:onTurn() is:
Code: Select all
if self.zone then
if self.zone.on_turn then self.zone:on_turn() end
end
-- [...]
if not self.day_of_year or self.day_of_year ~= self.calendar:getDayOfYear(self.turn) then
self.log(self.calendar:getTimeDate(self.turn))
self.day_of_year = self.calendar:getDayOfYear(self.turn)
end
So if you have a zone in which you don't want calendar messages, you could give it an on_turn() method that sets game.day_of_year to game.calendar:getDayOfYear(game.turn), which would trick Game:onTurn() into thinking it's already logged the calendar message.
XLambda wrote:3) Is there a simple way to set wilderness coordinates for the player? Especially considering there might be multiple worldmaps, and the ToME code doesn't really seem to be built for that.
There again, if you're writing a module, it's your responsibility to keep track of the player's wilderness coordinates, and you get to decide where they live and how they're accessed. Both the T4 and T2 modules keep them in game.player.wild_x and game.player.wild_y; if you have multiple worldmaps, you could keep corresponding coordinates for each one in game.player.
From a module writer's perspective, the engine doesn't actually make a distinction between a worldmap and any other kind of zone AFAICT; it's the module code's job to handle them differently as needed. Your Game:changeLevel(), for instance, would be responsible for switching between worldmap coordinates and ordinary coordinates when entering or leaving a worldmap.