Adding custom made Icons and Portraits for new units using ICONS.XML

i have never done ethnicity portraits, but if i remember correct in „New Unit - Example“ template of ModBuddy, you can find the necessary entries in the Icons.xml
 
I don't know if this one is correct. This mod is one step forward, playing with rehabitated assets.

Heavy Spearman

This unit is intended to be an upgrade to Spearman. and able to withstand Swordsman and no Irons needed.
And comes with alternative portraits for Mediterraneans (Reflecting historic Roman Hastati)
 

Attachments

Too bad it reported errors. Assets didn't shown up the way it should. and ICONS.xml Doesn't work the way it should. no such problems with Marksman (which it is yet another new unit made by modifying the existing assets by behaviour changes. Heavy Spearman (which is a problematic unit mod) is posted earlier.
HVYSpearman Asset Error Report.jpg
Marksman in action1.jpg
 

Attachments

i could take a look later today, in the meantime: this looks like a problem with artdef or xlp file-entries. Double-check whether you can find any typos or other wrong entries in artdef and xlp.
 
I think i've fixed typo problems but HEAVY SPEARMAN doesn't seems to response to this fix.

And same error again. this time with Slasher (new unit)

I think I've done all things right. but I might do something wrong in some stages.
 

Attachments

Last edited:
Code:
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="256" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait256.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="200" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait200.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="95" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait95.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="70" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait70.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="50" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait50.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="38" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait38.dds"/>

    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="256" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait256.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="200" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait200.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="95" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait95.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="70" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait70.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="50" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait50.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="38" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait38.dds"/>

you used the same name for the portrait entries for both Hastati AND HvySpearman.

i think this should work better:

Code:
  <IconTextureAtlases>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" IconSize="256" IconsPerRow="1" IconsPerColumn="1" Filename="HvySpearmanFlag256.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" IconSize="80" IconsPerRow="1" IconsPerColumn="1" Filename="HvySpearmanFlag80.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" IconSize="50" IconsPerRow="1" IconsPerColumn="1" Filename="HvySpearmanFlag50.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" IconSize="38" IconsPerRow="1" IconsPerColumn="1" Filename="HvySpearmanFlag38.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" IconSize="32" IconsPerRow="1" IconsPerColumn="1" Filename="HvySpearmanFlag32.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" IconSize="22" IconsPerRow="1" IconsPerColumn="1" Filename="HvySpearmanFlag22.dds."/>
    
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="256" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait256.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="200" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait200.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="95" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait95.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="70" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait70.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="50" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait50.dds"/>
    <Row Name="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="38" IconsPerRow="2" IconsPerColumn="1" Filename="HvySpearmanPortrait38.dds"/>

    <Row Name="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="256" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait256.dds"/>
    <Row Name="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="200" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait200.dds"/>
    <Row Name="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="95" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait95.dds"/>
    <Row Name="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="70" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait70.dds"/>
    <Row Name="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="50" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait50.dds"/>
    <Row Name="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS"   IconSize="38" IconsPerRow="2" IconsPerColumn="1" Filename="HastatiPortrait38.dds"/>

  </IconTextureAtlases>
  <IconDefinitions>
    <!-- This is the unit icon for the unit. -->
    <Row Name="ICON_UNIT_HEAVY_SPEARMAN" Atlas="ICON_ATLAS_UNIT_HEAVY_SPEARMAN" Index="0"/>


    <!-- This is the portrait of the unit. -->
    <Row Name="ICON_UNIT_HEAVY_SPEARMAN_PORTRAIT" Atlas="ICON_ATLAS_UNIT_HEAVY_SPEARMAN_PORTRAITS" Index="0"/>

    <!-- Ethnic specific portrait of the unit.  This changes based on the leader. -->
  
    <Row Name="ICON_ETHNICITY_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAIT" Atlas="ICON_ATLAS_MEDIT_UNIT_HEAVY_SPEARMAN_PORTRAITS" Index="1"/>
  

  </IconDefinitions>

then for the assets...i found in Units.artdef under "Units", you made a different entry from the one in your gameplay.xml
it have to be the exact same name!!!

in your artdef you wrote: UNIT_HEAVYSPEARMAN while in your gameplay.xml you wrote UNIT_HEAVY_SPEARMAN

this way the game would never find the necessary artdef entries for your new unit.

then under "UnitMemberTypes" i found an entry "Armor/Hastati under "Bins"
i cannot remember i have seen such an "Hastati" Bin ever before in Unit_Bins.artdef of the game, so i think here you have made a custom Asset right?
If thats the case you need a "Unit_Bins.artdef" in your mod, and there you can make the necessary entries you will reference later in the Units.artdef. Also if you have trouble to find correct entries, i think you should take a look into my Tutorial, as i explain this Artdef-Stuff in a relatively detailed way. you could skip the other parts of the tutorial and concentrate on the artdef part.

https://forums.civfanatics.com/threads/tutorial-integrate-a-3d-model-as-a-new-unit.635814/
 
Yes I did make custom assets, 'Hastati Armor' is actually rehabitated Legion Armor with spearmen/hoplite behaviours in place. 'Hastati' is intended to be Mediterranean variants, and the Roman Hastati (where the very unit came from, yes Republic of Rome used to be a big fan of Greeks and Macedonian Phalanx formation before they discovered that it doesn't work well in their home land against other Italian Powers at that time, and that's the reorganization effort began)
And Heavy Spearmen is also custom assets made the same way.

With Unit_Bins.Artdef added to the project. How to put referrences so the mod can recognize the assets. in addition to PROPERTY SETTINGS. (and Add Existing command in ModBuddy)
 
Last edited:
Goooood! Heavy Spearmen now operational. As unit models, portrait, and icons
Except its respecitve icons in tech tree.
Heavy Spearman Operational.jpg
But for Slashers. (Ancient era upgrades to Warrior with no resource required) not so much. Asset error still reported.
Slasher not working.jpg
And 'Hastati' variants, together with Athenian Hoplites. Portrait is yet to shown up :P (I don't know is it a right decision to give Hastati a regular spear rather than Hoplite ones?),
Hoplite and Hastati.jpg
 

Attachments

Last edited:
Congrats! Nice.

for the Slasher Unit i can take a look tomorrow i hope.
but then, after that i believe you must know something:

if you really want to continue making mods, then i think you must learn to solve problems by yourself. You cannot expect one of us to take a look into your mod and fix the problems everytime you got a problem. This does not mean that you cannot ask for help! But try to also fix those things by yourself. You can find Tutorials here, and you already learned a lot :). Look into the Database.log if the game bring you back to main menu, this can give you an idea where the problem is actually. In other cases look if you can find something, and compare your mod to other ones mod, if you see differences that maybe show you that you did something wrong. Or compare your mod to the example modbuddy projects from on of the Guides/Tutorials. Another big help is the Modding Guide by LeeS. Thats the bible for Civ6-Modding in general.
 
if you make new Assets, which doesnt be in the units.artdef already, then you always need the Unit_Bins.artdef
 
Wonderful! Congrats :)
 
