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

(SOLVED) Bug in my reform mod. Need fast help pls.

Discussion in 'Mod Creation Help' started by Eiskalt, Feb 29, 2020.

  1. Eiskalt

    Eiskalt Chieftain

    Joined:
    Jul 28, 2013
    Messages:
    32
    I need help pls but still today. I like to make because today is the 29th of february a civ6 mod of this topic. The problem is my mod has small bugs. I get additional gold for each city but no additonal science, production and culture. Then I also have no minus annemieties. I don´t know what is in the code wrong. Pls help me still today. If you help me and solve my problem you will get 5 Euro from my Paypal. ;)

    If you are interested write a pm and I will add you in steam, skype or discord. ;)
     
  2. Eiskalt

    Eiskalt Chieftain

    Joined:
    Jul 28, 2013
    Messages:
    32
    Here is the code:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameData>
    
        <Types>
    
            <!-- Reformen -->
    
            <!-- Schaltjahrreform -->
    
            <Row Type="POLICY_SCHALTJAHRREFORMGREGORLINZ1986" Kind="KIND_POLICY" />
    
        </Types>
    
    
    
        <Policies>
    
            <!-- Reformen -->
    
            <!-- Schaltjahrreform -->
    
            <Row PolicyType="POLICY_SCHALTJAHRREFORMGREGORLINZ1986" Name="LOC_POLICY_SCHALTJAHRREFORMGREGORLINZ1986_NAME" Description="LOC_POLICY_SCHALTJAHRREFORMGREGORLINZ1986_DESCRIPTION" PrereqTech="TECH_BRONZE_WORKING" GovernmentSlotType="SLOT_ECONOMIC" />
    
    
        </Policies>
    
    
    
        <PolicyModifiers>
    
            <!-- Reformen -->
    
            <!-- Schaltjahrreform -->
    
            <Row PolicyType="POLICY_SCHALTJAHRREFORMGREGORLINZ1986" ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" />
    
        </PolicyModifiers>
    
        <Modifiers>
    
            <!-- Reformen -->
    
            <!-- Schaltjahrreform -->
    
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" ModifierType="MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_CHANGE" />
                    <Row>
                <ModifierId>SCHALTJAHRREFORMGREGORLINZ1986_AMENITYBONUS</ModifierId>
                <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY</ModifierType>
            </Row>
        </Modifiers>
    
        <ModifierArguments>
    
            <!-- Reformen -->
    
            <!-- Schaltjahrreform -->
    
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_GOLD" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_PRODUCTION" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_SCIENCE" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_CULTURE" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row>
                <ModifierId>SCHALTJAHRREFORMGREGORLINZ1986_AMENITYBONUS</ModifierId>
                <Name>Amount</Name>
                <Value>-1</Value>
            </Row>
    
        </ModifierArguments>
    
    <PolicyModifiers>
    <Row>
                <PolicyType>POLICY_SCHALTJAHRREFORMGREGORLINZ1986</PolicyType>
                <ModifierId>SCHALTJAHRREFORMGREGORLINZ1986_AMENITYBONUS</ModifierId>
            </Row>
    </PolicyModifiers>
        <ModifierStrings> <!-- Combat Modifiers -->
    
        </ModifierStrings>
    
    </GameData>
     
  3. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I don't know much about modding, but you could check all the parameters and see whether they are in the correct category regarding

    <GameData>
    </GameData>

    and

    <GameInfo>
    </GameInfo>

    For example, <Types> and <Modifiers> are in <GameInfo> not <GameData>

    I don't know whether this makes a difference.
     
  4. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    6,965
    Location:
    Illinois, USA
    GameInfo and GameData are treated the same by the game. All that matters is that <GameInfo> is closed with </GameInfo> and <GameData> is closed with </GameData>.

    The problem is here
    Code:
        <ModifierArguments>
    
            <!-- Reformen -->
    
            <!-- Schaltjahrreform -->
    
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_GOLD" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_PRODUCTION" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_SCIENCE" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_CULTURE" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1" />
    
    	............
    
        </ModifierArguments>
    You cannot repeat an argument combination of ModifierId and Name. You have four places where you have
    Code:
    <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType"
    And four places where you have
    Code:
    <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount"
    This is not allowed. The game ceases to read anything from within the file when it encounters the first of these repeats.

    Strangely enough, the game will let you do this:
    Code:
    
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_GOLD,YIELD_PRODUCTION,YIELD_SCIENCE,YIELD_CULTURE" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1,1,1,1" />
    
    Though in order for the game "parse" this mutli-argument method you may need to restructure as
    Code:
    
            <Row>
                <ModifierId>POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_GOLD,YIELD_PRODUCTION,YIELD_SCIENCE,YIELD_CULTURE</Value>
            </Row>
            <Row>
                <ModifierId>POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER</ModifierId>
                <Name>Amount</Name>
                <Value>1,1,1,1</Value>
            </Row>
    
    
    ------------------------------------

    Lastly, the game may or may not ignore the negative value here:
    Code:
        <ModifierArguments>
    
    	..........................
    
            <Row>
                <ModifierId>SCHALTJAHRREFORMGREGORLINZ1986_AMENITYBONUS</ModifierId>
                <Name>Amount</Name>
                <Value>-1</Value>
            </Row>
       </ModifierArguments>
    There are some sorts of Modifiers where a negative "Value" is ignored and either treated as a positive number or as zero.
     
  5. cvb

    cvb Prince

    Joined:
    Jun 12, 2017
    Messages:
    446
    Code:
    Strangely enough, the game will let you do this:
    
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="YieldType" Value="YIELD_GOLD,YIELD_PRODUCTION,YIELD_SCIENCE,YIELD_CULTURE" />
            <Row ModifierId="POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER" Name="Amount" Value="1,1,1,1" />
    
    Though in order for the game "parse" this mutli-argument method you may need to restructure as
    
            <Row>
                <ModifierId>POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER</ModifierId>
                <Name>YieldType</Name>
                <Value>YIELD_GOLD,YIELD_PRODUCTION,YIELD_SCIENCE,YIELD_CULTURE</Value>
            </Row>
            <Row>
                <ModifierId>POLICY_SCHALTJAHRREFORMGREGORLINZ1986_MODIFIER</ModifierId>
                <Name>Amount</Name>
                <Value>1,1,1,1</Value>
            </Row>
    So is then in SQL
    Code:
    INSERT INTO ModifierArguments (ModifierId, Name, Value)
    VALUES ("MACERATE_MINE_BONUS_JJ", "YieldType", "YIELD_FAITH,YIELD_GOLD"),
           ("MACERATE_MINE_BONUS_JJ", "Amount", "1,1");
    but not
    Code:
    INSERT INTO ModifierArguments (ModifierId, Name, Value)
    VALUES ("MACERATE_MINE_BONUS_JJ", "YieldType", "YIELD_FAITH", "YIELD_GOLD"),
           ("MACERATE_MINE_BONUS_JJ", "Amount", 1, 1);
    allowed?

    (Or both or none?)

    .
     
  6. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    6,965
    Location:
    Illinois, USA
    It must be as
    Code:
    INSERT INTO ModifierArguments (ModifierId, Name, Value)
    VALUES ("MACERATE_MINE_BONUS_JJ", "YieldType", "YIELD_FAITH,YIELD_GOLD"),
           ("MACERATE_MINE_BONUS_JJ", "Amount", "1,1");
    Tho I have not tried the method directly from an SQL file. But it should make no difference whether entered in SQL or XML so long as the syntax is correct.


    The result of a multi-yield spec gets entered into the database like this:
    ModifierId Name Type Value
    PETRA_YIELD_MODIFIER Amount ARGTYPE_IDENTITY 2,2,1
    PETRA_YIELD_MODIFIER YieldType ARGTYPE_IDENTITY YIELD_FOOD,YIELD_GOLD,YIELD_PRODUCTION
     
    cvb likes this.

Share This Page