Using Existing Models for New Unique Units Etc

Fuzzle07

Chieftain
Joined
Dec 22, 2020
Messages
6
Hi folks, I've been putting together a mod for my friends and I to play with that includes 8 new civilizations and leaders based on ourselves, complete with unique buildings, improvements, and units. I've managed to nail down the mechanical aspects of the mod so far, and I've gotten all of the 2D art to work (icons, portraits, backgrounds, and leader fallbacks).

The issue I have is with the 3D models. I don't want to create any new models for the buildings, improvements, or units so instead I want to reuse existing models. For example, one of my new units replaces the scout. I just want to use the existing scout model so that it doesn't appear as warriors, but I haven't had any luck so far.

I did stumble across this thread: https://forums.civfanatics.com/threads/setting-a-unit-model.652738/#post-15711159
I just tried exactly what they said in that thread, which I don't want to revive after so long. Should this work? Am I missing something? I ran the Mod.Art.xml generator after inserting the xml into my Units.artdef file, but my unique scout still appears as warriors.

On that note, should a similar process work with reusing buildings and improvements? Thanks in advance for any help you can give me!

My ArtDef:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<AssetObjects..ArtDefSet>
    <m_Version>
        <major>1</major>
        <minor>0</minor>
        <build>0</build>
        <revision>0</revision>
    </m_Version>
    <m_TemplateName text="Units"/>
    <m_RootCollections>
        <Element>
            <m_CollectionName text="Units"/>
            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text="Archer"/>
                            <m_RootCollectionName text="UnitFormationTypes"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>false</m_CollectionIsLocked>
                            <m_TemplateName text=""/>
                            <m_ParamName text="Formation"/>
                        </Element>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_RootCollectionName text="UnitCombat"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>false</m_CollectionIsLocked>
                            <m_TemplateName text=""/>
                            <m_ParamName text="UnitCombat"/>
                        </Element>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_RootCollectionName text="UnitFormationTypes"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text=""/>
                            <m_ParamName text="EscortFormation"/>
                        </Element>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text="UNIT_ANCIENTEMBARK_SINGLE"/>
                            <m_RootCollectionName text="Units"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text="Units"/>
                            <m_ParamName text="EmbarkedUnit"/>
                        </Element>
                        <Element class="AssetObjects..BoolValue">
                            <m_bValue>false</m_bValue>
                            <m_ParamName text="DoNotDisplayCharges"/>
                        </Element>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_RootCollectionName text="UnitCulture"/>
                            <m_ArtDefPath text="Cultures.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text=""/>
                            <m_ParamName text="Culture"/>
                        </Element>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_RootCollectionName text="Era"/>
                            <m_ArtDefPath text="Eras.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text=""/>
                            <m_ParamName text="Era"/>
                        </Element>
                        <Element class="AssetObjects..ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_RootCollectionName text="Units"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text=""/>
                            <m_ParamName text="ProxyUnit"/>
                        </Element>
                        <Element class="AssetObjects..BoolValue">
                            <m_bValue>false</m_bValue>
                            <m_ParamName text="PlayDeathOnDestroy"/>
                        </Element>
                        <Element class="AssetObjects..IntValue">
                            <m_nValue>0</m_nValue>
                            <m_ParamName text="DisplayLevel"/>
                        </Element>
                    </m_Values>
                </m_Fields>
                <m_ChildCollections>
                    <Element>
                        <m_CollectionName text="Members"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects..FloatValue">
                                        <m_fValue>1.000000</m_fValue>
                                        <m_ParamName text="Scale"/>
                                    </Element>
                                    <Element class="AssetObjects..IntValue">
                                        <m_nValue>1</m_nValue>
                                        <m_ParamName text="Count"/>
                                    </Element>
                                    <Element class="AssetObjects..ArtDefReferenceValue">
                                        <m_ElementName text="Scout"/>
                                        <m_RootCollectionName text="UnitMemberTypes"/>
                                        <m_ArtDefPath text="Units.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Units"/>
                                        <m_ParamName text="Type"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Members1"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects..FloatValue">
                                        <m_fValue>1.000000</m_fValue>
                                        <m_ParamName text="Scale"/>
                                    </Element>
                                    <Element class="AssetObjects..IntValue">
                                        <m_nValue>1</m_nValue>
                                        <m_ParamName text="Count"/>
                                    </Element>
                                    <Element class="AssetObjects..ArtDefReferenceValue">
                                        <m_ElementName text="ScoutDog"/>
                                        <m_RootCollectionName text="UnitMemberTypes"/>
                                        <m_ArtDefPath text="Units.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Units"/>
                                        <m_ParamName text="Type"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Members2"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                    <Element>
                        <m_CollectionName text="Audio"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects..StringValue">
                                        <m_Value text=""/>
                                        <m_ParamName text="XrefName"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text=""/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects..StringValue">
                                        <m_Value text="Scout"/>
                                        <m_ParamName text="XrefName"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="SCOUT"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                    <Element>
                        <m_CollectionName text="AttachmentVisibility"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                    </Element>
                </m_ChildCollections>
                <m_Name text="JGP_LABRADOR_UNIT_SLED_DOG"/>
                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
        </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>
        <Element>
            <m_CollectionName text="UnitTintTypes"/>
            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
        </Element>
        <Element>
            <m_CollectionName text="UnitGlobals"/>
            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
        </Element>
    </m_RootCollections>
</AssetObjects..ArtDefSet>
 
I tried to edit with this follow up, but it wouldn't work:
I've gotten it to work now with base game unit models, but the one unit I have made with a GS unit (the mountie) did not work. No model appears. Any insight would be awesome! Also still curious about buildings and improvements.
 
It should actually work, because I didn't find any mistake in the Artdef.
Did you make sure that the .dep file loads the Unit.ardef?
And the Modinfo should also load the .dep file:
Code:
  <InGameActions>
    <UpdateArt id="Art">
      <File>(Name).dep</File>
    </UpdateArt>
  </InGameActions>

And Yes, it works for Buildings and Improvements the same way. Just make certain that they're loaded correctly by the Game.
 
Last edited:
Thanks, I got it to work on my own. My only problem is accessing DLC/Expansion models. This isn't a big deal, but I had to resort to using base game models in place of some of the models I wanted to use. Especially strange since I'm able to easily access icons and such from the expansions.
 
I had the same issue, found that adding XPs Dependancie in the Modinfo solves the problem
 
For anyone else with the same issues:
I added the expansions at the very end of the Mod.Art.xml with the Name and Id from the top of both expansion .dep files. There was a dependency there already named "Shared" of which I mimicked the format. I imagine if I wanted to use other dlc models I could add their respective mod art dependencies in the same way.

I added dependencies in the modinfo but it didn't do anything.
 
Top Bottom