[UNIT] Unit not showing up - no error in log files

coffee junkie

Tech Hippie
Joined
Dec 16, 2006
Messages
446
Location
Europe
Here I come again, trying my hands at modding on Civ5 this time.

I'm working first to modify a simple civilization. Adding a unique unit. Can't be that hard ... ;)

Replacing a custom swordsman for a long swordsman.
The bloody custom swordsman is not showing up. Sure, the long swordsman neither, but that would be a problem if it would ...

After activating log, the only error was: IconTextureAtlases.
I dropped the custom icon and no more error. But still no unit showing up
I am at lost.

The XML for the unit
Spoiler :

<GameData>
<Units>
<Row>
<Class>UNITCLASS_LONGSWORDSMAN</Class>
<Type>UNIT_STARK_SWORDSMAN</Type>
<PrereqTech>TECH_STEEL</PrereqTech>
<Combat>21</Combat>
<Cost>105</Cost>
<Moves>3</Moves>
<CombatClass>UNITCOMBAT_MELEE</CombatClass>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Description>TXT_KEY_UNIT_STARK_SWORDSMAN</Description>
<Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_MEDIEVAL_LONGSWORDSMAN_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_STARK_SWORDSMAN_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_STARK_SWORDSMAN</Help>
<PurchaseOnly>true</PurchaseOnly>
<MoveAfterPurchase>true</MoveAfterPurchase>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<GoodyHutUpgradeUnitClass>UNITCLASS_MUSKETMAN</GoodyHutUpgradeUnitClass>
<AdvancedStartCost>30</AdvancedStartCost>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<Conscription>2</Conscription>
<ObsoleteTech>TECH_GUNPOWDER</ObsoleteTech>
<MoveRate>BIPED</MoveRate>
<UnitArtInfo>ART_DEF_UNIT_STARK_SWORDSMAN</UnitArtInfo>
<UnitFlagAtlas>STARK_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>0</UnitFlagIconOffset>
<IconAtlas>CIV_COLOR_ATLAS_STARK</IconAtlas>
<PortraitIndex>6</PortraitIndex>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<UnitAIType>UNITAI_DEFENSE</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_ClassUpgrades>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<UnitClassType>UNITCLASS_MUSKETMAN</UnitClassType>
</Row>
</Unit_ClassUpgrades>
<!-- Unit_FreePromotions -->
<Unit_Flavors>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>12</Flavor>
</Row>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>6</Flavor>
</Row>
</Unit_Flavors>
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<ResourceType>RESOURCE_IRON</ResourceType>
</Row>
</Unit_ResourceQuantityRequirements>
<Civilization_UnitClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_STARK</CivilizationType>
<UnitClassType>UNITCLASS_LONGSWORDSMAN</UnitClassType>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
</Row>
</Civilization_UnitClassOverrides>
<UnitGameplay2DScripts>
<Row>
<UnitType>UNIT_STARK_SWORDSMAN</UnitType>
<SelectionSound>AS2D_SELECT_LONGSWORDSMAN</SelectionSound>
<FirstSelectionSound>AS2D_BIRTH_LONGSWORDSMAN</FirstSelectionSound>
</Row>
</UnitGameplay2DScripts>

<Language_en_US>
<Row Tag="TXT_KEY_UNIT_STARK_SWORDSMAN">
<Text>Stark Swordsman</Text>
</Row>
<Row Tag="TXT_KEY_CIVILOPEDIA_UNITS_MEDIEVAL_STARK_SWORDSMAN_TEXT">
<Text>Powerful Medieval infantry Unit from the North of Westeros.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_STARK_SWORDSMAN_STRATEGY">
<Text>The Stark Swordssman is the standard medieval infantry combat unit. It is more powerful than the Knight, but much slower. It also outclasses the Pikeman, but doesn't receive that unit's bonus versus mounted units. Use Longswordsmen and Catapults to attack enemy cities.</Text>
</Row>
<Row Tag="TXT_KEY_UNIT_HELP_STARK_SWORDSMAN">
<Text>Powerful Medieval infantry Unit.</Text>
</Row>
</Language_en_US>
</GameData>


I am not working with ModBuddy because I'm on Mac.
 
So. I found something.

<PurchaseOnly>true</PurchaseOnly>
<MoveAfterPurchase>true</MoveAfterPurchase>

This looks like something that shouldn't be there and might explain why I could never see the unit. Once removed, the unit was there, waiting for me at launch.

I have a DDS problem now but at least, now I can see ... which is a mighty improvement.
The texture won't load. So, here's to the red and white unit :D
 
