Next City Plot by Ace v2.3

Next City Plot by Ace v2.3 2016-11-14

mod crashes my Civ on "Inland Sea" type map

Thank you for reporting this.
I will look into it and get back to you.
Maybe has something to do with the non-wrapped borders of an Inland Sea map type.

UPD. The crash happened when my mod tried to clear the array LensLayers.HEX_COLORING_GREAT_PEOPLE, which I rigged to show a white border around the next city plot. On the first turn the pCityCulture:GetNextPlot() returns -1 and is added into the array, which is OK for wrapped maps (e.g. Pangea), but causes a crash on non-wrapped maps (e.g. Inland Sea). Simply fixed it by adding a condition to check that pNextPlotID > 0 before creating a white border Lense. I assume this condition will work for all maps.
 
Last edited:
now ,i find a runtime ERROR in Lua.log file,maybe will crash.

------------------------------------------------------------
Runtime Error: D:\my-documents\My Games\Sid Meier's Civilization VI\Mods\Next_City_Plot_by_Ace\UI\WorldView\PlotInfo.lua:554: attempt to index a nil value
stack traceback:
D:\my-documents\My Games\Sid Meier's Civilization VI\Mods\Next_City_Plot_by_Ace\UI\WorldView\PlotInfo.lua:554: in function 'HideNextCityPlot'
D:\my-documents\My Games\Sid Meier's Civilization VI\Mods\Next_City_Plot_by_Ace\UI\WorldView\PlotInfo.lua:759: in function 'OnCitySelectionChanged'
[C]: in function 'func'
[C]: in function '(anonymous)'
TechCivicCompletedPopup: Here true
TechCivicCompletedPopup: Tech Ended
PlotInfo: PlotInfo::OnCitySelectionChanged 0 65536 17 15 0 true false
-----------------------------------------------------------

and try to fix it as :
Code:
  +      if UILens.IsLayerOn(LensLayers.PURCHASE_PLOT) or UILens.IsLayerOn(LensLayers.CITIZEN_MANAGEMENT) then
           HideNextCityPlot();
  +      end
 
attempt to index a nil value
The game does not crash on indexing nil values, just reports it into log/console and moves on.
Good catch though, I'll add a better condition wrapper to vanilla HideNextCityPlot().

My point is that on changing a city you always want to call HideNextCityPlot() for the previous city, and then ShowNextCityPlot() for the new city.
All the checks for currently active layer are done within the HideNextCityPlot() anyway.

UPD. When switching cities - you always want to hide all the markers for the previous city.
Written this way so after you are done swapping between cities - you don't have to wipe the markers through the entire map, especially if you have a vast empire.
My way for clearing instances on switching cities is simple - last city out, next city in.
 
Last edited:
Just wanted to say thanks to Ace Cooper for providing this mod while waiting for Firaxis to release something official. Definitely made the game more playable during the dry time, and should make transitioning into the patch much easier.
 
I'm aware, just wanted to thank him since I've been using it before the latest patch.
 
I like Ace's version better than the patch haha. At least I can see what the tile is in the mod version
 
You do see now what next tile is obtained after the patch. It's the pink overlay on a tile, but you only see the "X turns until border grow" text there if you zoom closer.
I'd keep the pink overlay but add the mod's always-visible turn-text on the map.
 
I wonder if it might be too hard to do with the available tools atm, but if you'd be interested in adding an extra feature to this mod, i'd love to get notification pop-ups for expanded tiles. Like those you get for new resources discovered, that stack a number of plot locations in a single notification icon. Would take away the hassle of constantly scouring the map to keep track of dozens of growing cities just to see if there are any new tiles to improve.
 
Back
Top Bottom