NerdanelVampire: I can't seem to figure out how to get my towns in Zothiqband working again in alpha4. All of them appear mysteriously broken. I'm concentrating on Cith since it's the one that's the easiest to test.

I get this when starting a new game and the player is supposed to be generated in Cith, my Bree-equivalent that worked in alpha3:

error: attempt to index local `symb' (a nil value) 
stack traceback:
   1:  method `execute' at line 161 [file `/engine/mapload.lua']
   2:  method `load' at line 131 [file `/engine/mapload.lua']
   3:  function <83:file `/engine/dungeon.lua'> at line 89

The bizarre thing that happens is that I get the uppermost line of Cith only. This results in a few chasm squares that wouldn't get generated otherwise. The even more bizarre thing is that I used to get SIX of the uppermost lines, featuring chasms and hard rocks, but after I did one map tweak too many I can't get that anymore, even though the upper part of the map is now chasm and hard rock again. How could a grass roof square possible do that kind of thing? And yes, I've kept removing the generated raw files.

The following happens when the game tries to generate Cith after the first time, when the character enters Cith or any wilderness area that shares a border with it. Now I get NO Cith whatsoever. The only thing remaining is the name in the corner and the ground type.

error: assertion failed!  map cith.map already defined! 
stack traceback:
   1:  function `assert' [C]
   2:  method `define' at line 16 [file `/engine/mapload.lua']
   3:  main of file `/data/towns/cith.map' at line 1
   4:  function `__global_tome_dofile_anywhere' [C]
   5:  function `p' at line 51 [file `/engine/globals.lua']
   6:  function `protect_tome_dofile' at line 30 [file `/engine/globals.lua']
   7:  function `tome_dofile_anywhere' at line 51 [file `/engine/globals.lua']
   8:  method `import' at line 118 [file `/engine/mapload.lua']
   9:  main of file `/data/towns/towns.lua' at line 21
  10:  function `__global_tome_dofile_anywhere' [C]
  11:  function `p' at line 51 [file `/engine/globals.lua']
  12:  function `protect_tome_dofile' at line 30 [file `/engine/globals.lua']
  13:  function `tome_dofile_anywhere' at line 51 [file `/engine/globals.lua']
  14:  method `load' at line 127 [file `/engine/mapload.lua']
  15:  function <83:file `/engine/dungeon.lua'> at line 89
error: assertion failed!  map towns/towns.lua loaded, but no map found in running map state!
stack traceback:
   1:  function `assert' [C]
   2:  method `load' at line 129 [file `/engine/mapload.lua']
   3:  function <83:file `/engine/dungeon.lua'> at line 89

I really don't have any idea about multiple definitions of the cith.map.

$ grep -r cith.map * 
towns/towns.lua:        [1] = { "towns/cith.map",       "towns/d_cith.map" }
towns/cith.map~:map.define("cith.map")
towns/cith.map:map.define("cith.map")

The automatic backup file doesn't affect things; I've tried deleting it.

I've compared everything to how the ToME module is set up. I've even replaced Cith with Bree and still no town gets generated. I'm stumped.

BucketMan: I've had similar problems with Dragonball T twice that I remember. Swapped in Bree and the town still wouldn't load. The way I remember it, the first time was caused by changing some item TVAL names. I changed a name, but didn't update an object theme that referenced it...the object theme was used by a certain dungeon, and for some reason this amde towns not load. The second time I don't remember exactly, but it also had nothign to do with the town itself, and I think was caused by something I did to the wilderness map.

"when the character enters Cith or any wilderness area that shares a border with it."

The engine parses map files when retrieving the map border edge. The official line is that this isn't true...but you've seen how Dragonball T has the four adjacent 'towns,' yes? I've routinely seen one town not load because a store or a dungeon in an adjacent town has a problem.

If you'd ilke I'll take a look. I don't see Zothiqband available for download either on its wiiki page, or on the modules list at t-o-m-e.net. Care to upload a copy?

NerdanelVampire: Zothiqband is currently horribly broken, and I'm a little embarrassed of it. I'd decided to at least get the game to the point where it can be played as a simple dungeon-whack in Zothique before I show it to the public. If there is interest I can consider an earlier release.

I think I'll have to reinstall alpha4. Namely, I noticed that not only Zothiqband was mysteriously broken, vanilla ToME was the exact same way too! And it worked just as fine as might be expected when I tried it out after installing alpha4.

NerdanelVampire: So I reinstalled alpha4 and the ToME module works now. I even figured a way to get towns visible in Zothiqband. The problem is, I have to make Zothiqband use ToME towns, ToME dungeons, ToME monsters, and ToME scripts. Switch even one of those directories back to the Zothiqband version, and no towns appear. So essentially, I can get the towns work only if I reduce my module to a custom calendar and a custom world map.

How can this be possible???

This error message appears related:

error: attempt to perform arithmetic on field `hgt' (a nil value) 
stack traceback:
   1:  method `load' at line 132 [file `/engine/mapload.lua']
   2:  function <83:file `/engine/dungeon.lua'> at line 89

I have no idea if the errors about empty theme flagsets have anything to do with anything. I haven't touched items yet.

NerdanelVampire: Oh my. It looks like the mystery is finally starting to get solved. And it's a dirty mystery indeed. It sounds like the bug isn't mine but ToME's! The whole thing seems to result from T-Engine not wanting to read rectangular maps, if you can believe it! Shocking. I'll go file a bug about it.

NerdanelVampire: I hate my text editor. To think about it, all this trouble because my text editor's line wrap is more advanced than I ever imagined. SOLVED.

It's my experience in programming that mysterious errors are something really subtle or something really simple and stupid, and this was both. *bangs head against the desk*

Module Developers Discussion/Help needed; alpha4 mysteriously broke my towns (last edited 2006-08-17 18:30:41 by NerdanelVampire)