Map not loading correctly.
I am pretty sure that my nations are getting their own default color, but the game doesn't like them or something. I get grey squares instead of the relief tiles or base tiles for the countries that have different colors.
The game throws a 'NoSuchElementException' error
Console shows the following
Aug 12, 2020 4:33:25 PM org.triplea.game.client.HeadedGameRunner lambda$initializeClientSettingAndLogging$0 SEVERE: null java.util.NoSuchElementException at com.google.common.collect.AbstractIndexedListIterator.next(AbstractIndexedListIterator.java:75) at games.strategy.triplea.ui.mapdata.DefaultColors.nextColor(DefaultColors.java:30) at games.strategy.triplea.ui.mapdata.MapData.getPlayerColor(MapData.java:496) at games.strategy.triplea.ui.screen.drawable.LandTerritoryDrawable.draw(LandTerritoryDrawable.java:45) at games.strategy.triplea.ui.screen.drawable.LandTerritoryDrawable.draw(LandTerritoryDrawable.java:29) at games.strategy.triplea.ui.screen.Tile.draw(Tile.java:69) at games.strategy.triplea.ui.screen.Tile.drawImage(Tile.java:54) at games.strategy.triplea.ui.panels.map.MapPanel.lambda$paint$7(MapPanel.java:742) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)
wc_sumpton last edited by
I've seen this error a couple of times, and I don't know what causes it. In my map it is somehow connected to territoryAttachment's which have: "<option name="isImpassable" value="true"/> If I comment out or remove that option the the map loads fine. But I have not been able to figure out the cause.
Not much, but its a start.
Unfortunately that isn't my problem. It has something to do with the territory ownership. I was testing something else, and realized when i changed the ownership of one territory it made more chunks not load. After that i specifically changed some territory ownership, and that made the grey squares load correctly.
It could be player default colors. There are 8 defaults, beyond that and you need to explicitly define the player colors (I believe in map.properties).
That was it, thanks!
The NoSuchElementException in Java is thrown when one tries to access an iterable beyond its maximum limit. This means that, this exception is thrown by various accessor methods to indicate that the element being requested does not exist . The next() method in Java returns the next element in the iteration or NoSuchElementException if the iteration has no more elements.
The solution to this exception is to check whether the next position of an iterable is filled or empty . The following methods are used to check the next position: