Unit help needed - unit is invisible! (Issue resolved).

Rob (R8XFT)

Ancient Briton
Retired Moderator
Joined
Aug 11, 2002
Messages
10,866
Location
Leeds (UK)
I've tried to use deliverator's Hyksos Bowman as a Pwenet Tribesman, but have an artdef file that only contains that unit. However, I end up with a unit that has a visible icon - however the unit itself if is invisible. I've posted my .artdef file below. I have everything else correct (if I use the MOAR units artdef with a changed unit name, it works). Can anyone please help?

Code:
<?xml version="1.0" encoding="UTF-8" ?>

<AssetObjects::ArtDefSet>

<m_Version>

<major>4</major>

<minor>0</minor>

<build>253</build>

<revision>867</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="Archer"/>

<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="WarriorEscort"/>

<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>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=""/>

<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="Members1"/>

<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="Entry"/>

<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>

</Element>

<Element>

<m_Fields>

<m_Values>

<Element class="AssetObjects::StringValue">

<m_Value text="Archer"/>

<m_ParamName text="XrefName"/>

</Element>

</m_Values>

</m_Fields>

<m_ChildCollections/>

<m_Name text="ARCHER"/>

<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>

</Element>

</Element>

</m_ChildCollections>

<m_Name text="UNIT_PWENET_TRIBESMAN"/>

<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>

<m_Fields>

<m_Values>

<Element class="AssetObjects::ArtDefReferenceValue">

<m_ElementName text=""/>

<m_RootCollectionName text="UnitMovementTypes"/>

<m_ArtDefPath text="Units.artdef"/>

<m_CollectionIsLocked>true</m_CollectionIsLocked>

<m_TemplateName text=""/>

<m_ParamName text="Movement"/>

</Element>

<Element class="AssetObjects::ArtDefReferenceValue">

<m_ElementName text=""/>

<m_RootCollectionName text="MemberCombat"/>

<m_ArtDefPath text="Units.artdef"/>

<m_CollectionIsLocked>true</m_CollectionIsLocked>

<m_TemplateName text=""/>

<m_ParamName text="Combat"/>

</Element>

<Element class="AssetObjects::ArtDefReferenceValue">

<m_ElementName text=""/>

<m_RootCollectionName text="MaterialTypes"/>

<m_ArtDefPath text="VFX.artdef"/>

<m_CollectionIsLocked>true</m_CollectionIsLocked>

<m_TemplateName text=""/>

<m_ParamName text="VFXMaterialType"/>

</Element>

<Element class="AssetObjects::ArtDefReferenceValue">

<m_ElementName text=""/>

<m_RootCollectionName text="MaterialTypes"/>

<m_ArtDefPath text="VFX.artdef"/>

<m_CollectionIsLocked>true</m_CollectionIsLocked>

<m_TemplateName text=""/>

<m_ParamName text="VFXWeaponImpact"/>

</Element>

<Element class="AssetObjects::FloatValue">

<m_fValue>0.000000</m_fValue>

<m_ParamName text="ImpactHeightOverride"/>

</Element>

</m_Values>

</m_Fields>

<m_ChildCollections>

<Element>

<m_CollectionName text="Cultures"/>

<m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>

</Element>

</m_ChildCollections>

<m_Name text="UNIT_PWENET_TRIBESMAN"/>

<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>

</Element>

</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'm confused what you mean by the second to last sentence - if you change the name of the unit, then everything works?
 
I mean that if I use the units.artdef from the MOAR Units mod, but just change the name of the Hyksos Bowman to the Pwenet Tribesman, then it works. However, I am now trying to set up my own units.artdef file that will only have the Pwenet Tribesman in it.
 
Just from my first look, it appears that you've removed all of the "m_elementname text = " from the MemberTypes part of your ArtDef. I'm still a bit foggy on the nature of the problem, but does this fix it?

replace your Hyksos Bowman entry under UnitMemberTypes with this:

