Reusing Unit/Building Models Etc

luckybutjinxed

Chieftain
Joined
May 2, 2017
Messages
20
Ok so since I am not a 3-D modeler or artist, but don't want blank (or hilariously wrong like my current ship unit using floating works) units or buildings, how can I tell the game to source the original file? For example, my unique building is a factory replacement, how can I tell the game to use the models for the generic factory?
 
You have to edit artdef files, for instance you look for your ship in units.artdef, copy all element of it, paste, and change the unit name (last line of element) into your name. See my example I made a Nau from
Privateer:

Code:
 <Element>
        <m_Fields>
          <m_Values>
            <Element class="AssetObjects:ArtDefReferenceValue">
              <m_ElementName text="Naval"/>
              <m_RootCollectionName text="UnitFormationTypes"/>
              <m_ArtDefPath text="Units.artdef"/>
              <m_CollectionIsLocked>true</m_CollectionIsLocked>
              <m_TemplateName text=""/>
              <m_ParamName text="Formation"/>
            </Element>
            <Element class="AssetObjects:ArtDefReferenceValue">
              <m_ElementName text=""/>
(.................................................................................................)
<m_Value text="Privateer"/>
                    <m_ParamName text="XrefName"/>
                  </Element>
                </m_Values>
              </m_Fields>
              <m_ChildCollections/>
              <m_Name text="PRIVATEER"/>
              <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
          </Element>
        </m_ChildCollections>
        <m_Name text="UNIT_NAU"/>
        <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
      </Element>
        </Element>
 
You have to edit artdef files, for instance you look for your ship in units.artdef, copy all element of it, paste, and change the unit name (last line of element) into your name. See my example I made a Nau from
Privateer:

Code:
 <Element>
        <m_Fields>
          <m_Values>
            <Element class="AssetObjects:ArtDefReferenceValue">
              <m_ElementName text="Naval"/>
              <m_RootCollectionName text="UnitFormationTypes"/>
              <m_ArtDefPath text="Units.artdef"/>
              <m_CollectionIsLocked>true</m_CollectionIsLocked>
              <m_TemplateName text=""/>
              <m_ParamName text="Formation"/>
            </Element>
            <Element class="AssetObjects:ArtDefReferenceValue">
              <m_ElementName text=""/>
(.................................................................................................)
<m_Value text="Privateer"/>
                    <m_ParamName text="XrefName"/>
                  </Element>
                </m_Values>
              </m_Fields>
              <m_ChildCollections/>
              <m_Name text="PRIVATEER"/>
              <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
          </Element>
        </m_ChildCollections>
        <m_Name text="UNIT_NAU"/>
        <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
      </Element>
        </Element>
Oh wow! Thanks!
 
@raen I tried to do the same for MUSKETMAN to no avail, any suggestions? Below is what I have:

Code:
<AssetObjects:ArtDefSet>
    <m_Version>
        <major>4</major>
        <minor>0</minor>
        <build>260</build>
        <revision>754</revision>
    </m_Version>
    <m_TemplateName text="Units"/>
        <m_RootCollections>
            <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text="Musketman"/>
                            <m_RootCollectionName text="UnitCombat"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text="Units"/>
                            <m_ParamName text="UnitCombat"/>
                        </Element>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_Value text="Musketman"/>
                            <m_ParamName text="XrefName"/>
                        </Element>
                    </m_Values>
                </m_Fields>
            </Element>
            <m_ChildCollections>
                <Element>
                    <m_Fields>
                        <m_Values/>
                    </m_Fields>
                    <m_ChildCollections/>
                    <m_Name text="MUSKETMAN"/>
                    <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                </Element>
            </m_ChildCollections>
            <m_Name text="UNIT_GA_TRINITARIO"/>
            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
        </m_RootCollections>
</AssetObjects:ArtDefSet>
 
@raen I tried to do the same for MUSKETMAN to no avail, any suggestions? Below is what I have:

