Fix city connection icon and trade routes (mod)

Piruparka

Prince
Joined
May 1, 2010
Messages
564
Location
Germany
Hi, there's two things that really bother me about the current (final? :() state of the game. Firstly the fact that city connections of aquatic cities are not displayed (though as I read here they do work, they're just not shown) and the fact that trade routes that bring e.g. Firaxit to a city qualify the city to build an Observatory, although this normally requires a WORKED SOURCE of Firaxit (the same with the Clone park (or what it's called). Now I'm not very much into modding but I think this might be a thing the community could fix very easily, isn't it?

Is there anybody here who could tell me what to do in order to fix those two issues?

Any help would be highly appreciated.
 
Well, if we were eager to mod this we'd already have done it, right? Those are two well-known bugs. ^^

The first thing is just a little, insignificant UI Bug, not really a problem. As long as you have a coastal City that is connected to the capital all Ocean Cities are connected as well unless an enemy is near, in which case they show the icon that tells you that they're not connected. So I don't really see why anyone would waste their time fixing that. Well, I certainly wouldn't, maybe somebody else is more of a perfectionist than I am. ^^

About the Trade Resources: It's not possible to disable the "Trade Route Resources make it as if you had them locally"-functionality, so there are two options:
- Disable Resources from Trade Routes completely, which is a limitation that few people are willing to accept as a trade-off
- Code it so the game checks all of your city plots for those resources whenever you open the building menu. Which the game would then need to do for every single resource-building whenever the building menu is opened. From experience I'd assume that that would cause the game to lock up for a moment whenever you open the menu and there's more than just a few buildings available, which once again is not exactly a convenient workaround either.

So TL:DR - it's likely that there's no good solution to this.

Although thinking about it a little more one could probably get around the problem by just looping through all city plots at the beginning of the turn and indexing which city has which resources. That could work without the performance hit.
 
Hi Ryika, thank you very much first of all. I am very well aware of your name from a lot mods I read about on the Steam Community. But alsofor the last paragraph. ;) It lets me hope that this problem might be solvable. Honestly though, I have no clue what you are talking about :D Would you like to tell me what to do?
 
Moderator Action: Moved to General Modding Discussions
 
- Code it so the game checks all of your city plots for those resources whenever you open the building menu.

Wouldn't work for the AI (as any UI added limitations have no effect on the AI logic).

Assuming the same events are in CivBE as Civ, you'd need to use a CityCanConstruct event handler (and use that to check for a worked resource)
 
Yes, CityCanConstruct exists, I just thought one could circumvent the freezescreens that seem to be caused by having CityCanConstruct loop through the Building_LocalResourceOrs for every single building in the list and then loop through all City Plots for the Buildings that have been found (x2, becauce CityCanConstruct seems to be called twice whenever the building menu is opened) by indexing everything in a 1-time-loop so that CityCanConstruct can then draw from a single table of Booleans instead of doing all the looping itself.

So basically turning..

CityCanConstruct -> if LocalResourceOr found -> Loop through all Plots to find the Resource with proper Improvement on it -> Do the same for every building

...into...

Loop to index all Resources with proper Improvements per City -> CityCanConstruct -> if LocalResourceOr found -> Simply loop through table

Not sure if that would really be a better solution - or maybe I'm just missing an easier way to find out if a resource is present that doesn't require manually looping through all plots.
 
Hey guys, thank you all for you participation. As stated above, I have got no clue about modding and coding, so I need you guys. Ryika, do you think, you could build a small test mod for example only for the Observatory first, then i could adapt it to the other buildings.
 
Top Bottom