Last edited:
The unit icon is now working!
... always check you have the same name between your art xml and the unit xml ...

But I still have problems with the texture of the unit.
How the hell do you do it people?
From the many files I scanned, all you do is important a unit from the game, pack a dds somewhere and somehow-by-magic, the mod just slam the texture on the unit.

The unit is showing nicely but not the texture, I have a checkerboard of red and white.

What kind of witchcraft is this?!
 
I'm not sure if it's related to textures not loading in, but did you try checking the 'reload unit system' checkbox in your mod's properties? Also, did you set VFS=true for your texture file? And did you encode your dds/texture files the right way? (for icons I always use RGBA8 encoding, though I'm not sure if that's necessary for unit textures as well).

Again, these are all just guesses as I've never messed with unit textures myself
 
Well, I even try with a simple unit from the game, without a different texture I mean, and I still get the checkerboard ...
So actually, for the moment, my problem is I get a unit, but no texture file. Unique or not, no texture. And it's not even mine !

ReloadUnitSystem : it is activated.
And yes, I did but true to all texture file.
 


From what I gathered. If nothing comes up in database.log or xml.log it is mostly a modinfo error. But I can't see what would that be.

Spoiler modinfo :

<?xml version="1.0" encoding="utf-8"?>
<Mod id="f269135b-5c63-b7bf-11e4-ddea07d337a1" version="1">
<Properties>
<Name>Ice and Fire</Name>
<Teaser>Adds House Stark as Civilization - with Jon Snow as leader.</Teaser>
<Description>stuff will come here</Description>
<Authors>AK Sensei & Bloody Mary</Authors>
<SpecialThanks>--INSERT--</SpecialThanks>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>1</AffectsSavedGames>
<MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
<SupportsMultiplayer>1</SupportsMultiplayer>
<SupportsHotSeat>1</SupportsHotSeat>
<SupportsMac>1</SupportsMac>
<ReloadAudioSystem>1</ReloadAudioSystem>
<ReloadLandmarkSystem>0</ReloadLandmarkSystem>
<ReloadStrategicViewSystem>1</ReloadStrategicViewSystem>
<ReloadUnitSystem>1</ReloadUnitSystem>
</Properties>
<Dependencies />
<References />
<Blocks />
<Files>
<File md5="F269135B5C63B7BF11E4DDEA07D337A1" import="1">Units/Units_Stark.xml</File>
<File md5="73CD612983C9C8846064187F18C41881" import="1">Units/Stark_Units.sql</File>
<File md5="6940465DD0C2BD20AE8A6E6E6C801E29" import="1">Units/northbladeFlag.dds</File>
<File md5="F4AE0BEAE19178EEB80D13FD53A7509B" import="1">Units/northblade_sref.dds</File>
<File md5="83CBA7363A0CB2C2F0B3C30A44E19F4D" import="1">Units/northblade.gr2</File>
<File md5="07F7B303CB4FDACE1A761ED2548F6CC0" import="1">Units/northblade.fxsxml</File>
<File md5="C0DFFF838851B1B4DEEE74E997A12F49" import="1">Units/northblade.dds</File>
<File md5="76662F33BC3CF91056F9D74784B6406D" import="1">Sound/Eddard_War.mp3</File>
<File md5="9F6484FD714BA0B4143CF7A5164B93D4" import="1">Sound/Eddard_Peace.mp3</File>
<File md5="EAFDFED2FD17547DE4907D8A455B4BBA" import="1">Sound/Eddard_Music.xml</File>
<File md5="DF0B3DA6EFAD203336598EF95F0C3C1D" import="0">Lua/GardenProduction.lua</File>
<File md5="DC185A3C6E73AAD706DE7D3DC78EF8D8" import="0">Leaders/Jon.xml</File>
<File md5="CCDD16A6936410EFFE9EBF287DBCE2CD" import="1">GameInfo/Stark_Icons.xml</File>
<File md5="35BC48C245732976A1E8CF498BCB7F86" import="0">GameInfo/Stark_Diplomacy.xml</File>
<File md5="153A6526267C3342BDF32B7FE08B71FC" import="0">GameInfo/GameText.xml</File>
<File md5="921FAAD4AC5951343686202475009872" import="0">Civilizations/Winter_Is_Here.xml</File>
<File md5="C3B2E71D86F0A0B225D078231E70D6F2" import="0">Civilizations/Stark_Trait.xml</File>
<File md5="7E7B7B0EC040E55F1F0DE1F03C13A0D4" import="1">Civilizations/Jon_Scene.xml</File>
<File md5="F2A71557A09A21B8E8A085911E4E27C2" import="1">Civilizations/House_Stark.xml</File>
<File md5="B73ECDF97090607D8234C09007D308B2" import="1">Buildings/Godswood.xml</File>
<File md5="7E2B46364C12142D1BD83948A66C5464" import="1">Buildings/Glass_Gardens.xml</File>
<File md5="17531D370C27A70D0018E6F37D8E59A8" import="1">Art/StarkPortrait80.dds</File>
<File md5="A9FA6EC043D3B3B4CD55306EA4426CE1" import="1">Art/StarkPortrait64.dds</File>
<File md5="F1BF0003C9DD098E0774C16D468BF899" import="1">Art/StarkPortrait45.dds</File>
<File md5="F9E78EFD227E0348493FD3F6F4640C0F" import="1">Art/StarkPortrait32.dds</File>
<File md5="16686CC1FB5698C26E47DFC410D5352A" import="1">Art/StarkPortrait256.dds</File>
<File md5="072A3FBF98218A49F50432DB56F9E15E" import="1">Art/StarkPortrait214.dds</File>
<File md5="E12D2DCB6EF750ADC7CEFA6F4C8D6EE0" import="1">Art/StarkPortrait128.dds</File>
<File md5="FAA12BEA650754DB1212D7597B06AF3A" import="1">Art/StarkAlphaAtlas80.dds</File>
<File md5="4E798B835AE065AF3ED48A4732892374" import="1">Art/StarkAlphaAtlas64.dds</File>
<File md5="F2AE9445EA7161A326A8EE30C7373BED" import="1">Art/StarkAlphaAtlas48.dds</File>
<File md5="4F2F1ED80EB79BBE97E0A612DACE4F00" import="1">Art/StarkAlphaAtlas45.dds</File>
<File md5="582BE157034904E994CAABF02FB94756" import="1">Art/StarkAlphaAtlas32.dds</File>
<File md5="BBFBDE2F8CD256F16EEC1467B4C85997" import="1">Art/StarkAlphaAtlas256.dds</File>
<File md5="5F502BFCF0A84CDE81B49F3EF619FE51" import="1">Art/StarkAlphaAtlas24.dds</File>
<File md5="06F6DDA7EF7270AD7A59245FD1A82FBA" import="1">Art/StarkAlphaAtlas22.dds</File>
<File md5="5A7D3E1E9F6E145F759D2CE51737F49C" import="1">Art/StarkAlphaAtlas16.dds</File>
<File md5="CB3130B45CB068AB213AE7087883BD9A" import="1">Art/StarkAlphaAtlas128.dds</File>
<File md5="356A618C0C08666B57E92B0C2EAF7FE4" import="1">Art/NorthMap.dds</File>
<File md5="206F3746385F6183821FF9D527BE0237" import="1">Art/JonDOM.dds</File>
<File md5="8EF461FDD212F32B6F0C9A5D66BE01E2" import="1">Art/JonDiplo.dds</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>Buildings/Glass_Gardens.xml</UpdateDatabase>
<UpdateDatabase>Buildings/Godswood.xml</UpdateDatabase>
<UpdateDatabase>Civilizations/House_Stark.xml</UpdateDatabase>
<UpdateDatabase>Civilizations/Jon_Scene.xml</UpdateDatabase>
<UpdateDatabase>Civilizations/Stark_Trait.xml</UpdateDatabase>
<UpdateDatabase>Civilizations/Winter_Is_Here.xml</UpdateDatabase>
<UpdateDatabase>GameInfo/GameText.xml</UpdateDatabase>
<UpdateDatabase>GameInfo/Stark_Diplomacy.xml</UpdateDatabase>
<UpdateDatabase>GameInfo/Stark_Icons.xml</UpdateDatabase>
<UpdateDatabase>Leaders/Jon.xml</UpdateDatabase>
<UpdateDatabase>Sound/Eddard_Music.xml</UpdateDatabase>
<UpdateDatabase>Units/Units_Stark.xml</UpdateDatabase>
<UpdateDatabase>Units/Stark_Units.sql</UpdateDatabase>
</OnModActivated>
</Actions>
<EntryPoints>
<EntryPoint type="InGameUIAddin" file="Lua/GardenProduction.lua">
<Name>Garden Production</Name>
<Description>Civilization House Stark</Description>
</EntryPoint>
</EntryPoints>
</Mod>
 
Update: thanks to @Valessa for the answer.
The solution was simple: check the gr2 file so it bears the same name as the dds.
 
Top Bottom