Code:
<AssetObjects:ArtDefSet>
    <m_Version>
        <major>4</major>
        <minor>0</minor>
        <build>260</build>
        <revision>754</revision>
    </m_Version>
    <m_TemplateName text="Units"/>
        <m_RootCollections>
            <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text="Musketman"/>
                            <m_RootCollectionName text="UnitCombat"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text="Units"/>
                            <m_ParamName text="UnitCombat"/>
                        </Element>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text=""/>
                            <m_Value text="Musketman"/>
                            <m_ParamName text="XrefName"/>
                        </Element>
                    </m_Values>
                </m_Fields>
            </Element>
            <m_ChildCollections>
                <Element>
                    <m_Fields>
                        <m_Values/>
                    </m_Fields>
                    <m_ChildCollections/>
                    <m_Name text="MUSKETMAN"/>
                    <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                </Element>
            </m_ChildCollections>
            <m_Name text="UNIT_GA_TRINITARIO"/>
            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
        </m_RootCollections>
</AssetObjects:ArtDefSet>

see my mod recent update to see if you missed something.
 
see my mod recent update to see if you missed something.
I checked your most recent mod and got the following, it isn't working though.
Code:
<AssetObjects:ArtDefSet>
    <m_Version>
        <major>1</major>
        <minor>0</minor>
        <build>1</build>
        <revision>3</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="Swordsman"/>
                            <m_RootCollectionName text="UnitFormationTypes"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text="Units"/>
                            <m_ParamName text="Formation"/>
                        </Element>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text="Musketman"/>
                            <m_RootCollectionName text="UnitCombat"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text="Units"/>
                            <m_ParamName text="UnitCombat"/>
                        </Element>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text="WarriorEscort"/>
                            <m_RootCollectionName text="UnitFormationTypes"/>
                            <m_ArtDefPath text="Units.artdef"/>
                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                            <m_TemplateName text="Units"/>
                            <m_ParamName text="EscortFormation"/>
                        </Element>
                        <Element class="AssetObjects:ArtDefReferenceValue">
                            <m_ElementName text="UNIT_ANCIENTEMBARK"/>
                            <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>true</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>4</m_nValue>
                                        <m_ParamName text="Count"/>
                                    </Element>
                                    <Element class="AssetObjects:ArtDefReferenceValue">
                                        <m_ElementName text="Musketman"/>
                                        <m_RootCollectionName text="UnitMemberTypes"/>
                                        <m_ArtDefPath text="Units.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text=""/>
                                        <m_ParamName text="Type"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Members001"/>
                            <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="Musketman"/>
                                        <m_ParamName text="XrefName"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="MUSKETMAN"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                </m_ChildCollections>
                <m_Name text="UNIT_GA_TRINITARIO"/>
                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
        </Element>
    </m_RootCollections>
</AssetObjects:ArtDefSet>
 
All ok with your artdef, if not working must be other thing, do you have units artdef in your DEP file?

Does UNIT_GA_TRINITARIO match your unit xml definitions?

Yes. I copied the <SystemDependencies> tree from your .dep file and UNIT_GA_TRINITARIO matches my unit definition file.
 
I'm in the same situation as KoubaK, so I'm waiting with baited breath here to see what you guys figure out.
 
@KoubaK If you are using Modbuddy you should use the Mod.Art.xml to specify your .artdef and .xlp dependencies. The .dep file will then be generated by the build and doesn't need to be made by hand. I've edited your Mod.Art.xml to include references to your Units.artdef and your two .xlps and attached it to this post. Also when you say it doesn't work what do you mean? Are there any errors in your Logs directory e.g. Database.log.
 

Attachments

@raen the link should take you to the actual, built, mod. I don't why I thought you were asking me for the mod files, without building them first.
@Deliverator I updated the Mod.Art.xml file and it built my .dep for me, as you said. Thank you.

Now, what I mean by "it doesn't work" is that I am still getting random unit icons and 3d models for my UU.
I wanted to get my UNIT_GA_TRINITARIO to use the icons/art files from the MUSKETMAN unit that already comes with the game.

//Edit: Also, there are no errors in my logs.
 
