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

Help Me understand CIV's UAs

Discussion in 'Mod Creation Help' started by Starcomet, Jul 13, 2020.

  1. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    I am using MC's CIV template and trying to understand the modifiers. Here is what I am trying to do for my Civs UA:

    ('en_US', 'LOC_TRAIT_CIVILIZATION_BUREAUCRATIC_RITUALS_NAME', 'Bureaucratic Rituals' ),
    ('en_US', 'LOC_TRAIT_CIVILIZATION_BUREAUCRATIC_RITUALS_DESCRIPTION',
    'Holy Site buildings will yield an additional +2 [ICON_favor] Diplomatic Favor and an additional +2 [ICON_Faith] Faith.' ),

    I wish for the Bureaucratic Rituals UA to add +2 Diplomatic Favor to the Holy Sites Buildings.

    INSERT INTO Modifiers
    (ModifierId, ModifierType, RunOnce, Permanent )
    VALUES ('MODIFIER_BUREAUCRATIC_RITUALS_SHRINE_YIELD', 'MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE', 0, 1 ),
    ('MODIFIER_BUREAUCRATIC_RITUALS_TEMPLE_YIELD', 'MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE', 0, 1 );

    INSERT INTO ModifierArguments
    (ModifierId, Name, Value )
    VALUES ('MODIFIER_BUREAUCRATIC_RITUALS_SHRINE_YIELD', 'BuildingType', 'BUILDING_SHRINE' ),
    ('MODIFIER_BUREAUCRATIC_RITUALS_SHRINE_YIELD', 'YieldType', 'YIELD_FOOD' ),
    ('MODIFIER_BUREAUCRATIC_RITUALS_SHRINE_YIELD', 'Amount', '2' ),
    ('MODIFIER_BUREAUCRATIC_RITUALS_TEMPLE_YIELD', 'BuildingType', 'BUILDING_TEMPLE' ),
    ('MODIFIER_BUREAUCRATIC_RITUALS_TEMPLE_YIELD', 'YieldType', 'YIELD_FOOD' ),
    ('MODIFIER_BUREAUCRATIC_RITUALS_TEMPLE_YIELD', 'Amount', '2' );

    What do I need to change in the above code? I found this modifier for the Pagoda's favor bonus: MODIFIER_PLAYER_ADJUST_EXTRA_FAVOR_PER_TURN

    Thanks!
     
    Last edited: Jul 13, 2020
  2. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,676
    Gender:
    Male
    Location:
    Warsaw
    Favor is technically not a Yield, so you can't use MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE or anything yield-type.
    Favor has its own effects and modfiers, e.g. like you mentioned.
    However, I would rather use EFFECT_ADJUST_PLAYER_BUILDING_FAVOR => MODIFIER_PLAYER_ADJUST_BUILDING_FAVOR like in DISINFORMATION_CAMPAIGN_BROADCAST_FAVOR => +3 Diplomatic Favor per turn for each Broadcast Center.
     
  3. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    This is what I did:

    'MODIFIER_BUREAUCRATIC_RITUALS_TEMPLE_ADJUST_FAVOR','MODIFIER_PLAYER_ADJUST_EXTRA_FAVOR_PER_TURN'
    and
    'MODIFIER_BUREAUCRATIC_RITUALS_SHRINE_ADJUST_FAVOR', 'Amount', '2'
     
  4. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    Last edited: Jul 13, 2020
  5. maconnolly

    maconnolly Chieftain

    Joined:
    Jun 3, 2019
    Messages:
    96
    Gender:
    Male
    Don't fret - Modifiers and everything involved in them can be a tricky business. It's a learning-curve that you have to go on, unfortunately.

    I think I reference these in the template - but I can't recommend the Modifier and Dynamic Modifier guides enough, which are found in the Modding Tutorials & References section of this site's Downloads area.

    For those things that have 'broken' links, there is a mismatch in the referenced LOC_ entry and what appears in the Localization.sql files. Chances are, you've replaced LOC_CIVILIZATION_MC_OLMEC_NAME (as the example) in one/multiple place(s), but not in all. From memory, you may want to look at the PlayerItems table - as I think this references what will appear on those screens.

    If you intend to have both the BUILDING_SHRINE and the BUILDING_TEMPLE grant an extra +2 Faith, as well as the +2 Diplomatic Favor, I would first replace the template's YIELD_FOOD in the ModifierArguments with YIELD_FAITH. That should achieve the +2 Faith with no further changes needed.

    I would then recommend adding the code for the other part of the UA - the Diplomatic Favor - one part at a time. A technique I have used is to populate a Notepad file with the relevant code, so there's no mixing in with the ModBuddy code to start with. I have ModBuddy open, but it's just for syntax reference. I then use base-game files to look for the right variable that can be inserted. Remember, by leveraging something already in the game, you can save yourself having to explicitly code all parts in ModBuddy. If there's a Modifier that does exactly what you want, you only need to attach that Modifier - not build it again. If there isn't, then you can follow the chain-of-reference in the base-game to understand at which point your requirement deviates from the base-game and code it in step-by-step.

    Again, I recommend doing this in Notepad, or similar, so that it is isolated from your other functional code. If you make a mess, no big deal - you won't end up deleting something that is working and cause further problems. Once you have it right in your mind, you can then populate your Notepad-based modifier into your ModBuddy file, comfortable with what is being added.

    This is intended as a general technique - nothing specific. You're welcome to upload your ModBuddy project in full and I can try and take a look at the specific code, if you wish.
     
    Starcomet likes this.
  6. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    I will try your suggestions, thank you Maconnolly!
     
  7. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    Where is the PlayerItems table at? I went back through the localization.sql file and made sure all of the MC_OLMEC was change to my civ and my initials.
     
  8. maconnolly

    maconnolly Chieftain

    Joined:
    Jun 3, 2019
    Messages:
    96
    Gender:
    Male
    Using LOC_CIVILIZATION_MC_OLMEC_NAME as the example, I've just done a search and it appears in the following files:

    - Civilization_Config.sql under the Civilizations table (column 2)
    - Civilization_Localisation.sql, the very first entry
    - Leader_Config.sql, in three locations (one of which is commented out). It's actually the Players table, not PlayerItems (which appears further down in the same file).

    For reference, Players ties together the Civilization, Civilization UA, Leader and Leader UA and populates the first part of that leader-selection screen. It’s why it references some icons, too. PlayerItems defines what displays in the Loading and Diplomacy screens, further down from the Leader and Civ UAs.
     
    Starcomet likes this.
  9. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    I did not even check that file yet! That likely is the reason then! Thank you, I will work on this some more with your suggestions.
     
  10. Starcomet

    Starcomet Chieftain

    Joined:
    Jul 1, 2013
    Messages:
    14
    Location:
    Baltimore
    @maconnolly Do I have to delete the improvement that my improvement is based on? Basically I wish to take the Nubian pyramid in game model and have it represent my Civs Celestial Tower improvement. Do I need to delete/remove the way the Nubian pyramid works or can I keep it separate without causing issues. I do not wish to change the way the Nubian Pyramid works, just merely use its model to represent my improvement.
     

Share This Page