<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Archer"/>
<m_RootCollectionName text="UnitMovementTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Movement"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="ArcherCombat"/>
<m_RootCollectionName text="MemberCombat"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Combat"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="MEAT"/>
<m_RootCollectionName text="MaterialTypes"/>
<m_ArtDefPath text="VFX.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="VFXMaterialType"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="MEAT"/>
<m_RootCollectionName text="MaterialTypes"/>
<m_ArtDefPath text="VFX.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="VFXWeaponImpact"/>
</Element>
<Element class="AssetObjects::FloatValue">
<m_fValue>0.000000</m_fValue>
<m_ParamName text="ImpactHeightOverride"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Cultures"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Variations"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::FloatValue">
<m_fValue>1.100000</m_fValue>
<m_ParamName text="Scale"/>
</Element>
<Element class="AssetObjects::BoolValue">
<m_bValue>false</m_bValue>
<m_ParamName text="IsAttachment"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Attachments"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Root"/>
<m_ParamName text="Point"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitTintTypes"/>
<m_ArtDefPath text=""/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Tint"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Bins"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Armor/Archer"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Armor"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="WeaponPrimary"/>
<m_ParamName text="Point"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitTintTypes"/>
<m_ArtDefPath text=""/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Tint"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Bins"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Bows/Ancient"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Weapon"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="WeaponSecondary"/>
<m_ParamName text="Point"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitTintTypes"/>
<m_ArtDefPath text=""/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Tint"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Bins"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Arrows/Ancient"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Arrow"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Root"/>
<m_ParamName text="Point"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitTintTypes"/>
<m_ArtDefPath text=""/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Tint"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Bins"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Bodies/Male_MediumBody_Full"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Body"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Hat"/>
<m_ParamName text="Point"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitTintTypes"/>
<m_ArtDefPath text=""/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Tint"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Bins"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Hats/Archer"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Hat"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Root"/>
<m_ParamName text="Point"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitTintTypes"/>
<m_ArtDefPath text=""/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Tint"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Bins"/>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Heads/Male"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Head"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="A"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="Any"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="UnitMember_Hyksos_Bowman"/>
</Element>
 
Delivertor has <m_ElementName text="UnitMember_Hyksos_Bowman"/> and yours is blank from what I can see.
I would suggest change it to something like <m_ElementName text="UnitMember_Pwenet"/> in your Units element and add that to your UnitMemberTypes as well so it can reference that tag.
 
gotcha!

I think I see your problem.

Under the UnitTypes part of the ArtDef you seem to have deleted the elementName text for defining the member types.

And under the UnitMemberTypes part of the artdef you seem to have deleted the text that defines what a hyksos bowman member is named.

Which means you're defining a unitMember with no name, then defining a unit graphic made up of undefined members

Why don't you just copy/paste the Deliverator artdef into your own and delete the components yu don't want? That's essentially how I started my ArtDef.
 
Thanks - I did copy/paste deliverator's artdef and deleted the components I didn't want but perhaps deleted too much.

I'm not sure why you didn't understand the problem I had - basically if I put deliverator's artdef in my mod as a complete artdef, then just rename the Hyksos bowman, then it works. I obviously don't want all the other units in that artdef, but when I delete the rest of the data, leaving only the unit I want, it no longer works. It would seem that I've deleted too much based on the responses so far.

UPDATE: Thank-you, anansethespider, the code you gave me works perfectly.
 
Last edited:
Its just a habit of mine to ask clarifying questions and make sure I really understand what a person wants before I try to help them, is all :D Glad it worked!
 
I use XML marker 1.1
http://symbolclick.com/xmlmarker_1_1_setup.exe
It's pretty old and basic but has a tree view by the side of the XML file. You can select whole tags and then choose Editor Select to select the actual XML in the file you are looking at. I used this to remove all but one unit from Deliverator's Units.artdef file when I wanted to use the Longbowman unit that he created.
You just have to remember when opening a file to choose all files as by default it only shows files ending in .xml.
 
Back
Top Bottom