Firebug
Not-so Great Engineer
How do we setup Artdefs for unique buildings? i just want my University replace to stay looking like the University for now, since we don't fully have a grasp on custom models yet, but it's just invisible.
The bad news is that I can find zero mods that can reuse existing art for anything 3D except units, so there's nobody's work to copy from.
<PlayerItems>
<Row CivilizationType="CIVILIZATION_UK" LeaderType="LEADER_QUEENVICTORIA" Type="BUILDING_BANKOFENGLAND" Icon="ICON_BUILDING_BANK" Name="LOC_BUILDING_BANKOFENGLAND_NAME" Description="LOC_BUILDING_BANKOFENGLAND_DESCRIPTION" SortIndex="30"/>
<Row CivilizationType="CIVILIZATION_UK" LeaderType="LEADER_QUEENVICTORIA" Type="BUILDING_UKMILL" Icon="ICON_BUILDING_FACTORY" Name="LOC_BUILDING_UKMILL_NAME" Description="LOC_BUILDING_UKMILL_DESCRIPTION" SortIndex="40"/>
</PlayerItems>
<Buildings>
<Row BuildingType="BUILDING_BANKOFENGLAND" Name="LOC_BUILDING_BANKOFENGLAND_NAME" Description="LOC_BUILDING_BANKOFENGLAND_DESCRIPTION" PrereqTech="TECH_BANKING" PrereqDistrict="DISTRICT_COMMERCIAL_HUB" PurchaseYield="YIELD_GOLD" Cost="265" AdvisorType="ADVISOR_GENERIC" CitizenSlots="1" MaxWorldInstances="1" TraitType="TRAIT_CIVILIZATION_BUILDING_BANKOFENGLAND"/>
<Row BuildingType="BUILDING_UKMILL" Name="LOC_BUILDING_UKMILL_NAME" Description="LOC_BUILDING_UKMILL_DESCRIPTION" PrereqTech="TECH_MASS_PRODUCTION" PrereqDistrict="DISTRICT_INDUSTRIAL_ZONE" PurchaseYield="YIELD_GOLD" Cost="250" AdvisorType="ADVISOR_GENERIC" Maintenance="2" RegionalRange="6"
MaxWorldInstances="1" RequiresRiver="true" TraitType="TRAIT_CIVILIZATION_BUILDING_UKMILL"/>
</Buildings>
You should be able to reuse existing Icons from in game without having to touch an ArtDef file. Below you can see I'm reusing the Bank and Factory Icons. Ignore the MaxWorldInstances etc - these are just making the buildings single build. There is also other code that prevents a city building both a normal Bank and a Bank of England. This sort of makes them mini Civ specific wonders.
<Element>
<m_CollectionName text="StrategicView"/>
<m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Bank"/>
<m_RootCollectionName text="Buildings"/>
<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="Buildings.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Buildings"/>
<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="Bank_UnderConstruction"/>
<m_RootCollectionName text="Buildings"/>
<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="UnderConstruction"/>
<m_RootCollectionName text="BuildStates"/>
<m_ArtDefPath text="Buildings.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Buildings"/>
<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="Bank_Pillaged"/>
<m_RootCollectionName text="Buildings"/>
<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="Pillaged"/>
<m_RootCollectionName text="BuildStates"/>
<m_ArtDefPath text="Buildings.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Buildings"/>
<m_ParamName text="State"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="StrategicView003"/>
<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="BUILDING_BANK"/>
<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
</Element>
...
<Element>
<consumerName text="StrategicView_Sprite"/>
<relativeArtDefPaths>
<Element text="Buildings.artdef"/>
<Element text="StrategicView.artdef"/>
</relativeArtDefPaths>
<libraryDependencies>
<Element text="StrategicView_Sprite"/>
<Element text="StrategicView_DirectedAsset"/>
</libraryDependencies>
<loadsLibraries>true</loadsLibraries>
</Element>
...
...
<Element>
<consumerName text="WorldView_Translate"/>
<relativeArtDefPaths>
<Element text="Buildings.artdef"/>
<Element text="StrategicView.artdef"/>
</relativeArtDefPaths>
<libraryDependencies/>
<loadsLibraries>false</loadsLibraries>
</Element>
<Element>
<consumerName text="StrategicView_Translate"/>
<relativeArtDefPaths>
<Element text="Buildings.artdef"/>
<Element text="StrategicView.artdef"/>
</relativeArtDefPaths>
<libraryDependencies/>
<loadsLibraries>false</loadsLibraries>
</Element>
...
I FIGURED IT OUT!
The way it's done is with both the buildingart.def and the landmarks.artdef.
This quick tutorial isn't going to be the best but the best way to learn is to load up the .artdefs from the pantry into asseteditor and just compare what you need to type in your own.
- Create a buildings.artdef for your mod. You need to add a new element under both the buildings and the building chains tabs.
- When you create the new element under Building, name it the same as you do in your files. For example i did BUILDING_FB_ROYAL_ACADEMY.
- You don't need to worry about the audio section of your building but the Strategic View part is where you enter in the name of the icon you want your building to use while in Strategic View. I was making a University replacement so i copied that one. (The best way to know what you need to type in here is to load the buildings.artdef from the pantry into asseteditor and take a look at Firaxis' stuff)
- You're already done with the Building section, so move onto BuildingChains. Here is where you need to make sure your building is linked to particular type of building. Again, take a look at the building.artdef from the pantry and copy the layout you need. I added my building to the ScienceBuildings element, and since it was a University replacement i added it to Buildings (Level 2).
- Now it's time for the Landmarks.artdef, this is a bit more complex but you'll need to add an element for the district that your building is going to be put inside and then make the basevariants, the buildingvariants and the buildingsets. Again, look at the landmarks.artdef from the pantry and take a look at how firaxis did it.
- You only need to reference the landmark.artdef once in your mod.art.xml for this to work, you don't need to reference the building.artdef at all.
This would be quite helpful if I could get my ModBuddy to actually create a .dep file for me to play with.
Mod.Art.xml is how you populate the .dep file, which is made when you build.
In your project properties you have to add "(Mod Art Dependency File)", one of the options, in two places, both of type UpdateArt, one under FrontEnd Actions and the other under In-Game Actions.
P.S. If you also add "Mod.Art.xml" to the project properties that might cause problems. The builder doesn't like duplication.