1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Rough Guide to Units.artdef

Discussion in 'Civ6 - Modding Tutorials & Reference' started by Deliverator, Nov 2, 2016.

  1. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,964
    Location:
    London, UK
    I've started a tutorial here. :)
     
  2. ReichAdler

    ReichAdler Chieftain

    Joined:
    Nov 4, 2016
    Messages:
    83
    Gender:
    Male
    We who are about to mod... salute you! Thank you hefe.
     
  3. CivilizationAce

    CivilizationAce Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    236
    Gender:
    Male
    Why don't districts work the same way?

    If I take a copy of the base Units.artdef file, reduce it to a single unit, e.g. UNIT_APOSTLE, and change the name to my custom unit, e.g. UNIT_HOLY_MAN then my Holy Man looks like an Apostle.

    If I do the same with a district my district is invisible.
     
  4. aschulak

    aschulak Chieftain

    Joined:
    Dec 11, 2010
    Messages:
    92
  5. kingchris20

    kingchris20 Wisdom Seeker

    Joined:
    Jul 30, 2012
    Messages:
    1,319
    Location:
    Resident of Heaven; Currently in the Waiting Room
    From OP - "It is possible to create a new UnitCulture in the Cultures.artdef and then start to define new cultural variations of units in the Units.artdef."

    So say I wanted to have a cultural variation for the Trader Unit for a specific civ.

    Would it be this in Cultures.artdef:
    Spoiler :
    Code:
    <AssetObjects..ArtDefSet>
        <m_Version>
            <major>4</major>
            <minor>0</minor>
            <build>314</build>
            <revision>526</revision>
        </m_Version>
        <m_TemplateName text="Cultures"/>
        <m_RootCollections>
            <Element>
                <m_CollectionName text="UnitCulture"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                <Element>
                    <m_Fields>
                        <m_Values>
                            <Element class="AssetObjects..CollectionValue">
                                <m_eObjectType>INVALID</m_eObjectType>
                                <m_eValueType>ARTDEF_REF</m_eValueType>
                                <m_Values>
                                    <Element class="AssetObjects..ArtDefReferenceValue">
                                        <m_ElementName text="CIVILIZATION_KC20_TES_ELSWEYR"/>
                                        <m_RootCollectionName text="Civilization"/>
                                        <m_ArtDefPath text="Civilizations.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Civilizations"/>
                                        <m_ParamName text="Civilizations001"/>
                                    </Element>
                                </m_Values>
                                <m_ParamName text="Civilizations"/>
                            </Element>
                        </m_Values>
                    </m_Fields>
                    <m_ChildCollections/>
                    <m_Name text="Khajiit"/>
                    <m_AppendMergedParameterCollections>true</m_AppendMergedParameterCollections>
                </Element>
            </Element>
        </m_RootCollections>
    </AssetObjects..ArtDefSet>
    


    and would this be all I would need in Units.artdef:
    Spoiler :
    Code:
    <AssetObjects..ArtDefSet>
        <m_Version>
            <major>4</major>
            <minor>0</minor>
            <build>315</build>
            <revision>805</revision>
        </m_Version>
        <m_TemplateName text="Units"/>
        <m_RootCollections>
            <Element>
                <m_CollectionName text="Units"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>   
            <Element>
                <m_CollectionName text="UnitMovementTypes"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="UnitFormationTypes"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="MemberCombat"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="UnitCombat"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="CombatAttack"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="UnitFormationLayoutTypes"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="CombatFormation"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="UnitDomainTypes"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="UnitAttachmentBins"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
            <Element>
                <m_CollectionName text="UnitMemberTypes"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                <Element>
                    <m_Fields>
                        <m_Values>
                            <Element class="AssetObjects::ArtDefReferenceValue">
                                <m_ElementName text="Cavalry"/>
                                <m_RootCollectionName text="UnitMovementTypes"/>
                                <m_ArtDefPath text="Units.artdef"/>
                                <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                <m_TemplateName text="Units"/>
                                <m_ParamName text="Movement"/>
                            </Element>
                            <Element class="AssetObjects::ArtDefReferenceValue">
                                <m_ElementName text="NoCombat"/>
                                <m_RootCollectionName text="MemberCombat"/>
                                <m_ArtDefPath text="Units.artdef"/>
                                <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                <m_TemplateName text="Units"/>
                                <m_ParamName text="Combat"/>
                            </Element>
                            <Element class="AssetObjects::ArtDefReferenceValue">
                                <m_ElementName text="MEAT"/>
                                <m_RootCollectionName text="MaterialTypes"/>
                                <m_ArtDefPath text="VFX.artdef"/>
                                <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                <m_TemplateName text=""/>
                                <m_ParamName text="VFXMaterialType"/>
                            </Element>
                            <Element class="AssetObjects::ArtDefReferenceValue">
                                <m_ElementName text="MEAT"/>
                                <m_RootCollectionName text="MaterialTypes"/>
                                <m_ArtDefPath text="VFX.artdef"/>
                                <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                <m_TemplateName text=""/>
                                <m_ParamName text="VFXWeaponImpact"/>
                            </Element>
                            <Element class="AssetObjects::FloatValue">
                                <m_fValue>0.000000</m_fValue>
                                <m_ParamName text="ImpactHeightOverride"/>
                            </Element>
                        </m_Values>
                    </m_Fields>
                    <m_ChildCollections>
                        <Element>
                            <m_CollectionName text="Cultures"/>
                            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                            <Element>
                                <m_Fields>
                                    <m_Values/>
                                </m_Fields>
                                <m_ChildCollections>
                                    <Element>
                                        <m_CollectionName text="Variations"/>
                                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                                        <Element>
                                            <m_Fields>
                                                <m_Values>
                                                    <Element class="AssetObjects::FloatValue">
                                                        <m_fValue>1.0000001</m_fValue>
                                                        <m_ParamName text="Scale"/>
                                                    </Element>
                                                    <Element class="AssetObjects::BoolValue">
                                                        <m_bValue>false</m_bValue>
                                                        <m_ParamName text="IsAttachment"/>
                                                    </Element>
                                                </m_Values>
                                            </m_Fields>
                                            <m_ChildCollections>
                                                <Element>
                                                    <m_CollectionName text="Attachments"/>
                                                    <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                                                    <Element>
                                                        <m_Fields>
                                                            <m_Values>
                                                                <Element class="AssetObjects::StringValue">
                                                                    <m_Value text="Root"/>
                                                                    <m_ParamName text="Point"/>
                                                                </Element>
                                                                <Element class="AssetObjects::ArtDefReferenceValue">
                                                                    <m_ElementName text=""/>
                                                                    <m_RootCollectionName text="UnitTintTypes"/>
                                                                    <m_ArtDefPath text=""/>
                                                                    <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                                                    <m_TemplateName text=""/>
                                                                    <m_ParamName text="Tint"/>
                                                                </Element>
                                                            </m_Values>
                                                        </m_Fields>
                                                        <m_ChildCollections>
                                                            <Element>
                                                                <m_CollectionName text="Bins"/>
                                                                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                                                                <Element>
                                                                    <m_Fields>
                                                                        <m_Values/>
                                                                    </m_Fields>
                                                                    <m_ChildCollections/>
                                                                    <m_Name text="Unit/WhiteTiger"/>
                                                                    <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                                                                </Element>
                                                            </Element>
                                                        </m_ChildCollections>
                                                        <m_Name text="Body"/>
                                                        <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                                                    </Element>
                                                </Element>
                                            </m_ChildCollections>
                                            <m_Name text="WhiteTiger"/>
                                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                                        </Element>
                                    </Element>
                                </m_ChildCollections>
                                <m_Name text="Khajiit"/>
                                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                            </Element>
                        </Element>
                    </m_ChildCollections>
                    <m_Name text="Trader"/>
                    <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                </Element>
            </Element>
            </Element>
            <Element>
                <m_CollectionName text="UnitGlobals"/>
                <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            </Element>
        </m_RootCollections>
    </AssetObjects..ArtDefSet>


    Then link it to mod.art like this:
    Spoiler :
    Code:
    <AssetObjects..GameArtSpecification>
        <artConsumers>
            <Element>
                <consumerName text="Units"/>
                <relativeArtDefPaths>
                    <Element text="Units.artdef"/>
                    <Element text="Unit_Bins.artdef"/>
                    <Element text="Cultures.artdef"/>
                </relativeArtDefPaths>
                <libraryDependencies>
                    <Element text="Unit"/>
                    <Element text="VFX"/>
                    <Element text="Light"/>
                </libraryDependencies>
                <loadsLibraries>true</loadsLibraries>
            </Element>
            <Element>
                <consumerName text="Civilizations"/>
                <relativeArtDefPaths>
                    <Element text="Civilizations.artdef"/>
                    <Element text="Cultures.artdef"/>
                </relativeArtDefPaths>
                <libraryDependencies/>
                <loadsLibraries>false</loadsLibraries>
            </Element>
            <Element>
                <consumerName text="Cultures"/>
                <relativeArtDefPaths>
                    <Element text="Cultures.artdef"/>
                    <Element text="Civilizations.artdef"/>
                </relativeArtDefPaths>
                <libraryDependencies/>
                <loadsLibraries>false</loadsLibraries>
            </Element>
            <Element>
                <consumerName text="WorldView_Translate"/>
                <relativeArtDefPaths>
                    <Element text="Civilizations.artdef"/>
                    <Element text="Buildings.artdef"/>
                    <Element text="Districts.artdef"/>
                    <Element text="Cultures.artdef"/>
                    <Element text="Landmarks.artdef"/>
                </relativeArtDefPaths>
                <libraryDependencies/>
                <loadsLibraries>false</loadsLibraries>
            </Element>
            <Element>
                <consumerName text="StrategicView_Translate"/>
                <relativeArtDefPaths>
                    <Element text="Districts.artdef"/>
                    <Element text="Landmarks.artdef"/>
                    <Element text="Cultures.artdef"/>
                </relativeArtDefPaths>
                <libraryDependencies/>
                <loadsLibraries>false</loadsLibraries>
            </Element>
            <Element>
                <consumerName text="Audio"/>
                <relativeArtDefPaths>
                    <Element text="Civilizations.artdef"/>
                    <Element text="Units.artdef"/>
                    <Element text="Buildings.artdef"/>
                    <Element text="Districts.artdef"/>
                    <Element text="Cultures.artdef"/>
                </relativeArtDefPaths>
                <libraryDependencies/>
                <loadsLibraries>false</loadsLibraries>
            </Element>
        </artConsumers>
    </AssetObjects..GameArtSpecification>
    
     
  6. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,964
    Location:
    London, UK
    @kingchris20: That looks correct. Just be aware that any UnitMember that doesn't have a Khajiit variant will default to the "Any" UnitCulture.

    Ideally there would be something more hierarchical so you could do if "English UnitCulture exists use it, else use NorthernEuropean, else use Any", but this isn't how it works. This means you need to do a lot of cloning UnitMember Culture entries if you want to set up an entire new UnitCulture.
     
  7. kingchris20

    kingchris20 Wisdom Seeker

    Joined:
    Jul 30, 2012
    Messages:
    1,319
    Location:
    Resident of Heaven; Currently in the Waiting Room
    Yeah, right now I just want the Trader to have a unique Cultural variance for this civ. However, I've not yet been successful.

    If I add an entry under Units, with the Unit_trader tag, I get the white tigers in game and they run along side the actual camel and cart trader, which is fine, but every civ also has this same unit model (even with the Khajiit culture tag)........The result is not unexpected though as I've basically just added another member to the existing trader members.

    It just baffles me that the entries I posted in the other post didn't work so that only the Khajiit has white tigers for a trade caravan. I mean it is the exact same way firaxis did with the unique barbarian scout..........the only difference is the white tiger is a completely different model than the camel and cart trader.......whereas the barbarian scout is the same base model with different attachments.
     

Share This Page