Help with unit filter

Fermongu

Warlord
Joined
Oct 27, 2017
Messages
199
As the game progesses, the option for building units increases A LOT, and finding the unit you want to build becomes annoying. The built in filters aim to help with that.Toffer modmod helps a lot too because screen size is bigger and you can actually see all options.

The problem I see is that "Domain" filtering is too unespecific (just land, sea and air) and the land domain reamains overcrowded, and the "combat" option is toooo specific and again it doesn't fit in screen.

I have gone inside CIV4UnitInfos.xml and changed the "Domain" tag of two example units to look for a bit more udeful "domain" filtering of units. My intention is to divide DOMAIN_LAND units between military and civilian units.

I tested 2 civilian units (gatherer and story teller) and just changed DOMAIN_LAND for DOMAIN_CIVIL:




Then I loaded a save. I got two XML errors, one for each changed entry, BUT the filtering actually worked!!




So I ask here, how can I make DOMAIN_CIVIL a valid entry in CIV4UnitInfos.xml, to avoid getting XML errors?
 
Domain is and needs to remain a matter of the strata through which the unit travels. It's important to keep it that way. You can always sort by unitcombat for civilians.
 
oh well, so that Domain entry means more than just the filtering.... I'm out of luck then.
 
From looking at the XML code snippet, it seems that the SubCombatType:UNITCOMBAT_CIVILIAN seems to as be the tag you want to filter for. Though you did say that filtering with the combat option was too specific.
As for why your domain type doesn't work, it is related to what domain types are used for: To determine where a unit might exist and how it might move. This is important for things like pathfinding algorthms, though I haven't actually checked up on whether it was specifically used in the source code recently.
 
Top Bottom