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. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Hi all,
    So I want to make a mod civ with a building that gives a small amount of influence per turn with a city state that you have a trade route with. Trouble is, I have no idea how to go about this.

    I've noticed, however, that basically the same thing exists as a policy in Vox Populi in their new social policy tree that replaces patronage.

    Does anyone know 1) whether I can give this property to a building, and 2) whether I would need to change the DLL to do it (as that would be a "redesign to avoid doing that" sort of issue)?

    I have no LUA experience but would be willing to learn if that's the only option (say, tying it to a hidden policy or some such thing). I haven't actually been able to find the relevant section in the code for VP, unfortunately.

    Can anyone help me out?
     
  2. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    So I did some more digging through VP and it seems it may be related to "ProtectedMinorPerTurnInfluence", which led me to remembering that there's a tenet in "Freedom" that does exactly what I want. So, luckily it seems it's not made out of whole cloth by the authors of VP, which is nice.

    So it seems like what I would have to do is make a hidden/dummy policy that is somehow tied to the building I want to make. Anyone know of a way to do this, or a guide that pertains to it? I am not entirely clear on whether you'd be able to limit it to the city with the building in question. Would there be a way to tell the game to do that? Or if not, is there a way to limit a building to only being built in the capital (I imagine I'd need to make it act like a national wonder or some such)?
     
  3. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    You cannot directly tie a building to a policy. You would have to write an lua script that would execute when the building was completed, and which would add the policy to the player. The effects of Policies are always global : ie, they effect the entire empire that selects or is given the policy.

    You would not be able to restrict the effect of the policy only to the city that created the building. And since a player cannot have more than one copy of the same policy, it would be better to make the building act like a National Wonder in the sense that only one can exist within an empire at the same time
    Code:
    Table -- BuildingClasses
    Column -- MaxPlayerInstances
     
  4. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Thanks for the tip on how to make it behave like a national wonder. That should be simple to implement. Is inserting this into <GameData> sufficient?
    Code:
    <BuildingClasses>
       <MaxPlayerInstances>1</MaxPlayerInstances>
    </BuildingClasses>
    I've done some reading (namely, this) and so it seems like I would have to define the dummy/hidden policy in xml, pulling from the existing options there (which is no problem as the exact effect I want exists there), then give the player the policy using the free policy trick.

    However, as I have no experience with Lua at all, I have no idea how I would link this to the construction of the building. I've looked through this with much confusion and didn't see anything that appeared relevant. I've also looked at the Dummy Buildings tutorial thread but that has an example of the opposite of what I'm looking to do (giving a building using Lua instead of having the Lua trigger as a result of the building being built).

    EDIT: Would this be the thing to use?

    Is there a simple way to do this? (Do any examples come to mind?) Or might I have to create a script that checks every turn for the presence of the building, then if the policy has been implemented, else implement the policy?
     
    Last edited: Jan 7, 2020
  5. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    Regarding the xml code-sample: no.

    Here is an example of adding a new national wonder to the game. It is entirely XML coding and is not doing anything wrt to lua, but the structure of how to add a <MaxPlayerInstances>1</MaxPlayerInstances> BuildingClass is relevant. IE, see how table <BuildingClasses> is structured, and how that relates to columns <Type> and <BuildingClass> within the <Buildings> table. The rest of code example may not be directly relevant but does show one example of how a new national wonder-type building can be structured.
    Spoiler borrowed from an old Justice and Government Buildings Mod by kiwusek :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created by ModBuddy on 10/2/2013 12:35:34 AM -->
    <GameData>
    	<BuildingClasses>
    		<Row>
    			<Type>BUILDINGCLASS_NATIONAL_CONGRESS</Type>
    			<DefaultBuilding>BUILDING_NATIONAL_CONGRESS</DefaultBuilding>
    			<Description>TXT_KEY_BUILDING_NATIONAL_CONGRESS</Description>
    			<MaxPlayerInstances>1</MaxPlayerInstances>
    		</Row>
    	</BuildingClasses>
    	<Buildings>
    		<Row>
    			<Type>BUILDING_NATIONAL_CONGRESS</Type>
    			<BuildingClass>BUILDINGCLASS_NATIONAL_CONGRESS</BuildingClass>
    			<Cost>1200</Cost>
    			<GoldMaintenance>0</GoldMaintenance>
    			<PrereqTech>TECH_ARCHITECTURE</PrereqTech>
    			<Description>TXT_KEY_BUILDING_NATIONAL_CONGRESS</Description>
    			<Civilopedia>TXT_KEY_BUILDING_NATIONAL_CONGRESS_DESC</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_NATIONAL_CONGRESS_STRATEGY</Strategy>
    			<Help>TXT_KEY_BUILDING_NATIONAL_CONGRESS_HELP</Help>
    			<ArtDefineTag>ART_DEF_BUILDING_WRITERS_GUILD</ArtDefineTag>
    			<GreatPeopleRateChange>1</GreatPeopleRateChange>
    			<NukeImmune>true</NukeImmune>
    			<MinAreaSize>-1</MinAreaSize>
    			<ConquestProb>100</ConquestProb>
    			<FreePolicies>1</FreePolicies>
    			<Happiness>3</Happiness>
    			<HurryCostModifier>-1</HurryCostModifier>
    			<IconAtlas>JUSTGOV_ATLAS_1</IconAtlas>
    			<PortraitIndex>9</PortraitIndex>
    		</Row>
    	</Buildings>
    	<Building_ClassesNeededInCity>
    		<Row>
    			<BuildingType>BUILDING_NATIONAL_CONGRESS</BuildingType>
    			<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
    		</Row>
    	</Building_ClassesNeededInCity>
    	<Building_Flavors>
    		<Row>
    			<BuildingType>BUILDING_NATIONAL_CONGRESS</BuildingType>
    			<FlavorType>FLAVOR_HAPPINESS</FlavorType>
    			<Flavor>50</Flavor>
    		</Row>
    		<Row>
    			<BuildingType>BUILDING_NATIONAL_CONGRESS</BuildingType>
    			<FlavorType>FLAVOR_EXPANSION</FlavorType>
    			<Flavor>50</Flavor>
    		</Row>
    		<Row>
    			<BuildingType>BUILDING_NATIONAL_CONGRESS</BuildingType>
    			<FlavorType>FLAVOR_WONDER</FlavorType>
    			<Flavor>20</Flavor>
    		</Row>
    	</Building_Flavors>
    	<Building_YieldChanges>
    		<Row>
    			<BuildingType>BUILDING_NATIONAL_CONGRESS</BuildingType>
    			<YieldType>YIELD_GOLD</YieldType>
    			<Yield>3</Yield>
    		</Row>
    	</Building_YieldChanges>
    	<Language_en_US>
    		<Row Tag="TXT_KEY_BUILDING_NATIONAL_CONGRESS">
    			<TEXT>
    				National Congress
    			</TEXT>
    		</Row>
    		<Row Tag="TXT_KEY_BUILDING_NATIONAL_CONGRESS_HELP">
    			<TEXT>
    				The National Congress grants 1 Free Social Policy when built and provides a bonus of +3 [ICON_HAPPINESS_1] Happiness and +3 [ICON_GOLD].
    			</TEXT>
    		</Row>
    		<Row Tag="TXT_KEY_BUILDING_NATIONAL_CONGRESS_STRATEGY">
    			<TEXT>
    				Building the National Congress increases the [ICON_HAPPINESS_1] and [ICON_GOLD] Production of a city as well as granting a Free Social Policy.
    			</TEXT>
    		</Row>
    		<Row Tag="TXT_KEY_BUILDING_NATIONAL_CONGRESS_DESC">
    			<Text>
    				In time the demands of the masses were heard and most states adopted, even if only nominally, a legislative body. In democracies, these legislative bodies became the political centres of the nation - one of three branches of Government. However, they were adopted by many authoritarian states where they only served to rubber stamp the decisions of the real power players - the dominant party or elite.
    			</Text>
    		</Row>
    	</Language_en_US>
    </GameData>
     
  6. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    There is an lua "hook" event which triggers whenever a building is completed:
    Code:
    GameEvents.CityConstructed(PlayerID, cityId, buildingType, bGold, bFaithOrCulture)
    An lua function can be added to this Game Event as a "listener" and the argument data will be provided to any such function assigned as a listener. So:
    Code:
    local iMyBuilding = GameInfoTypes["BUILDING_X"]
    function MyBuldingCompletedListener(PlayerID, cityId, buildingType, bGold, bFaithOrCulture)
    	if buildingType == iMyBuilding then
    		print("My building called BUILDING_X was constructed by player # " .. PlayerID)
    		print("The city ID # for the player's city that constructed BUILDING_X was " .. cityId)
    	end
    end
    GameEvents.CityConstructed.Add(MyBuldingCompletedListener)
     
  7. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Thank you! I think I've got the xml down, now.

    EDIT: Ignore this bit... I assume I implement the listener and then use the GameEvents as part of a function? Or is my lack of programming knowledge making me miss something crucial? And should I name it something more unique than "mybuildingcompletedlistener", or is there not the issue with unique names in Lua?

    Would something like this work to trigger the policy, provided I've already defined the policy in the xml? EDIT ad infinitum: is this how I might implement it? Or does it have to be a separate function?
    Code:
    local pPlayer = Player[iPlayer]
    local iMyBuilding = GameInfoTypes["NCLJ_RITO_POST_OFFICE"]
    function MyBuldingCompletedListener(PlayerID, cityId, buildingType, bGold, bFaithOrCulture)
       if buildingType == iMyBuilding then
           print("My building called NCLJ_RITO_POST_OFFICE was constructed by player # " .. PlayerID)
           print("The city ID # for the player's city that constructed NCLJ_RITO_POST_OFFICE was " .. cityId)
           --sets the policy to be active
           pPlayer:SetNumFreePolicies(1)
           pPlayer:SetNumFreePolicies(0)
           pPlayer:SetHasPolicy(GameInfoTypes["NCLJ_POST_OFFICE_DUMMY"], true)
           print("Dummy policy is now active.")
       end
    end
    GameEvents.CityConstructed.Add(MyBuldingCompletedListener)
    
     
    Last edited: Jan 7, 2020
  8. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    You can't define the player object outside of the function, primarily because there would be no "value" assigned to "iPlayer". Secondly, the special lua table is called "Players" not "Player".
    Code:
    local iMyBuilding = GameInfoTypes["NCLJ_RITO_POST_OFFICE"]
    function MyBuldingCompletedListener(PlayerID, cityId, buildingType, bGold, bFaithOrCulture)
    	if buildingType == iMyBuilding then
    		print("My building called NCLJ_RITO_POST_OFFICE was constructed by player # " .. PlayerID)
    		print("The city ID # for the player's city that constructed NCLJ_RITO_POST_OFFICE was " .. cityId)
    		--sets the policy to be active
    		local pPlayer = Players[PlayerID]
    		pPlayer:SetNumFreePolicies(1)
    		pPlayer:SetNumFreePolicies(0)
    		pPlayer:SetHasPolicy(GameInfoTypes["NCLJ_POST_OFFICE_DUMMY"], true)
    		print("Dummy policy is now active.")
    	end
    end
    GameEvents.CityConstructed.Add(MyBuldingCompletedListener)
    Note that the variable "PlayerID" needs to match to whatever you call the argument on the line that defines the function.

    I could just as well have coded as
    Code:
    local iMyBuilding = GameInfoTypes["NCLJ_RITO_POST_OFFICE"]
    function MyBuldingCompletedListener(A, B, C, D, E)
    	if C == iMyBuilding then
    		print("My building called NCLJ_RITO_POST_OFFICE was constructed by player # " .. A)
    		print("The city ID # for the player's city that constructed NCLJ_RITO_POST_OFFICE was " .. B)
    		--sets the policy to be active
    		local pPlayer = Players[A]
    		pPlayer:SetNumFreePolicies(1)
    		pPlayer:SetNumFreePolicies(0)
    		pPlayer:SetHasPolicy(GameInfoTypes["NCLJ_POST_OFFICE_DUMMY"], true)
    		print("Dummy policy is now active.")
    	end
    end
    GameEvents.CityConstructed.Add(MyBuldingCompletedListener)
    But as a general rule this is not a good idea because it is not always so obvious when trouble-shooting or adding enhancements to code what exactly the Variable "A" is representing. If we call that argument variable "PlayerID" it's easier to understand that we are dealing with a player ID # from the special lua "Players" table for the civilizations that are actually part of a given game.

    You can re-use the name of a function any number of times in different lua scripts -- the game does not confuse function "MyBuldingCompletedListener" from FileNameA with an equivalently-named function in FileNameB. You should just never have multiple different versions of a function called "MyBuldingCompletedListener" within a single file, as only the last (lowest-down in the file) of these will be used.

    ----------------------------------------

    Other than the one mistake with defining the "pPlayer" variable outside the function, you were coding correctly. The Construction of the specified building will trigger the code to execute and give the player the policy.
     
  9. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Thank you so much for your help! I will do some testing tomorrow and see if I can get it working in-game.
     
  10. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
  11. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Haven't been able to test yet, but as a point of interest, would I need to use the override discussed here to lock-out barbs and CSs from making the building? Or is this only necessary when its a wonder intended to be built by any civ? If I have the bit in my "Civilization.xml" with <Civlization_BuildingClassOverrides> filled in, is that sufficient? Will other civs just not be able to "see" the building as buildable?
     
  12. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    You always need to lock out barbarians, and sometimes lock out city-states, from constructing anything from within a BuildingClass unless you make the default building within the class unbuildable. A BuildingClass must always have a default building that fits within its Class. If you use table <Civlization_BuildingClassOverrides> to make your new building unique to a particular civilization, then you need to also provide the game with a Default Building everyone else is seen as qualifying for whenever you add an entirely new class of buildings to the game. You can make the Default Building act essentially as an unobtainable dummy simply by setting its <Cost> to -1.
     
  13. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Ah, thank you! All the previous buildings I've made for mods have been replacing an existing one, so I've never run into this before. I assume it's fine to have both the dummy and the actual building in the same xml file, provided I have them in separate "<Row>" tags under <Buildings>?
     
  14. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    Yes. See the game's base files. So far as the game is concerned a building is a building is a building -- it does not know about nor implement any differently buildings we define and use as "dummies".
     
  15. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Finally able to test it. Hit a snag, though. Something appears to be wrong with the building, but nothing is showing up in the database or Lua logs. (It is the only mod active.)

    The building isn't showing up in the civ selection screen (causing the can't-scroll thing), but it briefly appears in the DoM card thing -- but only the icon (which is the correct custom icon), not the name -- and it disappears as it moves to the middle of the screen when loading is completed.

    The tech tree is also broken? It has no scroll bar and won't move via scrolling with my mouse wheel.

    This post by whoward indicates that maybe it's because the tech has too many things in it? The building was intended to be unlocked at Printing Press. Gonna check if switching it to something like Rifling (since it just has the one thing in it) fixes it... EDIT: So switching it to rifling did not fix it, but it did allow me to have a list of techs to choose from in the side bar (the full tech tree is still broken and stuck -- I notice there is a little empty rectangle that shouldn't be there); so it's definitely something to do with the building itself. I thought it might have been because I had NULL in the prereq for the dummy but changing it to be the same as the actual building didn't fix anything.

    I figure providing the xml for the building might be helpful...
    Code:
    <GameData>
      <BuildingClasses>
          <Row>
              <Type>BUILDINGCLASS_NCLJ_RITO_POST_OFFICE</Type>
              <DefaultBuilding>BUILDING_NCLJ_RITO_DUMMY</DefaultBuilding>
              <Description>TXT_KEY_BUILDING_NCLJ_RITO_POST_OFFICE</Description>
              <MaxPlayerInstances>1</MaxPlayerInstances>
          </Row>
      </BuildingClasses>
      <Buildings>
        <Row>
            <Type>BUILDING_NCLJ_RITO_DUMMY</Type>
            <BuildingClass>BUILDINGCLASS_NCLJ_RITO_POST_OFFICE</BuildingClass>
            <Cost>-1</Cost>
            <PrereqTech>TECH_PRINTING_PRESS</PrereqTech>
            <GreatWorkCount>-1</GreatWorkCount>
            <FaithCost>-1</FaithCost>
            <MinAreaSize>-1</MinAreaSize>
            <NeverCapture>true</NeverCapture>
            <NukeImmune>true</NukeImmune>
            <PortraitIndex>19</PortraitIndex>
            <IconAtlas>BW_ATLAS_1</IconAtlas>
            <Description>TXT_KEY_BUILDING_NCLJ_RITO_DUMMY</Description>
        </Row>
        <Row>
          <Type>BUILDING_NCLJ_RITO_POST_OFFICE</Type>
          <Civilopedia>TXT_KEY_CIV5_BUILDINGS_NCLJ_RITO_POST_OFFICE_TEXT</Civilopedia>
          <Strategy>TXT_KEY_BUILDING_NCLJ_RITO_POST_OFFICE_STRATEGY</Strategy>
          <Help>TXT_KEY_BUILDING_NCLJ_RITO_POST_OFFICE_HELP</Help>
          <MutuallyExclusiveGroup>-1</MutuallyExclusiveGroup>
          <Cost>200</Cost>
          <HurryCostModifier>25</HurryCostModifier>
          <MinAreaSize>-1</MinAreaSize>
          <ConquestProb>0</ConquestProb>
          <NumTradeRouteBonus>2</NumTradeRouteBonus>
          <BuildingClass>BUILDINGCLASS_NCLJ_RITO_POST_OFFICE</BuildingClass>
          <ArtDefineTag>ART_DEF_BUILDING_NCLJ_RITO_POST_OFFICE</ArtDefineTag>
          <PrereqTech>TECH_PRINTING_PRESS</PrereqTech>
          <SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
          <SpecialistCount>1</SpecialistCount>
          <GreatWorkCount>0</GreatWorkCount>
          <PortraitIndex>0</PortraitIndex>
          <IconAtlas>NCLJ_POST_OFFICE_ATLAS</IconAtlas>
        </Row>
      </Buildings>
      <Building_Flavors>
        <Row>
          <BuildingType>BUILDING_NCLJ_RITO_POST_OFFICE</BuildingType>
          <FlavorType>FLAVOR_I_LAND_TRADE_ROUTE</FlavorType>
          <Flavor>10</Flavor>
        </Row>
        <Row>
            <BuildingType>BUILDING_NCLJ_RITO_POST_OFFICE</BuildingType>
            <FlavorType>FLAVOR_GOLD</FlavorType>
            <Flavor>10</Flavor>
        </Row>
        <Row>
            <BuildingType>BUILDING_NCLJ_RITO_POST_OFFICE</BuildingType>
            <FlavorType>FLAVOR_GREAT_PEOPLE</FlavorType>
            <Flavor>10</Flavor>
        </Row>
        <Row>
          <BuildingType>BUILDING_NCLJ_RITO_POST_OFFICE</BuildingType>
          <FlavorType>FLAVOR_I_TRADE_ORIGIN</FlavorType>
          <Flavor>10</Flavor>
        </Row>
      </Building_Flavors>
     
      <Language_en_US>
        <Row Tag="TXT_KEY_BUILDING_NCLJ_RITO_DUMMY">
          <Text>Dummy to implement post office for the Rito.</Text>
        </Row>
        <Row Tag="TXT_KEY_BUILDING_NCLJ_RITO_POST_OFFICE">
          <Text>Central Post Office</Text>
        </Row>
        <Row Tag="TXT_KEY_CIV5_BUILDINGS_NCLJ_RITO_POST_OFFICE_TEXT">
          <Text><!-- Add Civilopedia text here --></Text>
        </Row>
        <Row Tag="TXT_KEY_BUILDING_NCLJ_RITO_POST_OFFICE_STRATEGY">
          <Text>The Central Post Office is the Rito Unique Building. It provides +3 [ICON_INFLUENCE] Influence per turn for City States that are connected to the city with a Trade Route. It also provides 2 additional trade routes. Only one may be constructed in your empire.</Text>
        </Row>
        <Row Tag="TXT_KEY_BUILDING_NCLJ_RITO_POST_OFFICE_HELP">
          <Text>Trade routes originating from cities in your empire provide +3 [ICON_INFLUCNE] Influence per turn when connecting to City States. Provides 2 additional trade routes. Has a Merchant Specialist slot. Only one may be constructed in your empire. Available at Printing Press.[NEWLINE][NEWLINE]Only the Rito may build it.</Text>
        </Row>
      </Language_en_US>
    </GameData>
    
    Is this a known issue?
     
    Last edited: Jan 9, 2020
  16. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
    Code:
        <Row>
            <Type>BUILDING_NCLJ_RITO_DUMMY</Type>
            <BuildingClass>BUILDINGCLASS_NCLJ_RITO_POST_OFFICE</BuildingClass>
            <Cost>-1</Cost>
            <PrereqTech>TECH_PRINTING_PRESS</PrereqTech>
            <GreatWorkCount>-1</GreatWorkCount>
            <FaithCost>-1</FaithCost>
            <MinAreaSize>-1</MinAreaSize>
            <NeverCapture>true</NeverCapture>
            <NukeImmune>true</NukeImmune>
            <PortraitIndex>19</PortraitIndex>
            <IconAtlas>BW_ATLAS_1</IconAtlas>
            <Description>TXT_KEY_BUILDING_NCLJ_RITO_DUMMY</Description>
        </Row>
    For the dummy building, change the PrereqTech to NULL. As I recall the game's Tech Panel does not know how to deal with a building that both has a valid PrereqTech and a setting of
    Code:
    <GreatWorkCount>-1</GreatWorkCount>
    The Dummy cannot be constructed anyway so the PrerqTech is moot.

    ----------------------

    The game has no ArtDefineTag called
    Code:
    <ArtDefineTag>ART_DEF_BUILDING_NCLJ_RITO_POST_OFFICE</ArtDefineTag>
    Specify NONE instead or delete that column entirely.

    ------------------------------------------

    You have no <Description> supplied for BUILDING_NCLJ_RITO_POST_OFFICE. This lack of a <Description> will cause any number of problems for the game's User Interface files while at the same time not causing any error messages to be reported in any of the game's logging files.
     
  17. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Ah, I must have accidentally deleted it. I have made your suggested changes, and am about to test it. Thanks for all your help!

    EDIT: So adding the <Description> tag fixed the issue, and the tech tree is fixed and the building functions — or at least, the bits that don't rely on the Lua do. It doesn't actually cause the influence gain per turn... I have the InGameUIAddIn thing set for the Lua. Not sure if there's something else I'm missing. (I built the building "naturally" as you said; logs don't show any evidence of the Lua at all so I suspect I have missed something in implementing it.)
     
    Last edited: Jan 10, 2020
  18. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    This post indicates that I need a portrait for my dummy policy, so I assume that means portrait index? Maybe that might fix things... but doesn't explain why I don't see any indication of the Lua in my logs...
    The Policy xml as it stands with the portrait index added...(the policy name in the Lua was changed to reflect the name as it appears below)
    Code:
    <GameData>
        <Language_en_US>
            <Row Tag="TXT_KEY_NCLJ_POST_OFFICE_POLICY_DUMMY">
                <Text>Adds +3 Influence per turn on trade routes with city states.</Text>
            </Row>
        </Language_en_US>
        <Policies>
            <Row>
                <Type>NCLJ_POST_OFFICE_POLICY_DUMMY</Type>
                <Description>TXT_KEY_NCLJ_POST_OFFICE_POLICY_DUMMY</Description>
                <ProtectedMinorPerTurnInfluence>300</ProtectedMinorPerTurnInfluence>
                <PortraitIndex>25</PortraitIndex>
                <IconAtlas>POLICY_ATLAS</IconAtlas>
                <IconAtlasAchieved>POLICY_A_ATLAS</IconAtlasAchieved>
            </Row>
        </Policies>
    </GameData>
     
    Last edited: Jan 10, 2020
  19. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,536
    Location:
    Illinois, USA
  20. A_Wandering_Man

    A_Wandering_Man Chieftain

    Joined:
    Oct 31, 2019
    Messages:
    23
    Gender:
    Male
    Location:
    Canada
    Here it is. I really appreciate your patience and willingness to help me out.
     

    Attached Files:

Share This Page