UI icons getting messed around

Context
I made a tech to upgrade crossbows into skirmishers. It replaces existing xbows with skirmishers, and removes them from all the production buildings, replacing them with skirms.

This includes changing the civ tech tree (removed veteran, guard and imperial upgrades for xbows).
Once researched, the guard skirmisher get added as intended, but the imperial upgrade appears beside it, messing the whole upgrade lines.

WhatsApp Image 2022-08-15 at 4.29.17 PM

WhatsApp Image 2022-08-15 at 4.29.47 PM

This is my code for reference

  <unit id="296" name="Barracks">
  <train row="0" page="0" column="0">Skirmisher</train>
  <tech row="0" page="1" column="0">UpgradetoSkirmishers</tech>
  <tech row="0" page="1" column="0">GuardSkirmishers</tech>
  <tech row="0" page="1" column="0">ImperialSkirmishers</tech>
</unit>

Any ideas what is happening? How does the building UI work?

the techs are set in the barracs proto.
’ tech row=“0” page=“1” column=“2”>VeteranRodeleros
tech row=“0” page=“1” column=“1”>VeteranPikemen ’
Unbenannt

As you can see in the pic, i marked you the columns for the techs.
So Rodeleros is technically the 3rd icon, but programming starts to count from 0

So i would sugegst, that you put the upgrade bellow the Xbow upgrade. Wich would be

" tech row=“0” page=“2” column=“0”>VeteranCrossbow "

Hope the helps, maxy

I tried removing the guard and imperial upgrade for skirmishers and the icons remain in the right place.

This means the upgrades are causing the issue…how can I solve it though?

I think I’m figuring this out
The remove command I used to remove skirmishers from barracks is causing the problems If i dont remove skirmishers, the upgrades all fit inside the row0, page 1 column 0
if I remove it, the imperialskirmishers forces itself into row0, page1, column 1

So…how can I remove skirmishers from the barracks without using the remove command? I can disable them in the age0spanish tech, but their icon at the barracks still shows up (inactive).

1 Like

I’ve had the exact same thing happen a while back, I believe it was because I had a tech that made active Veteran and Guard on a slot 0 unit, that tech ended up being reworked to a different thing and I didn’t see this issue again until today after building and testing a church card.

Ediit: For my Barracks problem below it seems to have fixed by adding CommandRemove lines for all the Regular techs in the Barracks as part of the RoyalDecree card effects.

This tech is a modified copy of Dutch’s ChurchStadholders, the civ has no access to Regulars nor their techs outside of this Church card tech.
image
Send in the church card, research the tech, and the Barracks gets offset.
image

According to the protoy, DEImperialUSRegulars tech would be in page 1 column 2, which is where that hole now is, so maybe it is seeing that you researched the two previous techs and then unlocking Imperial in the Barracks, even though you have no access to it?

So, there’s definitely a gremlin here regarding Barracks techs. For that problem, you could try making your own upgrade techs that jointly apply to Skirms and Crossbows so they might not be moved around on you if that would work with what you’re doing.

Removing Skirmishers on the other hand should be simple. In techtreemods for age0Spanish I added the following to disable and then remove Skirmishers from the Barracks. I don’t know if you had that part figured out, but without CommandRemove it leaves them visible but unusable even when disabled.

image

<effect mergeMode='add' type="Data" amount="-1.00" subtype="Enable" relativity="Absolute">
        <target type="ProtoUnit">Skirmisher</target>
</effect>
<effect mergeMode='add' type="CommandRemove" proto="Skirmisher">
	<target type="ProtoUnit">Barracks</target>
 </effect>
1 Like