[TOT] How to debug fatal errors on scenario startup? (no Events related)

Pablostuka

King
Joined
Mar 27, 2002
Messages
810
Location
Galway, IE
Hi, my Civ2 ToT crashes when I try to start a scenario I'm working on, but the error message I get in a pop up is not really helpful:

Error "-6" in module "3" data: 147 0

2022-02-03 11_45_13-Photos.png


Is there any way to debug this type of errors and know what might cause it? I know how to debug Event errors in the "old" macro language, but this has nothing to do with events, there is not even a Events.txt file in my folder.

I think it could be related to myself experimenting with the following ToTPP features in my @COSMIC2 section of the Rules.txt file:

NumberOfUnitTypes, 189
NumberOfTerrainTypes, 16


Because it's the only thing I've changed so far. I want to test the maximum values allowed by ToTPP as per documentation, and I think I got it everything right, this is what I changed:

GRAPHIC FILES:
  1. Expanded Units.bmp file in the bottom of my original file to accommodate a total of 189 unit slots plus added an additional row for a single unit (barbarian chief) at the bottom left corner of the file. So I have 22 rows in total in my Units.bmp file (9x21 + 1 lone cell). As per documentation:
    "Graphics:
    Edit Units.bmp and add extra rows of tiles at the bottom of the image. The barbarian diplomat unit has to be put in the tile immediately following the regular units, so be careful to move it all the way to the end."
  2. expanded Terrain1.bmp file to accomodate 5 extra rows of terrains below Ocean and above Roads. I have no other terrain files except Terrain2.bmb. As per documentation:
    "Graphics:
    Edit Terrain1.bmp and add extra tiles. These go directly below the ocean tiles as well, so road/railroad tiles shift down. Do the same for Terrain3.bmp, Terrain5.bmp and Terrain7.bmp, if applicable."
TEXT FILES

1) Added relevant entries to Rules.txt:
  • @UNITS: I have 189 lines. I've verified missing commas after unit names or weird characters.
  • @TERRAIN, @TERRAIN1, @TERRAIN2 and @TERRAIN3: I have 48 lines on each section, consisting of 5 extra lines for new main terrains (codes Bbb to Fff) plus its 10 additional resources. I am not sure if I need all these terrain entries though as I only have Terrain1.bmp and Terrain2.bmp files. No extra maps/worlds.
  • @UNITS_ADVANCED: I have 189 lines matching the @UNITS section and following the format of the vanilla file for now.
  • @SOUNDS: I have 189 lines matching the @UNITS section. When there's no sound defined yet, the line is as follows: "<none> ; XXX", where XXX is the unit name.
2) Added relevant entries to Describe.txt (empty for now, I'll write descriptions once everything works):
  • @@UNIT_INDEX: I have 189 rows like this: "-1, ;" before the terminator line.
  • After this I have empty entries ranging from @@00 to @@188
  • @@TERRAIN_INDEX: I have 48 rows like this: "-1, ;" before the terminator line.
  • After this I have empty entries ranging from @@00 to @@47
How does the above look like? Is there any way to know why my game crashes when I try to start the scenario with these settings?

Many thanks in advance! I'm quite new to the ToT/ToTPP world so I'm trying to see what it can be achieved these days.

Pablo
 

Attachments

  • 2022-02-03 11_45_13-Photos.png
    2022-02-03 11_45_13-Photos.png
    23.1 KB · Views: 36
I get these kind of messages when I have a typo in Rules.txt. The second number (Data) refers to the line (-1) in the respective module (@Units,@Terrain,etc.). So you most likely have an error on line 148 of the @Units section. In 90% of the cases it is a missing comma.
 
"In 90% of the cases it is a missing comma."

Yes, there is a lone semicolon.

(Unit 148 - Terni 65/17 M1913)
 
Thank you very much @400AD and @TheNamelessOne !!

@400AD am I blind? can't see that semicolon (line 545 on the file):

Terni 65/17 M1913, ` no, 0, 2.,0, 12a,3d, 1h,3f, 10,0, 0, X4, 000000001000000

Anyway will check that link now. Thanks again
 
I can see it. Looks like flyhorsehocky between "M1913," and "no,". :D
 
Cool,I've used DebugView as recommended, apparently it's complaining about this line:

[25400] ( 13) 'Refinery, 1,2, 1,5,15, no, 0, 0, 0, no, 0, 0, 0, no,no ; Ccc'

And yes, just realised my new terrains are missing a comma after the last "no":

Refinery, 1,2, 1,5,15, no, 0, 0, 0, no, 0, 0, 0, no,no ; Ccc
Mine, 1,2, 2,10,10, no, 0, 0, 0, no, 0, 0, 0, no,no ; Ddd
Heavy Industry, 1,2, 2,15,5, no, 0, 0, 0, no, 0, 0, 0, no,no ; Eee
Olive fields, 2,2, 3,2,5, no, 0, 0, 0, no, 0, 0, 0, no,no ; Fff

So I fixed it, and it works perfectly now, game loads.

Thank you very much again for the hints and help :)

Regards,

Pablo
 
Top Bottom