"java.lang.StringIndexOutofBoundException" when running AutoPlacement Finder...and something odd....
-
Hello all
After introducing myself a few days ago, i have now come to the point where i need some help as i am really confused.
Let me update you on what i did:
I started the new project, did draw a map.
Center Picker and Polygon run through just fine.
Then i did run the AutoPlacement Finder and it did run fine resulting in a place.txt.
Then i did run the Manual Placement Tool and it did run fine and i edited some placements and saved the result.Some time passed, i worked on the XML.
Then i wanted to start the Manual Placement Finder again for some adjustments and it did NOT work.
Instead i got that java Exception error.So i started the AutoPlacement Finder and also that one did NOT work.
Instead i got that java Exception error.So i am really confused and think "WTFBBQ"???
Oh, here is the Exception:
For me it is absolutely mysterious, why did it work once and now not again. Same map, no changes.
Really strange. The error appears, before the polygon file is read in.I am happy for all help and hints, thank you
-
@tannenbernie
Delete/rename triplea.log this is found here
C:\Users\%USERNAME%\triplea\Run the Manual Placement Finder again, check the triplea.log again, to see it contains any clues.
If you use Notepad++ it should show which lines you have recently changed, if dont use it I suggest you do.
-
@tannenbernie do you have your old map that originally worked ? If so, you could try and do the placement adjustments and then add in the new xml, although I don't really think that's the problem.
This happened to me, but sadly I don't remember how I got it to work. I think the error itself has todo with the map dimensions.
They need to be exact but you didn't change those and i didn't either when I encountered it.
I would go through @Black_Elk s map making process step by step and see if you can find the solution there.
https://forums.triplea-game.org/topic/3432/a-brief-guide-to-the-map-creator-tools-utilities
Edit
Try and run everything through the tilebreaker again before you do poly grab. -
Hello again.
I found it and was able to correct the error, so both tools are working for me on my map again. I will try to explain it here, so others with similar errors may find a solution too.
@TheDog: Actually i was not able to find any triplea.log. Not at the place where you suggested it, neither anywhere else. When i start the Placement picker, it starts a small window called "placement.log" in the background. Sadly there was nothing written in it but "Starting Placement this may take a while...".
Ok now to the solution:
I found that i was able to read the existing "place" file into the Manual Picker, when i just deleted 3/4 of its content, making it smaller. So i started experimenting with deleting different blocks from the file and after an hour work i found which lines triggered the java error. I had manually removed some placements in the file for tiles which are "unpassable mountain". The names of these tiles were still in the file, without placements. That was obviously not meant that way. So i simply removed the tiles completely and the "place" file worked again.Here a little part of it:
M2 (1240,1305) (1168,1376) (1168,1304) (1306,1377) (1240,1233) (1312,1233) (1312,1305) (1166,1232) (1234,1448) (1096,1343) (1384,1204) (1384,1276) (1094,1271)
NO11
As you can see the line is empty behind tile NO11, this caused the error. After removing NO11 and the other tile names without placements it worked again.Strange stuff:
After i fixed this (stupid me for not remembering that i made changes to the place file grrrr) i was also able to run the automatic placement picker again. Well, to me this makes no sense at all. The automatic placement picker should GENERATE a place file, not READ in an existing one. So why does it work again after i fixed the place file? But well, it is as it is. Fixing the place file in the map directory made both tools work again.Thx for your help, everybody.
-
Found this too late to be of much use, but yeah I had the same issues a few times when trying to create a place.txt for a couple maps. What happened in my case was that I had accidentally blanked a place, which is fairly easy to do since it's a lot of click/shift click to add or remove entries, but then without any assigned coordinates for a tile it would throw off that error.
Another sorta similar error I think can happen if you have a duplicate entry in the text files. like say for a tile that was renamed. The utility also sometimes asks if you want to use the centers or polys, which can reintroduce an old label depending on which order you make the change.
I think it happened to me there in a similar situation, like where I had an impassible tile listed twice, Sahara vs Sahara Desert or the like. That was easier to hunt down than the non existent/blanked place since at least I was able to search the txt file. Sucks the you had to go through that to manually delete the text blocks, hopefully you didn't lose too much work.
After a couple snafus I started getting in the habit of maybe an extra copy of all the txt files each time I went in to edit them. Just in case something goofed, I'd have an earlier copy to reference. I had almost hosed like a whole weekends worth of placements for the big map, but somehow theDog was able to figure out which lines were different and saved my bacon.
Anyhow, glad you figured it out. The map making tools can be really finicky, cause it you have to save it to launch and confirm changes, but usually the way I tend to do stuff, it'll be more than a few entries at a go.