Trying to fix some typos
I tried to fix some typos in a famous mod. Some territory names, and a unit name. So I found the XML file for that map, made a copy, then I scrolled through the whole copy and corrected all the typos (because, as you know, each territory name is referenced in a whole bunch of locations in the code). I thought I got them all, but I got some compile-time errors until I got every one. Success!
But when I tried to run my "mod", I got a run-time error. Now, as you know, there are 4 more text files: "centres", "capitols", "polygons", and one more, that contain information about the mod. OK, no problem. I made copies of all those files, and made all the corrections in the copies. So now I have all the files associated with the old mod in a separate directory.
But when I try to run the new mod, I still get a run-time error "unable to find centres". Why? The proper files are right where they should be. Now, it's not that the game can find NO centres, only the corrected ones are missing. So the game must be able to find the old files, even though I moved them away.
Of course, I could edit the old files, but I don't want to do that.
How to fix this problem?
@victorin_pacific Hard to say without seeing the map folder. The obvious answer seems to be make sure to copy your new files to where they should be in the map folder. If you zip up your map folder and attach/link it here then I can take a look.
@victorin_pacific You need to be sure the xml mapname entry of your mod matches the wanted map folder, that should be better be unique, in the referring folder (as having zipped and not zippend maps could allow names' duplication). Your game doesn't care in what folder it currently is, as an xml.
Make sure that you don't have zipped & unzipped versions of the same mod.
Thank you for your responses. Below I provide some more details. First, a screenshot of the relevant directory. In the "games" folder is the original XML file, as well as the copy, which I then edited. I believe that I have made all the necessary corrections in the new XML file. Indeed, it shows up in the list of available games when tripleA is run, and seems to work fine, up until the time I hit "play".
Now, in this directory, marked in red, there are 4 additional text files, which contain necessary game information. I copied those 4 files, and moved the originals into the "MapData" folder to preserve them, but keep them out of the way. I did not want to rename these files.
You can see from the dates that I edited 3 of those files, but not the "capitols" file, which does require a change, but I haven't got to it yet. I believe that I have done all the necessary corrections in those files.
Now, when I run the original game, it should refer to the files you can see here due to where they are, and because they are not compatible with the original game, the game should not run. But it runs fine. So it must be going into the "MapData" folder, which it shouldn't even know about, and using those files. On the other hand, when I run the new game, it should refer to the files you can see here, and it does, but it doesn't like them.
So here's a screenshot of the errors I get. Note that the new version of the game only objects to missing information about the 4 territories I renamed. This means that the game must be finding the files, just not liking them.
@VictorIn_Pacific The error indicates you are missing territories in the centers.txt. If you zip up the folder and post a link to it here then I can take a look.
@VictorIn_Pacific Just to be sure (and assuming you are not customizing the "downloadedMap" reference), as I said, did you check not having other "middle_earth" folders (zipped or not) in the referring user folder (called "maps", back in 18.104.22.168; so, if your terminal is configured for American/British English, in Widows Vista and later ones, you should find it in C:/Users/.../triplea/maps, where "..." is your username)? To be clear, in 22.214.171.124 you have two "maps" folder; one in the installation and another one in your "user" folder. Be sure (and, please, confirm here) that there are no other "middle_earth" named folders, but the one you want to use, in either of them.
If that is not the case, then, I've no idea, as long as you didn't use some special characters in the new names.
Out of curiosity, why are you using a version of TripleA released over 7 years ago? Did you install it when it was the stable or did you download it from some external sites offering outdated TripleA programs? Also, assuming awareness, you should have told that, as relevant items may have changed (and certainly did) since that version.
OK, I have figured this out. Again, thanks for the ideas.
So, part of the problem may be that I am using what is probably a very old version of the engine, simply because I have been "off the net" for over 5 years, as far as this game is concerned. 126.96.36.199.
But, unless this feature has changed, the trick is that the Middle Earth mod is really 2 games in one, under the hood, by virtue of the fact that it has 2 map skins included. I set things up correctly so that my version of the map (with typos fixed) now works properly, with the original map skin. The original map works with map skin 2. They are no longer compatible, unless I also edit another batch of map data files.
@VictorIn_Pacific So, is the problem just that what you have doesn't work with the current stable? Updating can be done in a few minutes, aside from sounds.
@Cernel : The problem no longer exists. Now, I don't know whether the way the game is implemented has changed dramatically since 188.8.131.52. I am going to assume that it does not. I say again, the issue is that the LotR mod has 2 "map skins". As far as the player is concerned, this seems to be just a trivial in-game switch to change the appearance of the map. However, as far as the engine is concerned, changing a map skin means that you need a completely new game, with all the associated map files being different for each map skin, even though all those files are exact duplicates of the originals. I fixed every instance of the typos in one set of those files, but will need to repeat the entire process for the second map skin. (Actually, there a couple simpler simpler processes that I can think of.)
The "typos" in question are not really typos. After all, each one is repeated a whole bunch of times to make the mod work. Obviously, the people who created this mod put an enormous amount of effort and care and love into this mod, and they hardly were going to let errors slip in by lack of care.
Interesting fact: there are maps of Middle Earth out there that were created with an enormous amount of effort and care and love, which nevertheless have errors, for example this one ME map. What a beautiful map!
But "Drimrill Dale" should be "Dimrill Dale" and the island of "Tolfolas" should be "Tolfalas".
Anyone who faithfully copies place names from this map will propagate those errors.
Got an interesting run-time error when I played through the first turn of my typo-fixed map: Unable to find [unit]. (Occurred at a production phase; also causes edit mode to fail.) $%#* I fixed all the typos already! It turns out that you also need to make sure that all the unit pictures have names that match what they are called in the XML file. Easy enough to fix once you know what the issue is.
3 of the factions (Rhun, Dale, and Khand) have only the incorrectly-named image file "trebuche", while 3 of them (Rohan, Harad, and Gondor) have both that and the correct "trebuchet" in the unit images folder.
Does the "capitols.txt" file have any function? I moved the capitol for one of the factions in the XML file, but not in the "capitols.txt" file. No errors happen, and the new capitol seems to function correctly.