1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[BNW] Adding City State Influence per turn with trade routes a la VP?

Discussion in 'Civ5 - Creation & Customization' started by A_Wandering_Man, Jan 4, 2020.

  1. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,518
    Location:
    Illinois, USA
    Code:
    local iMyBuilding = GameInfoTypes["NCLJ_RITO_POST_OFFICE"]
    Does not match to
    Code:
    <Type>BUILDING_NCLJ_RITO_POST_OFFICE</Type>
    So this is never evaluated as being a true statement
    Code:
    buildingType == iMyBuilding
    And therefore the rest of the code within the lua function never executes.
     
  2. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    21
    Gender:
    Male
    Location:
    Canada
    Ah, yes! That fixed the Lua. The Building now works properly. I notice now, however, that the UA does not — it provides the culture and gold from trade routes, but not the science and faith. I read elsewhere that the code for Morocco's UA should be able to handle any yield, but that doesn't seem to be the case.

    If there isn't a simple fix for this would I be able to use Lua and GameEvents.PlayerDoTurn to count the number of active trade routes and then add that much science/faith?
     
  3. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,518
    Location:
    Illinois, USA
    It's been long enough now that I cannot honestly remember if Trait_YieldChangesPerTradePartner implements for yields other than those used by Firaxis for Morocco. By the time BNW was released there were a bunch of tables like that which only implanted effects for certain specific yields, mostly because the developers had to prioritize getting the Expac code working rather than modding friendlyness.

    You could use lua to accomplish the result but a player's trade-routes in lua are held within an lua table that you would have to iterate through to determine which are international, which local, and then do the same for other players whose trade routes might be destinationed to a city within your civ's empire.
     
  4. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    21
    Gender:
    Male
    Location:
    Canada
    This post seems to indicate that any yield should work for the Trait.... I'll do some more testing.
     
  5. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,518
    Location:
    Illinois, USA
    Okay, yeah.
    Code:
    Trait_YieldChangesPerTradePartner
    This is only given for each trading partner.. So if a player has 100 trade routes with the same civilization, they only get the bonus once. I don't remember now if it is dumped into the capital or just assigned directly at empire level and so only shows on the top ribbon of the User Interface.
    Code:
    <Trait_YieldChangesIncomingTradeRoute>
    Is applied to the other player, not the one owning the specified trait.
     
  6. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    21
    Gender:
    Male
    Location:
    Canada
    Yeah, I was keeping an eye on it and my Faith and Science weren't increasing, whereas my Gold (obviously) and Culture (notably) were. May be the case that you were right and the other poster was mistaken. I think for now I'm just going to rework the UA a bit (perhaps extend trade route lengths or some such instead using a dummy building, since I know how to work with those now... I wonder, would adding the harbour's sea route extension to a dummy building cause issues for landlocked cities — or would it simply not come into play?)
     
  7. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,518
    Location:
    Illinois, USA
    It shouldn't harm anything. Traits FreeBuilding pays attention to terrain restrictions within the definition of a building, so you could give a coastal city variant of a dummy building via FreeBuilding in table Traits. Dido (?) does not get harbor buildings in landlocked cities. MinAreaSize of "10" in table Buildings is what signals the game that the city must be a coastal city located on an actual sea/ocean rather than a largish lake. 9 tiles is the maximum size of a lake, set by a GameDefine parameter, so 10 for MinAreaSize indicates that the size of the sea body has to be larger than the max size for a lake.
     
  8. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    21
    Gender:
    Male
    Location:
    Canada
    Should add that I've done a little testing and it appears to work as is, with the dummy building just using the land trade route extension from the Caravansary xml and the sea trade route extension from the Harbour xml. (No min area size set or anything.)
     

Share This Page