I'm trying to get a unique district's art to be replaced by the default art. I've referenced it an .artdef file and in the mod.Art.xml file using ModBuddy. However, the model for it doesn't appear in the game. Anyone wanna take a look at it for me? My Mod.Art file is attached and the .artdef fuke is below. The name for my district is "DISTRICT_VN_GRAND_CANAL"

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<AssetObjects:ArtDefSet>
    <m_Version>
        <major>3</major>
        <minor>0</minor>
        <build>202</build>
        <revision>872</revision>
    </m_Version>
    <m_TemplateName text="Districts"/>
    <m_RootCollections>
        <Element>
            <m_CollectionName text="District"/>
            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects:BoolValue">
                            <m_bValue>false</m_bValue>
                            <m_ParamName text="CanAffectBuildings"/>
                        </Element>
                    </m_Values>
                </m_Fields>
                <m_ChildCollections>
                    <Element>
                        <m_CollectionName text="Landmark"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects:ArtDefReferenceValue">
                                        <m_ElementName text="DISTRICT_HARBOR"/>
                                        <m_RootCollectionName text="Districts"/>
                                        <m_ArtDefPath text="Landmarks.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Landmarks"/>
                                        <m_ParamName text="Xref"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Landmark1"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                    <Element>
                        <m_CollectionName text="StrategicView"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects:ArtDefReferenceValue">
                                        <m_ElementName text="Harbor"/>
                                        <m_RootCollectionName text="Districts"/>
                                        <m_ArtDefPath text="StrategicView.artdef"/>
                                        <m_CollectionIsLocked>false</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="Districts.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Districts"/>
                                        <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="Harbor_Pillaged"/>
                                        <m_RootCollectionName text="Districts"/>
                                        <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="Districts.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Districts"/>
                                        <m_ParamName text="State"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="StrategicView002"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects:ArtDefReferenceValue">
                                        <m_ElementName text="Harbor_UnderConstruction"/>
                                        <m_RootCollectionName text="Districts"/>
                                        <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="UnderConstruction"/>
                                        <m_RootCollectionName text="BuildStates"/>
                                        <m_ArtDefPath text="Districts.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Districts"/>
                                        <m_ParamName text="State"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="StrategicView003"/>
                            <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="Build_District_Harbor"/>
                                        <m_ParamName text="XrefName"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Build_District_Harbor"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                    <Element>
                        <m_CollectionName text="AmbPlay"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects:StringValue">
                                        <m_Value text="PLAY_AMBIENCE_DISTRICT_HARBOR"/>
                                        <m_ParamName text="XrefName"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="PLAY_AMBIENCE_DISTRICT_HARBOR"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                    <Element>
                        <m_CollectionName text="AmbStop"/>
                        <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects:StringValue">
                                        <m_Value text="STOP_AMBIENCE_DISTRICT_HARBOR"/>
                                        <m_ParamName text="XrefName"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="STOP_AMBIENCE_DISTRICT_HARBOR"/>
                            <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
                        </Element>
                    </Element>
                </m_ChildCollections>
                <m_Name text="DISTRICT_VN_GRAND_CANAL"/>
                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
        </Element>
        <Element>
            <m_CollectionName text="BuildStates"/>
            <m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
            <Element>
                <m_Fields>
                    <m_Values/>
                </m_Fields>
                <m_ChildCollections/>
                <m_Name text="Completed"/>
                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
            <Element>
                <m_Fields>
                    <m_Values/>
                </m_Fields>
                <m_ChildCollections/>
                <m_Name text="Pillaged"/>
                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
            <Element>
                <m_Fields>
                    <m_Values/>
                </m_Fields>
                <m_ChildCollections/>
                <m_Name text="UnderConstruction"/>
                <m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
            </Element>
        </Element>
    </m_RootCollections>
</AssetObjects:ArtDefSet>
 

Attachments

@KoubaK: I am no expert at xlp (since I dont use them in my mod) but I think you are probably missing units.xlp, imho, if you don´t have icons there the game probably cant connect to your artdefs. Others may tell you better from now.
 
Back
Top Bottom