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

Dummy Amenity Building start in city center?

Discussion in 'Mod Creation Help' started by SlySlySly, Mar 23, 2017.

  1. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    I was wondering how it would be done to make a building that isn't really there, more of like a non-existent existing building. It would boost amenities by 3.
    I realized that might have been confusing, so let me explain clearly.
    1. It's a building in city center
    2. It starts in all cities, not needed to be built
    3. It boosts amenities by 3
    4. It doesn't take up the custom building slot in a civilization.
    5. It either doesn't show up in city menu, or says something like "Amenity Boost"
    6. It is a part of a civilization's trait

    Does anyone know...
    a. it is possible
    b. how to do it
     
  2. Gleb Bazov

    Gleb Bazov Warlord

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    The following code will do what you want it to do.

    Code:
    INSERT INTO Types (Type, Kind) VALUES
    ('TRAIT_BUILDING_EXTRA_AMENITIES', 'KIND_TRAIT');
    
    INSERT INTO Traits (TraitType, Name, Description) VALUES
    ('TRAIT_BUILDING_EXTRA_AMENITIES', 'Extra Starting City Amenities Trait', 'Trait that confers extra starting amenities to each city.');
    
    INSERT INTO CivilizationTraits (CivilizationType, TraitType) VALUES
    ('CIVILIZATION_EGYPT', 'TRAIT_BUILDING_EXTRA_AMENITIES');
    
    INSERT INTO Types (Type, Kind) VALUES ('BUILDING_EXTRA_AMENITIES', 'KIND_BUILDING');
    
    INSERT INTO Buildings (BuildingType, Name, Cost, PrereqDistrict, Entertainment, MustPurchase, TraitType) VALUES
    ('BUILDING_EXTRA_AMENITIES', 'Amenity Boost', 1, 'DISTRICT_CITY_CENTER', 3, 1, "TRAIT_BUILDING_EXTRA_AMENITIES");
    
    INSERT INTO CivilopediaPageExcludes (SectionId, PageId) VALUES ('BUILDINGS', 'BUILDING_EXTRA_AMENITIES');
    
    INSERT INTO DistrictModifiers (DistrictType, ModifierId) VALUES
    ('DISTRICT_CITY_CENTER', 'BUILDING_EXTRA_AMENITIES_MODIFIER');
    
    INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
    ('BUILDING_EXTRA_AMENITIES_MODIFIER', 'MODIFIER_SINGLE_CITY_GRANT_BUILDING_IN_CITY', 0, 1, NULL, NULL);
    
    INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES
    ('BUILDING_EXTRA_AMENITIES_MODIFIER', 'BuildingType', 'ARGTYPE_IDENTITY', 'BUILDING_EXTRA_AMENITIES', NULL, NULL);
    It will place a dummy building in each City Center once the city is founded, and the city will gain +3 amenities from entertainment through that building. It does not need to be built. It is automatically placed. It is part of (here) CIVILIZATION_EGYPT's trait, and only Egypt's cities will get it, even though the modifier placing this dummy building is tied directly to DISTRICT_CITY_CENTER. No other civilization will get it. I've put in Amenity Boost as the name of the building and left it without a description. I've also put in an exclusion for Civilopedia purposes, so it shouldn't show up there.

    There is no such thing as a "custom building slot" in Civ VI. A civilization can have as many custom buildings as you desire. From 0 to a 100.

    I gave some thought to doing what you want to do without a dummy building, but I see no obvious way of doing this. The Modifiers/Effects dealing with amenities are woefully limited.

    Attached is the SQL file with the relevant Insert statements. If you need a complete mod, let me know.
     

    Attached Files:

    Doomturtle likes this.
  3. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,690
    Gender:
    Male
    Location:
    Warsaw
  4. Gleb Bazov

    Gleb Bazov Warlord

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    Yes, there is. By doing the following:

    (1) Requiring that the building must be purchased (and therefore cannot be built); and,

    (2) Specifying NO purchase yield (i.e. not amount in gold or faith) for the building,

    The oucome is that:

    (a) The building CANNOT be built in regular course (and does not show up in the Build List of any city); and,

    (b) the building CANNOT be purchased for faith or gold (and does not show in the Purchase Lists (Faith, Gold) of any city).

    As a result, the building is as close to a dummy building as possible. Add to that the exclusion of the dummy building from the Civilopedia, and the result is as unobtrusive as possible.
     
    Infixo likes this.
  5. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    Most of my civilization is coded with xml. Will this work with that? Is it compatible. And thanks for getting this done so fast. Thanks for the help.
     
  6. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    How would I put this into a civilization. The civ is called Raitorozu. Do I just put it in with the mod in the folder?
     
  7. Gleb Bazov

    Gleb Bazov Warlord

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    Hey. Send me your entire mod. I'll help you out this time around. But there are excellent tutorials on SQL (from Issau, for example). Take a look around. Meanwhile, please upload your mod here.
     
  8. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    Well yo mah bro! Hey ya' go!
     

    Attached Files:

    Gleb Bazov likes this.
  9. Gleb Bazov

    Gleb Bazov Warlord

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    I'll get back to you.
     
  10. Gleb Bazov

    Gleb Bazov Warlord

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    Sly, do you not have a MODINFO? You need it to integrate your mod with the game. And I can't easily integrate my code with yours without a MODINFO file. I would either have to convert all of my code into XML or all of your code into SQL :)) Daunting....
    I can give you a simple MODINFO, but you have so many files (and some that appear to be duplicates? or deprecated chunks?). How do you want to integrate my code with yours? Do you have a standard convention for naming the traits? I can tailor it more or less, but let me know. Anyways, I can give you a simple MODINFO with a unique MOD Id and integrate my component into it, but you would need to integrate the rest of your files (there are good tutorials on this website). It's not hard, you would just need to list the files appropriately for the load order.
     
  11. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    6,935
    Location:
    Illinois, USA
    1. There is no such thing as FEATURE_RAINFOREST. It is FEATURE_JUNGLE. You have FEATURE_RAINFOREST in the civilization file for start biases.
    2. Your civilization file has a <GameInfo> opener tag but no </GameInfo> closer tag.
    3. No such thing as YIELD_AMMENITIES. Ammenities are stated as column Entertainment within table <Buildings> rather than as a YieldChange in table <Building_YieldChanges>
      Code:
        <Building_YieldChanges>
          <Row BuildingType="BUILDING_ROZUPAGODA" YieldChange="2" YieldType="YIELD_SCIENCE"/>
         <Row BuildingType="BUILDING_ROZUPAGODA" YieldChange="1" YieldType="YIELD_AMMENITIES"/>
        </Building_YieldChanges>
    4. Your other files have that weird encoding thing where notepad can't see the line ends so I didn't look at anything in the other files. (there actually isn't necessarily anything wrong with such files, it is just that Notepad gets confused by the line-return codes)
     
    Gleb Bazov likes this.
  12. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    First of all, the weird files are something my Mac is doing on it's own. My lack of .modinfo is mainly due to the fact I was using a Mac. If you do end up doing it, I prefer xml because I have a decent xml editor on my Mac. I believe you only technically have to do the .xml files....? I'm rather new at this, so I apologize for the strange things in the code... :blush:
     
  13. Gleb Bazov

    Gleb Bazov Warlord

    Joined:
    Feb 13, 2017
    Messages:
    176
    Gender:
    Male
    Hey, Sly, I have something new for you. A new and cleaner method of getting your result. The following will get you 3 starting amenities for every city of the civilization with the trait (in this case, I used CIVILIZATION_EGYPT as a placeholder), but _without_ the need for the awkward dummy building to trigger it. There is one caveat -- the amenities will appear on the City Report Screen as "Amenities From City States", but no city state suzerainty is required, and who really cares what it looks like on a UI report screen. The functionality is all the same. But, no need for the dummy building.

    Code:
    INSERT INTO Types (Type, Kind) VALUES
    ('TRAIT_EXTRA_STARTING_AMENITIES', 'KIND_TRAIT');
    
    INSERT INTO Traits (TraitType, Name, Description) VALUES
    ('TRAIT_EXTRA_STARTING_AMENITIES', 'LOC_TRAIT_EXTRA_STARTING_AMENITIES_NAME', 'LOC_TRAIT_EXTRA_STARTING_AMENITIES_DESCRIPTION');
    
    INSERT INTO CivilizationTraits (CivilizationType, TraitType) VALUES
    ('CIVILIZATION_EGYPT', 'TRAIT_EXTRA_STARTING_AMENITIES');
    
    INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES
    ('TRAIT_EXTRA_STARTING_AMENITIES', 'GRANT_EXTRA_STARTING_AMENITIES_MODIFIER');
    
    INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
    ('GRANT_EXTRA_STARTING_AMENITIES_MODIFIER', 'MODIFIER_PLAYER_CITIES_ADJUST_CITY_AMENITIES_FROM_CITY_STATES', 0, 1, NULL, NULL);
    
    INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES
    ('GRANT_EXTRA_STARTING_AMENITIES_MODIFIER', 'Amount', 'ARGTYPE_IDENTITY', 3, NULL, NULL);
    The following is the implementation of the SQL statements in regular XML format. You can insert this into the rest of your code now as you see fit. All these entries are required for this trait to work. If you change any names/monikers, make sure you update all the instances. Anyways, now you are free to use this at your pace. Good luck!

    Code:
    <GameInfo>
        <Types>
            <Row Type="TRAIT_EXTRA_STARTING_AMENITIES" Kind="KIND_TRAIT"/>
        </Types>
        <Traits>
            <Row TraitType="TRAIT_EXTRA_STARTING_AMENITIES" Name="LOC_TRAIT_EXTRA_STARTING_AMENITIES_NAME" Description="LOC_TRAIT_EXTRA_STARTING_AMENITIES_DESCRIPTION"/>
        </Traits>
        <CivilizationTraits>
            <Row CivilizationType="CIVILIZATION_EGYPT" TraitType="TRAIT_EXTRA_STARTING_AMENITIES"/>
        </CivilizationTraits>
        <TraitModifiers>
            <Row>
                <TraitType>TRAIT_EXTRA_STARTING_AMENITIES</TraitType>
                <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
            </Row>
        </TraitModifiers>
        <Modifiers>
            <Row>
                <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
                <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_CITY_AMENITIES_FROM_CITY_STATES</ModifierType>
            </Row>
        </Modifiers>
        <ModifierArguments>
            <Row>
                <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
                <Name>Amount</Name>
                <Value>3</Value>
            </Row>
        </ModifierArguments>
    </GameInfo>
     
    SlySlySly likes this.
  14. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    Wow! Thanks for this! Really makes my life much easier!
     
  15. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    I copied it in like this:
    Code:
    <GameInfo>
      <Types>
        <Row Kind="KIND_CIVILIZATION" Type="CIVILIZATION_RAITOROZU"/>
    
        <Row Kind="KIND_TRAIT" Type="TRAIT_CIVILIZATION_JIZEN"/>
    
        <Row Kind="KIND_TRAIT" Type="TRAIT_CIVILIZATION_BUILDING_ROZUPAGODA"/>
    
        <Row Kind="KIND_TRAIT" Type="TRAIT_CIVILIZATION_UNIT_SERINGUDEZU"/>
      </Types>
      <Civilizations>
        <Row Adjective="LOC_CIVILIZATION_RAITOROZU_ADJECTIVE"
             CivilizationType="CIVILIZATION_RAITOROZU"
             Description="LOC_CIVILIZATION_RAITOROZU_DESCRIPTION"
             Ethnicity="ETHNICITY_ASIAN" Name="LOC_CIVILIZATION_RAITOROZU_NAME"
             RandomCityNameDepth="3"
             StartingCivilizationLevelType="CIVILIZATION_LEVEL_FULL_CIV"/>
      </Civilizations>
      <CivilizationLeaders>
        <Row CapitalName="RAITOROZU CITY" CivilizationType="CIVILIZATION_RAITOROZU"
             LeaderType="LEADER_AKANE"/>
      </CivilizationLeaders>
      <Traits>
        <Row Description="LOC_TRAIT_CIVILIZATION_JIZEN_DESCRIPTION"
             Name="LOC_TRAIT_CIVILIZATION_JIZEN_NAME"
             TraitType="TRAIT_CIVILIZATION_JIZEN"/>
    
        <Row Description="LOC_BUILDING_ROZUPAGODA_DESCRIPTION"
             Name="LOC_BUILDING_ROZUPAGODA_NAME"
             TraitType="TRAIT_CIVILIZATION_BUILDING_ROZUPAGODA"/>
    
        <Row Description="LOC_UNIT_SERINGUDEZU_DESCRIPTION"
             Name="LOC_UNIT_SERINGUDEZU_NAME"
             TraitType="TRAIT_CIVILIZATION_UNIT_SERINGUDEZU"/>
      </Traits>
      <CivilizationTraits>
            <Row CivilizationType="CIVILIZATION_RAITOROZU" TraitType="TRAIT_KAGAKU"/>
        </CivilizationTraits>
        <TraitModifiers>
              <Row>
                <TraitType>TRAIT_KAGAKU</TraitType>
                <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
            </Row>
        </TraitModifiers>
        <Modifiers>
            <Row>
                <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
                <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_CITY_AMENITIES_FROM_CITY_STATES</ModifierType>
            </Row>
        </Modifiers>
        <ModifierArguments>
            <Row>
                <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
                <Name>Amount</Name>
                <Value>3</Value>
            </Row>
        </ModifierArguments>
      <StartBiasFeatures>
        <Row CivilizationType="CIVILIZATION_RAITOROZU"
             FeatureType="FEATURE_JUNGLE" Tier="1"/>
      </StartBiasFeatures>
      <StartBiasRivers>
        <Row CivilizationType="CIVILIZATION_RAITOROZU" Tier="4"/>
      </StartBiasRivers>
      <CityNames>
        <Row CityName="Raitorozu City" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Rozezu Ichi" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Kuraudogaden" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Miyakojima" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Shizukesa" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Minatocho" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Umi No Hoseki" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Kawasaki" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Ustukushi Mura" CivilizationType="CIVILIZATION_RAITOROZU"/>
        <Row CityName="Ishigaki" CivilizationType="CIVILIZATION_RAITOROZU"/>
       </CityNames>
    </GameInfo>
    Does this seem like it would work?
     
  16. CivilizationAce

    CivilizationAce Warlord

    Joined:
    Jan 17, 2017
    Messages:
    236
    Gender:
    Male
    If I added a requirement using REQUIREMENT_CITY_HAS_BUILDING to the modifier and made the required building BUILDING_PALACE would that make this only provide the dummy building to the capital when it's first founded?

    Or would the palace not exist at the point at which it tried to run?
     

Share This Page