I'm trying to make a civ where their ability is to be able to make equipment for their unique unit, giving them abilities over the course of the game. Currently, I've created a unique district, with district-unique buildings which grant modifiers to units.
The way I have it set up makes it so that each building has a modifier that attaches a modifier to all player units. The modifiers it attaches each have a SubjectRequirementSetId that should make it so only one type of unit benefits from the modifier, but it's not the case. All units get the modifier if I build the building.
An example of how this works:
Each building has a modifier like this:
<ModifierId>BUILDING_ATTACH_MOD</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER</ModifierType>
The modifier I've attached to BUILDING_ATTACH_MOD is this:
<ModifierId>MOD_NO_TERRAIN_PENALTY</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_TERRAIN_COST</ModifierType>
<SubjectRequirementSetId>UNIT_IS_HOLLOW</SubjectRequirementSetId>
(with proper modifer arguments)
This is my requirement to check if the unit is the right type:
<RequirementSets>
<Row>
<RequirementSetId>UNIT_IS_HOLLOW</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirement>
<Row>
<RequirementSetId>UNIT_IS_HOLLOW</RequirementSetId>
<RequirementId>UNIT_IS_HOLLOW_REQUIREMENT</RequirementId>
</Row>
</RequirementSetRequirement>
<Requirements>
<Row>
<RequirementId>UNIT_IS_HOLLOW_REQUIREMENT</RequirementId>
<RequirementType>REQUIREMENT_UNIT_TYPE_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>UNIT_IS_HOLLOW_REQUIREMENT</RequirementId>
<Name>UnitType</Name>
<Value>UNIT_DSMOD_HOLLOW</Value>
</Row>
</RequirementArguments>
So in theory, at least in my mind, is that this should grant the ignore terrain cost modifier to all units, but then check if the unit is a UNIT_DSMOD_HOLLOW or not. If it is, it will be able to ignore terrain costs, but if it isn't, it can't.
However, when I test it, what ends up happening is that ALL units are able to ignore terrain costs. I can't figure out what the problem with my requirement is.
The way I have it set up makes it so that each building has a modifier that attaches a modifier to all player units. The modifiers it attaches each have a SubjectRequirementSetId that should make it so only one type of unit benefits from the modifier, but it's not the case. All units get the modifier if I build the building.
An example of how this works:
Each building has a modifier like this:
<ModifierId>BUILDING_ATTACH_MOD</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER</ModifierType>
The modifier I've attached to BUILDING_ATTACH_MOD is this:
<ModifierId>MOD_NO_TERRAIN_PENALTY</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_TERRAIN_COST</ModifierType>
<SubjectRequirementSetId>UNIT_IS_HOLLOW</SubjectRequirementSetId>
(with proper modifer arguments)
This is my requirement to check if the unit is the right type:
<RequirementSets>
<Row>
<RequirementSetId>UNIT_IS_HOLLOW</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirement>
<Row>
<RequirementSetId>UNIT_IS_HOLLOW</RequirementSetId>
<RequirementId>UNIT_IS_HOLLOW_REQUIREMENT</RequirementId>
</Row>
</RequirementSetRequirement>
<Requirements>
<Row>
<RequirementId>UNIT_IS_HOLLOW_REQUIREMENT</RequirementId>
<RequirementType>REQUIREMENT_UNIT_TYPE_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>UNIT_IS_HOLLOW_REQUIREMENT</RequirementId>
<Name>UnitType</Name>
<Value>UNIT_DSMOD_HOLLOW</Value>
</Row>
</RequirementArguments>
So in theory, at least in my mind, is that this should grant the ignore terrain cost modifier to all units, but then check if the unit is a UNIT_DSMOD_HOLLOW or not. If it is, it will be able to ignore terrain costs, but if it isn't, it can't.
However, when I test it, what ends up happening is that ALL units are able to ignore terrain costs. I can't figure out what the problem with my requirement is.
Last edited: