PlotinusRedux
Warlord
- Joined
- Jul 11, 2013
- Messages
- 196
[EDIT1]Added additional information inside "[EDIT1]...[/EDIT1]" blocks.[/EDIT1]
The winter patch finally made it possible to add icons and artdefs without users having to copy files. I played around with @UncivilizedGuy 's Slavery mod because he has both icon and artdef changes, and got it working without copying any of his files to my base directory, so I'm going to use that as an example.
Note this shouldn't be considered a replacement for his mod, it is an example only.
First the example, then some explication:
Mod directory structure:
Slavery.modinfo file:
Slavery.dep file:
Data/Icons_Slavery.xml file:
ArtDefs/Units.artdef file:
Data/Data.xml: This is just where he's updating the Gameplay database we're already familiar with, so I'm not including it here.
Icons
The new <Icons> element can occur under <Components> and/or <Settings> depending on whether the icons are needed during game set up or game play. Firaxis seems to have added the same files to both.
The file itself is an XML (though .sql would probably also work) that updates the in-memory icons database the same way that files under <UpdateDatabase> and <Custom> update their respective databases. [EDIT1]Per @Craig_Sutter, you can't use the same file names already used in the base directories, like "Icons_Buildings.xml".[/EDIT1]
This means you don't want to copy an existing file like Icons_Buildings.xml and start adding to it--your file only needs to add the new icons you want. [EDIT1]See @Horem 's post below for how to add new icon graphics.[/EDIT1] Note you can add icons of all types--buildings, units, etc., in the same file.
For "Name" you just prepend "ICON_" to whatever the identifier for your building, unit, etc., is--i.e., the value you used for "Type" when you added it to the Types table.
Dep/Artdefs
For artdefs, you *have* to use the same name as the file you are adding to, like Units.artdef, or the game won't load it--at least after an hour of trying I couldn't get it to load anything else (sorry @Deliverator ). You include only your additions to the file--you're not replacing the original file, you're adding to it. Note in the example Units.artdef file, only the XML for UNIT_SLAVE is included. [EDIT1]Per @Horem you can override existing objects by using the same name, such as defining a UNIT_TRADER object to change the traders' horses to reindeer.[/EDIT1]
The artdef files [EDIT1]must be in an ArtDefs directory off your mod's root directory per @Hajee .[/EDIT1]
Artdef files don't go anywhere in the .modinfo file at all, not even the main <Files> element--only in the .dep file which you put in your .modinfo file under <Components> and/or <Settings> under <ModArt><Items><File>.
The .dep file can be called anything, and needs to include any .artdef files you've added. Again, you seem to be extending the existing definitions rather than replacing them, so it's only necessary to include files you're adding in dependencies, etc., and you don't need to re-specify things like <LibraryDependencies> unless you really added a library--which would mean you've figured out how to create BLP files and you should be writing this post, not reading it....
You can see for example I didn't even include a <ArtDefDependencies> element. That *might* be necessary if you change 2 files that have a dependency on each other, but I'd try it without it first.
This is also where you'd add .blp files if we knew how to create them yet.
It's just as simple as that. The new DLC files seem to include a lot of stuff that isn't necessary, by testing I worked out the minimum required to get things working.
I've updated the XSD file at https://forums.civfanatics.com/threads/civ6-modinfo-schema.606784/ to reflect the new changes.
The winter patch finally made it possible to add icons and artdefs without users having to copy files. I played around with @UncivilizedGuy 's Slavery mod because he has both icon and artdef changes, and got it working without copying any of his files to my base directory, so I'm going to use that as an example.
Note this shouldn't be considered a replacement for his mod, it is an example only.
First the example, then some explication:
Mod directory structure:
Code:
\Mods
\Slavery by UG (V. 2.4)
Slavery.modinfo
Slavery.dep
\Data
Data.xml
Icons_Slavery.xml
\ArtDefs
Units.artdef
Slavery.modinfo file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="039cbfec-dbde-4e2e-9bb9-19787b5c6F813">
<Properties>
<Name>Plot's Test of UncivilizedGuy's Slavery</Name>
<Teaser>Plot's test of UncivilizedGuy's Slavery.</Teaser>
<Authors>UncivilizedGuy</Authors>
<SpecialThanks>Special thanks go out to Onno "donald23" Zaal, Madjinn, and Deliverator</SpecialThanks>
</Properties>
<Files>
<File>Data/Data.xml</File>
<File>Data/Icons_Slavery.xml</File>
<File>Slavery.dep</File>
</Files>
<Components>
<Icons id="UGSIcons">
<Items>
<File>Data/Icons_Slavery.xml</File>
</Items>
</Icons>
<UpdateDatabase id="UGSComponent">
<Items>
<File>Data/Data.xml</File>
</Items>
</UpdateDatabase>
<ModArt id="UGSModArt">
<Items>
<File>Slavery.dep</File>
</Items>
</ModArt>
</Components>
</Mod>
Slavery.dep file:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<AssetObjects::GameDependencyData>
<ID>
<!-- A Unique Name and GUID for your mod-->
<name text="Civ6Slave"/>
<id text="cb2f71b7-843e-4af3-9ca7-992acda9c122"/>
</ID>
<SystemDependencies>
<Element>
<!-- The type of thing you are adding -->
<ConsumerName text="Units"/>
<ArtDefDependencyPaths>
<!-- The name of the file you are adding,
seems to have to be the same as a base
file name -->
<Element text="Units.artdef"/>
</ArtDefDependencyPaths>
</Element>
</SystemDependencies>
</AssetObjects::GameDependencyData>
Data/Icons_Slavery.xml file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
<IconDefinitions>
<!-- In general, just add "ICON_" to the front of any object you added -->
<Row Name="ICON_POLICY_FORCED_LABOR" Atlas="ICON_ATLAS_POLICIES" Index="0"/>
<Row Name="ICON_POLICY_INDENTURED_SERVITUDE" Atlas="ICON_ATLAS_POLICIES" Index="0"/>
<Row Name="ICON_BUILDING_SLAVE_MARKET" Atlas="ICON_ATLAS_BUILDINGS" Index="11"/>
<Row Name="ICON_UNIT_SLAVE_PORTRAIT" Atlas="ICON_ATLAS_UNIT_PORTRAITS" Index="1"/>
<Row Name="ICON_UNIT_SLAVE" Atlas="ICON_ATLAS_UNITS" Index="1"/>
</IconDefinitions>
</GameInfo>
ArtDefs/Units.artdef file:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<AssetObjects::ArtDefSet>
<m_Version>
<major>4</major>
<minor>0</minor>
<build>238</build>
<revision>243</revision>
</m_Version>
<m_TemplateName text="Units"/>
<m_RootCollections>
<Element>
<m_CollectionName text="Units"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Builder"/>
<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=""/>
<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"/>
<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>-500</m_nValue>
<m_ParamName text="DisplayLevel"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Members"/>
<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="Builder_Ancient01"/>
<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="A"/>
</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="Builder_Ancient02"/>
<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="B"/>
</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="Builder_Ancient03"/>
<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="C"/>
</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="Builder_Ancient04"/>
<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="D"/>
</Element>
</Element>
<Element>
<m_CollectionName text="Audio"/>
<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="Entry"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Builder"/>
<m_ParamName text="XrefName"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="BUILDER"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="UNIT_SLAVE"/>
</Element>
</Element>
</m_RootCollections>
</AssetObjects::ArtDefSet>
Data/Data.xml: This is just where he's updating the Gameplay database we're already familiar with, so I'm not including it here.
Icons
The new <Icons> element can occur under <Components> and/or <Settings> depending on whether the icons are needed during game set up or game play. Firaxis seems to have added the same files to both.
The file itself is an XML (though .sql would probably also work) that updates the in-memory icons database the same way that files under <UpdateDatabase> and <Custom> update their respective databases. [EDIT1]Per @Craig_Sutter, you can't use the same file names already used in the base directories, like "Icons_Buildings.xml".[/EDIT1]
This means you don't want to copy an existing file like Icons_Buildings.xml and start adding to it--your file only needs to add the new icons you want. [EDIT1]See @Horem 's post below for how to add new icon graphics.[/EDIT1] Note you can add icons of all types--buildings, units, etc., in the same file.
For "Name" you just prepend "ICON_" to whatever the identifier for your building, unit, etc., is--i.e., the value you used for "Type" when you added it to the Types table.
Dep/Artdefs
For artdefs, you *have* to use the same name as the file you are adding to, like Units.artdef, or the game won't load it--at least after an hour of trying I couldn't get it to load anything else (sorry @Deliverator ). You include only your additions to the file--you're not replacing the original file, you're adding to it. Note in the example Units.artdef file, only the XML for UNIT_SLAVE is included. [EDIT1]Per @Horem you can override existing objects by using the same name, such as defining a UNIT_TRADER object to change the traders' horses to reindeer.[/EDIT1]
The artdef files [EDIT1]must be in an ArtDefs directory off your mod's root directory per @Hajee .[/EDIT1]
Artdef files don't go anywhere in the .modinfo file at all, not even the main <Files> element--only in the .dep file which you put in your .modinfo file under <Components> and/or <Settings> under <ModArt><Items><File>.
The .dep file can be called anything, and needs to include any .artdef files you've added. Again, you seem to be extending the existing definitions rather than replacing them, so it's only necessary to include files you're adding in dependencies, etc., and you don't need to re-specify things like <LibraryDependencies> unless you really added a library--which would mean you've figured out how to create BLP files and you should be writing this post, not reading it....
You can see for example I didn't even include a <ArtDefDependencies> element. That *might* be necessary if you change 2 files that have a dependency on each other, but I'd try it without it first.
This is also where you'd add .blp files if we knew how to create them yet.
It's just as simple as that. The new DLC files seem to include a lot of stuff that isn't necessary, by testing I worked out the minimum required to get things working.
I've updated the XSD file at https://forums.civfanatics.com/threads/civ6-modinfo-schema.606784/ to reflect the new changes.
Last edited: