Unit_BuildingPrereqs : NumSupported

Aldollin

Chieftain
Joined
Mar 7, 2017
Messages
87
Has anyone gotten the NumSupported functionality working with costum units/at all?
i have a costum unit and want to limit the total amount of them you can build with a certain building
looking at the archeologist i found this:

Code:
<Row Unit="UNIT_ARCHAEOLOGIST" PrereqBuilding="BUILDING_MUSEUM_ARTIFACT" NumSupported="1"/>
in <Unit_BuildingPrereqs>

so i figured i use that and replace the Unit with my unit and the building with the Monument for testing

if i dont use the Numsupported then the BuildingPrereq works, i can build my unit but only after the monument is build

but if i put NumSupported="1" the unit does not show up at all after building the monument
 
I join to this question. Pretty fancy idea to realize what I had in mind for few days: limiting any type of unit to something reasonable.
 
It is not an issue with custom units, it is an issue with units. If you put UNIT_SCOUT into this, you get the same behavior:
Code:
<GameData>
	<Unit_BuildingPrereqs>
		<Row Unit="UNIT_SCOUT" PrereqBuilding="BUILDING_MONUMENT" NumSupported="1"/>
	</Unit_BuildingPrereqs>
</GameData>

Only the Archaeologist Unit uses the NumSupported column (NumSupported actually has a default value of "-1").

The only three places anywhere in any game files provided by Firaxis where the column even is mentioned are:
  1. in the SQL Schema file that defines the tables, their valid columns, and the default values for the columns
  2. in the Units.xml file where the code for Unit_PreReqBuildings is made with the Archaeologiust Unit
  3. In the inaccessible game dll file. And the only thing we can directly learn about what happens with this column in this file is that the text-string of the colun-name is present in the file. The dll file controls what the game does, but the dll-source-code has not been released to mod-makers as yet.
My guess is that the "correct" behavior is tied directly to UNIT_ARCHAEOLOGIST or its PseudoYield as defined here:
Code:
<Row UnitType="UNIT_ARCHAEOLOGIST" ... PseudoYieldType="PSEUDOYIELD_UNIT_ARCHAEOLOGIST" ... CanRetreatWhenCaptured="True"/>
Theoretically PseudoYieldTypes are only used to help the AI understand the unit, building, etc., but it is possible Firaxis is also using this to implement the difference between an Archaeologist and some other type of unit, and it treating the NumSupported column more like it is a boolean rather than the integer it is defined as.
 
Back
Top Bottom