so for your Slasher Mod, in your Units.artdef you have set under UnitMemberTypes at "Bins" an entry called "Armor/Slasher". I think thats the reason, cause its again a custom asset file, right? Then you need a Unit_Bins.artdef where you define that Slasher Entry. The process for custom assets should be: when you have set the .ast file, then 1. the xlp, 2. the Unit_Bins.artdef, 3. Units.artdef

also, according to which names you have chosen for your .ast files, the entry should not be "Armor/Slasher" cause you simply dont have a .ast file with the named "Slasher", i only found .ast files like "Slasher_Armor_01", "Slasher_Armor_02" or "Slasher_ArmorA" for instance...when you changed that and tried the mod, tell me if it works then

it actually depends on your "entry-tree" in unit_Bins.artdef, but if you have an sub tree there called "Armor" , then the correct entry in Units.artdef would be "Armor/Slasher_Armor_01" for instance
 
With this, everything inside 'Unit Attachment Bins' directory should be relocated from Units.artdef to Unit_Bins.artdef with the former files had all these directories emptied ?
The process for custom assets should be: when you have set the .ast file, then 1. the xlp, 2. the Unit_Bins.artdef, 3. Units.artdef
Is this process applied to the downloaded assets like what Deliverator made too as well? Right now i'm yet to learn how to make an entirely new 3d model for games. But sooner or later i've gotta do this too.
 
With this, everything inside 'Unit Attachment Bins' directory should be relocated from Units.artdef to Unit_Bins.artdef with the former files had all these directories emptied ?

Is this process applied to the downloaded assets like what Deliverator made too as well? Right now i'm yet to learn how to make an entirely new 3d model for games. But sooner or later i've gotta do this too.

1. yes, all should be „relocated“ but make first the Unit Bins.artdef and then the units.artdef

2. i think so.
 
Back
Top Bottom