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

Quick Modding Questions Thread

Discussion in 'Mod Creation Help' started by Leyrann, Oct 28, 2018.

  1. OnlyHeStandsHere

    OnlyHeStandsHere Chieftain

    Joined:
    May 4, 2018
    Messages:
    46
    Thank you kindly once again!
     
  2. Laurana Kanan

    Laurana Kanan Don’t underestimate who I am.

    Joined:
    Apr 10, 2014
    Messages:
    2,511
    Gender:
    Female
    Location:
    Near the Greatest Snow on Earth
    I've also used "REQUIREMENT_GAME_ERA_ATLEAST_EXPANSION" from time to time. It just depends when you want something to trigger.
     
  3. OnlyHeStandsHere

    OnlyHeStandsHere Chieftain

    Joined:
    May 4, 2018
    Messages:
    46
    Aha, that might also work nicely. I'll try experimenting with both and see which I like better. Thanks!
     
  4. SocialMechanic

    SocialMechanic Chieftain

    Joined:
    May 11, 2019
    Messages:
    97
    It seems as though creating bonuses around Era Score is hard because there is no effect attached to Era Score. They all are like "+Era Score even X condition" rather than "+Era Score" with the freedom to create the condition that provides it. Am I mistaken in this? I've looked and haven't found anything.
    I'm trying to create a Pantheon that gives Era Score every time a Holy Site is constructed. I don't think it is possible (but please prove me wrong).
     
  5. OnlyHeStandsHere

    OnlyHeStandsHere Chieftain

    Joined:
    May 4, 2018
    Messages:
    46
    I'm having issues getting alternate colors showing for my custom civilization. I've copied the format verbatim from what's used by some default dlc 2 civs, but I'm getting errors saying that the column in the table doesn't exist. Here's the error log:

    Code:
    [2706072.028] [Configuration]: In XMLSerializer while updating table PlayerColors from file Chunk_Swiss_PlayerColors.xml.
    [2706072.202] [Configuration]: Validating Foreign Key Constraints...
    [2706072.203] [Configuration]: Passed Validation.
    [2706075.407] [Gameplay] ERROR: table PlayerColors has no column named Alt1PrimaryColor
    [2706075.407] [Gameplay]: In Query - insert into PlayerColors('Type', 'Usage', 'PrimaryColor', 'SecondaryColor', 'Alt1PrimaryColor', 'Alt1SecondaryColor', 'Alt2PrimaryColor', 'Alt2SecondaryColor', 'Alt3PrimaryColor', 'Alt3SecondaryColor') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
    [2706075.407] [Gameplay]: In XMLSerializer while updating table PlayerColors from file Chunk_Swiss_PlayerColors.xml.
    The xml file seems pretty straightforward:
    Code:
    <GameData>
        <PlayerColors>
            <Row>
                <Type>LEADER_GUISAN</Type>
                <Usage>Unique</Usage>
                <PrimaryColor>COLOR_STANDARD_RED_MD</PrimaryColor>
                <SecondaryColor>COLOR_STANDARD_WHITE_LT</SecondaryColor>
                <Alt1PrimaryColor>COLOR_STANDARD_BLUE_MD</Alt1PrimaryColor>
                <Alt1SecondaryColor>COLOR_STANDARD_YELLOW_MD</Alt1SecondaryColor>
                <Alt2PrimaryColor>COLOR_STANDARD_YELLOW_MD</Alt2PrimaryColor>
                <Alt2SecondaryColor>COLOR_STANDARD_RED_MD</Alt2SecondaryColor>
                <Alt3PrimaryColor>COLOR_STANDARD_GREEN_LT</Alt3PrimaryColor>
                <Alt3SecondaryColor>COLOR_STANDARD_WHITE_LT</Alt3SecondaryColor>
            </Row>
        </PlayerColors>
    </GameData>
    
    If I comment out the lines having to do with alternative colors, it works fine, but obviously with only one set of available colors for the civ. I'm quite perplexed though, since the column names were taken straight from existing files. Is there something obvious I'm just not getting here?
     
  6. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    6,872
    Location:
    Illinois, USA
    Because the table you are attempting to use exists with a different definition within the InGame (code) Database than the "Colors" Database.

    In order to use the column-names you are attempting your file has to be loaded via an UpdateColors Action rather than an UpdateDatabase Action.

    InGame (code) Table Definitions added through an XML file C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data\Schema/Color_Tables.xml
    Code:
    <GameData>
    	<Table name="Colors">
    		<Column name="Type" type="text" notnull="true" primarykey="true"/>
    		<Column name="Color" type="text"/>
    		<Column name="Red" type="float"/>
    		<Column name="Green" type="float"/>
    		<Column name="Blue" type="float"/>
    		<Column name="Alpha" type="float"/>
    	</Table>
    
    	<Table name="PlayerColors">
    		<Column name="Type" type="text" notnull="true" primarykey="true" />
    		<Column name="Usage" type="text" notnull="true" />
    		<Column name="PrimaryColor" type="text" notnull="true" />
    		<Column name="SecondaryColor" type="text" notnull="true" />
    		<Column name="TextColor" type="text" />
    	</Table>
    </GameData>
    "Colors" Database tables added via C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Database\ColorManager.sql
    Code:
    CREATE TABLE 'Colors'(
    	'Type' TEXT NOT NULL,
    	'Color' TEXT NOT NULL,
    	PRIMARY KEY('Type')
    );
    
    CREATE TABLE 'PlayerColors'(
    	'Type' TEXT NOT NULL, 
    	'Usage' TEXT NOT NULL, 
    	'PrimaryColor' TEXT NOT NULL, 
    	'SecondaryColor' TEXT NOT NULL, 
    	'Alt1PrimaryColor' TEXT,
    	'Alt1SecondaryColor' TEXT,
    	'Alt2PrimaryColor' TEXT,
    	'Alt2SecondaryColor' TEXT,
    	'Alt3PrimaryColor' TEXT,
    	'Alt3SecondaryColor' TEXT,
    	PRIMARY KEY ('Type')
    );
    Spoiler :
    None of this is the least bit confusing to anyone. No! Really! I'm being serious here!
     
    Last edited: Mar 3, 2020
  7. OnlyHeStandsHere

    OnlyHeStandsHere Chieftain

    Joined:
    May 4, 2018
    Messages:
    46
    Thanks! I knew it had to be something basic that I just wasn't getting. Works like a charm. Now I can see the civ jerseys in all their bea... oh god... what have I done.

    SwissJerseyTest.jpg
    Some slight adjustments will be in order. Particularly on that last one, haha.
     
  8. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    408
    Gender:
    Male
    Location:
    USA
    A friend asked me if the AI could be modded to never declare war and never accept a peace deal. The purpose would be for team games where the teams are a mix of human and AI players, so that only the human players will determine when their team goes to war or accepts peace.

    I am not familiar with the Civ6 AI yet. Can someone point me to what files I would need to change? Or is this beyond the scope of what can be accomplished without DLL access? Is there any guides on modding the Civ6 AI? I am hoping this is possible without having an impact on how many units the AI builds or things like that.
     
  9. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    6,872
    Location:
    Illinois, USA
    Canada cannot declare surprise war. This is accomplished via a Modifier. A quick look at the "Diploactions" however does not show one unified "Declare War", so on the declare war side you would have to first copy/paste everything to do with Canada's "No Surprise War" trait-modifier, edit to make a new unique ModifierID (not ModifierType) with a requirement that it only applies to major civilizations who are not humans, and then copy that for all the different War-Declaration "Diploactions". Make Peace is simple, it is merely DIPLOACTION_MAKE_PEACE without the numerous different versions of war-source inherently attached, and covers all cases regardless of how the war was started. Whether or not this will lock the other members of the team from making peace I've no idea.

    Diploactions are found in Vanilla file
    The expacs add more and you'll have to dig through the files in the Expansion1 and Expansion2 folders at
    Or else look directly at the Database file after loading up a game and then exiting directly to desktop.
     
    Red Key and Gedemon like this.
  10. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,274
    Location:
    France
    Hmm, I need to have a look again at Modifiers then, with this could we lock/unlock dynamically all diplo actions between specific civs, using dummy buildings and a modifier+requirements combination build using SQL based on all available civs in the DB?
     
  11. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    The LOC text descriptions don't like to begin with blank spaces, and they will be removed.

    Is there a way to indent text? Perhaps similar to "[NEWLINE]", so "[SPACE]" or "[INDENT*]" or some such.

    * Asterisk added to stop this post getting indented and the word disappearing.
     
  12. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,274
    Location:
    France
    I use a transparent FontIcon for custom indentation in my mod.
     
  13. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    408
    Gender:
    Male
    Location:
    USA
    Thanks LeeS! I didn't expect that this was something that could be done with the modifier system - the number of things supported by it continues to surprise me. I will experiment with it and see if human players that are teamed up with AI are still able to declare war/make peace.
     
  14. Castar

    Castar Warlord

    Joined:
    May 26, 2007
    Messages:
    100
    EDIT: Nevermind, I found the solution to the below question. LoadOrder needed to be high enough to overwrite the Expansion2 CItySupport file.

    Original post:

    I've restarted working on a personal mod I had been tinkering with a while ago, but I seem to have forgotten the proper ModBuddy rituals.

    I want to replace CitySupport.lua. After some tinkering with actually trying to change things and nothing seeming to happen, I've tried again with these basic steps:

    - Copy the CitySupport.lua from Expansion2/UI/Replacements to my mod (in mod buddy), UI/Replacements/CitySupport.lua
    - Add a single 'print("MyMod: replaced CitySupport.lua");' statement to the CitySupport.lua file in my mod, and nothing else, so the file should not contain any errors.
    - Add the file to ImportFiles in the ModBuddy project.
    - Build the project, and verify that the built mod contains the CitySupport.lua file, and the built .modinfo in the mod's directory contains "UI/Replacements/CitySupport.lua" under both <Files>, and <ImportFiles>
    - Start a game with my mod loaded

    All of the "old stuff" in my mod merrily reports to Lua.log, so I know the mod is still doing things, however the print statement I added in my own CitySupport.lua does not appear.

    Which piece of ModBuddy/LUA black magic voodoo have I forgotten? I am vaguely suspecting it might have something to do with "include" statements (i.e. files in the the game that include CitySupport somehow still include the base CitySupport file, not my modded one), but if that is the case I don't know what I could do about that.
     
    Last edited: Mar 12, 2020
  15. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    Thanks. I've decided not to use indentation.

    What is the technical name for the text box that appears when hovering the cursor over something, such as an icon?

    Is it an infobox?

     
  16. Laurana Kanan

    Laurana Kanan Don’t underestimate who I am.

    Joined:
    Apr 10, 2014
    Messages:
    2,511
    Gender:
    Female
    Location:
    Near the Greatest Snow on Earth
    Tooltip
     
  17. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I've decided to call it a tooltip infobox.
     
  18. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    What does the <Created>1583799637</Created> line mean in .modinfo?
     
  19. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    6,872
    Location:
    Illinois, USA
    As far as I've been able to tell it is a time-stamp value of some kind. It is not an internal user ID # for example because it is different in each mod made by the same person. My assumption that it is a timestamp of some kind is based on the fact that the value never goes down when creating a new mod, it only goes up from the last time you built a mod. Rebuild of the same mod results in a higher numerical value. So ==> timestamp assumption.
     
  20. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,274
    Location:
    France
    @Deliverator @Wolfdog and other units maker...

    Do you know how many models (like warrior A, warrior B, etc...) we can set in an unit Artdef?
     

Share This Page