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

Winter Patch: Adding Icons and ArtDefs

Discussion in 'Civ6 - Modding Tutorials & Reference' started by PlotinusRedux, Dec 21, 2016.

  1. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,917
    Location:
    France
    No, but I'll try.
     
  2. UncivilizedGuy

    UncivilizedGuy Civ is brain candy.

    Joined:
    May 24, 2012
    Messages:
    741
    Location:
    City State of Los Angeles
    I know you guys are talking about art defines but I thought I'd share my experience in case this helps. I am also experiencing a loading order problem with the Poland DLC. My fix is to duplicate the Gamedata xml from the DLC and put it in my mod. I replace all instances of <Row> With <Replace> in the gamedata added to my mod to make sure the data loads if the mod loads after the DLC. My unit changes will always reference the data added to my mod because I attach it to the end of the Gamedata file. If the DLC loads after my mod then the data file in the DLC gets dumped and has no affect on the game. I have found the load order reverses when a saved game is loaded.
     
  3. PlotinusRedux

    PlotinusRedux Chieftain

    Joined:
    Jul 11, 2013
    Messages:
    196
    Wonderful.

    Did you try the <LoadOrder> property? Both the PolandScenario.modinfo and VikingScenario.modinfo set it to 100 for their <UpdateDatabase>. I'd been assuming it would refer to the load order *within* a mod since <Dependencies> and <References> see designed to control the load order between mods, but maybe it actually works between mods instead. I know testing it within a mod on different <GameplayScript> components did nothing (though <GameplayScript> has other issues as well, like apparently only allowing 1 file per component).
     
  4. UncivilizedGuy

    UncivilizedGuy Civ is brain candy.

    Joined:
    May 24, 2012
    Messages:
    741
    Location:
    City State of Los Angeles
    I haven't tried the <LoadOrder> property. But I was having a load order problem within a mod when the xml files were in separate folders. The problem went away when I placed the files in the same folder. It doesn't make any sense to me.
     
  5. Horem

    Horem Chieftain

    Joined:
    Apr 1, 2010
    Messages:
    1,716
    Location:
    Wales, UK
    Load order inside a mod it determined by 2 factors. 1) Components - Seems to Load top to bottom. 2) Order of your files in the <Files> Tags this also effects what files to load in what order inside each component. The order iside each component is ignored, it always goes by the order inside <Files> .
     
    Last edited: Jan 4, 2017
  6. PlotinusRedux

    PlotinusRedux Chieftain

    Joined:
    Jul 11, 2013
    Messages:
    196
    There's also a "Priority" attribute you can use with <File> under <Items> that presumably should let you set the order within a component, but when I was testing it, I was using <GameplayScript> which is broken with more than 1 file anyway, so I haven't actually tested it with a working component and don't know if higher or lower numbers should load first, if it works at all.
     
  7. UncivilizedGuy

    UncivilizedGuy Civ is brain candy.

    Joined:
    May 24, 2012
    Messages:
    741
    Location:
    City State of Los Angeles
    This is what I thought also but I was still having a problem with saved games not loading properly. I would need to test it again to confirm.
     
  8. PlotinusRedux

    PlotinusRedux Chieftain

    Joined:
    Jul 11, 2013
    Messages:
    196
    @UncivilizedGuy , OMFG, you're not going to believe this.

    I kept trying to reproduce what you experienced, about having your mod load after the DLC when you created a game, but before the DLC when you loaded a game. No matter what I did, my mod *always* loaded after the DLC.

    Then, looking at the log, I got a hunch, that turned out to be right, and allowed me to reproduce what you experienced.. During game creation, mods load according to their ModRowId in mods.sqlite. However, during game loading, mods load according to the alpha-numerical sorting of their ModId--i.e., the value of the "id" attribute in the root <Mod> attribute of the .modinfo.

    Start your ModId with "00", and when you reload a game, it will always load before the DLC. Start your ModId with "Z", and it will always load after the DLC when you reload a game.

    Since the highest DLC id so far starts with "38...", you would have never discovered this issue if your ID had started with "4" or higher. Unfortunately, the GUID gods punished you with a "039...", meaning on reloads you come before everything except the Aztec DLC ("02A...").

    Of course you can't change your ModId now without breaking saved games, but I've learned a lot in the past few hours about how "Priority" and "LoadOrder" work, I'm going to start a new thread on mod, component, and file load order in a few hours once I finish testing whether what I've found also holds for <ModArt>, etc., but what I've found out already can fix your issues--for UpdateDatabase and Gameplayscripts, at least, <LoadOrder> does cross mod boundaries, with the highest component loading last no matter what mod it is in; and within a component, Priority gives a deterministic load order, but this time with the highest loading first.
     
  9. UncivilizedGuy

    UncivilizedGuy Civ is brain candy.

    Joined:
    May 24, 2012
    Messages:
    741
    Location:
    City State of Los Angeles
    Thanks for putting some effort into this. Great find!
     
  10. sp00n

    sp00n Chieftain

    Joined:
    Jan 4, 2007
    Messages:
    347
    Is there any info on this? I wouldn't even need to add a new icon, I'd just need to add a new entry for an already existing one (the icon for the city center is named as DISTRICT_CITYCENTER instead of DISTRICT_CITY_CENTER, and the latter is being used in the database...).
    When I edit the UI/FontIcons.xml directly it works, but I don't seem to be able to add an entry to it via a mod or even replace the file as a whole.
     
  11. Magil

    Magil Monarch

    Joined:
    Sep 26, 2010
    Messages:
    1,606
    Yeah, this is my main barrier to adding new resources. Technically it works, but you need to be able to change FontIcons.xml or else the Reports screen gets messed up when trying to display the new resources (it just shows up as ICON_RESOURCENAME and covers the name of the city it's going to). I haven't been able to find anything that works except editing the file manually as you said.
     
  12. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,751

    Whoah. That's a huge issue. Great find and thanks for sharing.
     
  13. DavDarkelf

    DavDarkelf Chieftain

    Joined:
    Nov 28, 2016
    Messages:
    76
    Gender:
    Male
    Is there a guide to creating icons. E.g. what art program to use etc? I'm not really an artist but it would be nice to have a go but I wouldn't know where to start!
     
  14. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,710
    Gender:
    Male
    Location:
    Seoul, South Korea
    No civ 6 guide... but there may be some civ 5 guides that could apply. Most unit icons are just white on transparency afaik. Try to find tutorials about creating flag icons, perhaps.
     
  15. Iztari

    Iztari Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    1
    Gender:
    Male
    What am I missing..? Every things is is working except that the actual Improvement isn't visible...
    (The improvement: Kurgan was used as a base.)
    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <AssetObjects::ArtDefSet>
        <m_Version>
            <major>4</major>
            <minor>0</minor>
            <build>250</build>
            <revision>203</revision>
        </m_Version>
        <m_TemplateName text="Improvements" />
        <m_RootCollections>
            <Element>
                    <m_Fields>
                        <m_Values/>
                    </m_Fields>
                    <m_ChildCollections>
                        <Element>
                            <m_CollectionName text="Audio"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        </Element>
                        <Element>
                            <m_CollectionName text="StrategicView"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                            <Element>
                                <m_Fields>
                                    <m_Values>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="Kurgan"/>
                                            <m_RootCollectionName text="Improvements"/>
                                            <m_ArtDefPath text="StrategicView.artdef"/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text="StrategicView"/>
                                            <m_ParamName text="XrefName"/>
                                        </Element>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="Completed"/>
                                            <m_RootCollectionName text="BuildStates"/>
                                            <m_ArtDefPath text="Improvements.artdef"/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text="Improvements"/>
                                            <m_ParamName text="State"/>
                                        </Element>
                                    </m_Values>
                                </m_Fields>
                                <m_ChildCollections/>
                                <m_Name text="StrategicView001"/>
                                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                            </Element>
                            <Element>
                                <m_Fields>
                                    <m_Values>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="Kurgan_Pillaged"/>
                                            <m_RootCollectionName text="Improvements"/>
                                            <m_ArtDefPath text="StrategicView.artdef"/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text="StrategicView"/>
                                            <m_ParamName text="XrefName"/>
                                        </Element>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="Pillaged"/>
                                            <m_RootCollectionName text="BuildStates"/>
                                            <m_ArtDefPath text="Improvements.artdef"/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text="Improvements"/>
                                            <m_ParamName text="State"/>
                                        </Element>
                                    </m_Values>
                                </m_Fields>
                                <m_ChildCollections/>
                                <m_Name text="StrategicView002"/>
                                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                            </Element>
                        </Element>
                        <Element>
                            <m_CollectionName text="Clutter"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        </Element>
                        <Element>
                            <m_CollectionName text="Landmark"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                            <Element>
                                <m_Fields>
                                    <m_Values>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="LM_KURGAN"/>
                                            <m_RootCollectionName text="Landmarks"/>
                                            <m_ArtDefPath text="Landmarks.artdef"/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text="Landmarks"/>
                                            <m_ParamName text="Xref"/>
                                        </Element>
                                        <Element class="AssetObjects::BoolValue">
                                            <m_bValue>true</m_bValue>
                                            <m_ParamName text="SuppressResource"/>
                                        </Element>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="ANYTHING"/>
                                            <m_RootCollectionName text=""/>
                                            <m_ArtDefPath text=""/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text=""/>
                                            <m_ParamName text="WhenAdjacentTo"/>
                                        </Element>
                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                            <m_ElementName text="NONE"/>
                                            <m_RootCollectionName text=""/>
                                            <m_ArtDefPath text=""/>
                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                            <m_TemplateName text=""/>
                                            <m_ParamName text="Fence"/>
                                        </Element>
                                    </m_Values>
                                </m_Fields>
                                <m_ChildCollections>
                                    <Element>
                                        <m_CollectionName text="WhenAffectedBy"/>
                                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                                    </Element>
                                </m_ChildCollections>
                                <m_Name text="Landmark1"/>
                                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                            </Element>
                        </Element>
                        <Element>
                            <m_CollectionName text="Lighting"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                            <Element>
                                <m_Fields>
                                    <m_Values>
                                        <Element class="AssetObjects::RGBValue">
                                            <m_r>131.000000</m_r>
                                            <m_g>108.000000</m_g>
                                            <m_b>68.000000</m_b>
                                            <m_ParamName text="BounceColor"/>
                                        </Element>
                                        <Element class="AssetObjects::FloatValue">
                                            <m_fValue>0.380620</m_fValue>
                                            <m_ParamName text="BounceAlpha"/>
                                        </Element>
                                    </m_Values>
                                </m_Fields>
                                <m_ChildCollections/>
                                <m_Name text="Lighting001"/>
                                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                            </Element>
                        </Element>
                        <Element>
                            <m_CollectionName text="Activity"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        </Element>
                        <Element>
                            <m_CollectionName text="GreatWall"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        </Element>
                    </m_ChildCollections>
                    <m_Name text="EGP_IMPROVEMENT_RUNESTONE"/>
                    <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
        </m_RootCollections>
    </AssetObjects::ArtDefSet>
    
     
  16. CivilizationAce

    CivilizationAce Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    236
    Gender:
    Male
    I'm not so sure about this. I found that the file name you have to put in the .dep file is not the name of the file in the base game, it's the name of your .artdef file. So if, for instance, you put units.artdef in your .dep and name your file newunit.artdef it won't work, but it's not (as far as I can tell) because they're different – it's because you needed to put newunit.artdef in your .dep.

    That said I'm as new as it gets to modding and can barely get my units to show, leaving my custom district that's meant to look like a Mbanza and my custom improvement that's meant to look like a goody hut not showing. I ran across this thread while looking for ways to get those two showing, which I presume has something to do with my .dep.

    If anyone knows that I'm talking gibberish please correct me, as I'm very confused and all (polite) input is welcome.
     
  17. CivilizationAce

    CivilizationAce Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    236
    Gender:
    Male
    I suspect (though I'm far from certain) that your issue may not be in that file at all: Is the file referenced in your .dep?

    I'd be certain, except that I'm having the same problem. If you get to the bottom of it please reply with details because though my experimentation with my .dep has made my units appear as required my improvement is still invisible.
     
  18. CivilizationAce

    CivilizationAce Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    236
    Gender:
    Male
    I'm new to modding Civ 6 and parts of this are confusing me.

    Neither of those .xml files is mentioned elsewhere in this article so I don't see what this section achieves.

    Also the Art/Icons/Tech folder isn't described in the directory structure, so I'm unclear about where the relative folder location starts for the purpose of getting the ImportFiles to process the files. Also, does the ID of the ImportFiles matter?
     
  19. Horem

    Horem Chieftain

    Joined:
    Apr 1, 2010
    Messages:
    1,716
    Location:
    Wales, UK
    You can see in Test of Time mod how to get a custom Distrcit to show up.
     
  20. Firebug

    Firebug Not-so Great Engineer

    Joined:
    Sep 25, 2014
    Messages:
    1,270
    Location:
    Clevedon, England
    Can't think of a better place to post this but turns out you can mix and match buildings with districts. Here's my Royal Academy with the Military Academy model in the Campus.

     

Share This Page