1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Fix city connection icon and trade routes (mod)

Discussion in 'CivBE - General Modding Discussion' started by Piruparka, Aug 21, 2016.

  1. Piruparka

    Piruparka Chieftain

    Joined:
    May 1, 2010
    Messages:
    564
    Gender:
    Male
    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.
     
  2. Piruparka

    Piruparka Chieftain

    Joined:
    May 1, 2010
    Messages:
    564
    Gender:
    Male
    Location:
    Germany
    Oh dear... nobody eager to mod this?
     
  3. Ryika

    Ryika likes cookies and milk.

    Joined:
    Aug 30, 2013
    Messages:
    9,065
    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.
     
  4. Piruparka

    Piruparka Chieftain

    Joined:
    May 1, 2010
    Messages:
    564
    Gender:
    Male
    Location:
    Germany
    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?
     
  5. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    Moderator Action: Moved to General Modding Discussions
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,112
    Location:
    Near Portsmouth, UK
    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)
     
  7. Ryika

    Ryika likes cookies and milk.

    Joined:
    Aug 30, 2013
    Messages:
    9,065
    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.
     
  8. Piruparka

    Piruparka Chieftain

    Joined:
    May 1, 2010
    Messages:
    564
    Gender:
    Male
    Location:
    Germany
    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.
     

Share This Page

Ebates: Get Paid to Shop