City Planning Mode

PawelS

Ancient Druid
Joined
Dec 11, 2003
Messages
2,811
Location
Poland
attachment.php


A simple UI modification that should be useful in planning where to found cities.

Download and instructions here.

Any feedback is appreciated.
 

Attachments

  • cpm.jpg
    cpm.jpg
    119.2 KB · Views: 2,058
Updated version uploaded - now it's compatible with Enhanced User Interface.
 
Great idea. But have one question. Can you change draw distance from 3 to 5? Or, maybe you can tell what to change in the code.
 
At the top of CityPlanningMode.lua, change
iRadius = GameDefines.CITY_PLOTS_RADIUS
to
iRadius = 5
 
Thanks. Work, but crash after activation. 4 have the same result. Maybe, will stay with old good "city limits" for now, wait for update, and pray.
Ps. Whoward69, your mods just awesome. :D
Pps. 34(43/62)civ.dll component has a bug with world congress, who prevent to click on the "next" button, when player must open congress window.
Ppps. Sorry for my precious english skill. :D
 
I changed the radius to 5 and it works properly for me. So I need you to answer some questions:

1. When exactly does the crash happen? When you press X?
2. Do you use any mods? (or EUI)
3. Are you sure that it doesn't crash when the radius is 3 and all the other circumstances are the same?
4. Are you sure you made the change to the Lua file exactly as whoward69 described, and didn't change anything else?
 
I deleted cache and its working for now. Don't know why its works, because i do this a few hours ago, before installing all mods(including this one). Sorry.

It's funny, but city limits make those problem.
 
Why do you need the screenshot attached? There is a link to it in the original post, and it's attached to the download.
 
This instantly crashes when you press 'x' with Super Power mod without any modifications to it. Super Power uses a city radius of 5, which should be what GameDefines.CITY_PLOTS_RADIUS is. Should I try manually setting it to 5?
 
This instantly crashes when you press 'x' with Super Power mod without any modifications to it. Super Power uses a city radius of 5, which should be what GameDefines.CITY_PLOTS_RADIUS is. Should I try manually setting it to 5?

See posts #7 to #9 first
 
After clearing the cache, it briefly showed the highlights, then crashed, instead of crashing when pressing 'x'.

However, it was very late game on a huge map, and I think it crashed from the VRAM problems Civ5 has in those scenarios.

And indeed, after starting a new game, it works perfectly fine.

Thanks.
 
@Grayson Carlyle: If the crashes are indeed connected to the VRAM usage, then I can do nothing about it. Also, I tried to use borders instead of filled hexes (which would possibly take less VRAM), but it doesn't work properly on non-wrapped maps where there are cities both on the west and east side of the map. It looks like a bug in the game's graphics engine. So I use borders only for highlighting the single city under cursor, which doesn't cause such problems.

@Chinese American: The image was too large IMO to put it directly in the main post, so I decided to put a resized version there instead.
 
Great mod! I'd love this to only show the areas around cities not hidden under the fog of war. Currently you can use it to see the areas of not yet discovered cities, which is kinda cheating.
 
As a quick fix, in CityPlanningMode.lua change
Code:
	-- show limits of all cities
	for pCity in pPlayer:Cities () do
		if pSelectedCity and pCity == pSelectedCity then
			ShowCityLimit (pCity:GetX (), pCity:GetY (), sStyle.."_B")
		else
			ShowCityLimit (pCity:GetX (), pCity:GetY (), sStyle)
		end
	end
to
Code:
	-- show limits of all cities
[B][COLOR="SeaGreen"]	local iActiveTeam = Game.GetActiveTeam()[/COLOR][/B]
	for pCity in pPlayer:Cities () do
[B][COLOR="seagreen"]		if (pCity:Plot():IsRevealed(iActiveTeam)) then[/COLOR][/B]
			if pSelectedCity and pCity == pSelectedCity then
				ShowCityLimit (pCity:GetX (), pCity:GetY (), sStyle.."_B")
			else
				ShowCityLimit (pCity:GetX (), pCity:GetY (), sStyle)
			end
[B][COLOR="seagreen"]		end[/COLOR][/B]
	end

Spoiler :
Yes I know that iActiveTeam can be set higher up, but then I'd have to show more code!
 
Thanks :) I'm not sure if I want to change this in the "official" version though, as the "sensing undiscovered cities" thing is already present in the game - it happens that you can't build a city with a settler due to a city that lies in undiscovered territory. But I agree that it's cheating, as it allows you to locate these cities without sending a settler there (the display of potential city limits under cursor is another way to "cheat", as it won't appear on spots where a city can't be built; in mods where the minimum distance between cities is higher than normal it's a more significant effect). But it's a kind of cheat that I like, and I don't think it breaks the game or anything, so I think I'll keep it as it is :) Those who don't like this kind of cheating can of course make the change described in whoward's post. Other modifications are possible too, for example you can change the colors - they are in highlights.xml, under "CPM styles".
 
Back
Top Bottom