Modifier to grant Units on War declaration

Aldollin

Chieftain
Joined
Mar 7, 2017
Messages
87
does anyone have an idea if its possible/how to make a modifier that grants free units whenever you are targeted my by a declaration of war ?(similar to the australia production bonus)

i looked at the australia example, and its using this dynamic modifier:
MODIFIER_PLAYER_ADD_DIPLOMATIC_YIELD_MODIFIER
(has the effect EFFECT_ADD_DIPLOMATIC_YIELD_MODIFIER)

from that example i assume you can only use that one to modify city yields, not something like grant units

maybe something with pseudoyields? havent fully understood how to use these

any ideas/advice are appreciated
 
Code:
<GameInfo>
	<!-- from file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data\GameEffects.xml -->
	<Types>
		<Row Type="EFFECT_GRANT_UNIT_BY_CLASS" Kind="KIND_EFFECT"/>
		<Row Type="EFFECT_GRANT_UNIT_IN_CAPITAL" Kind="KIND_EFFECT"/>
		<Row Type="EFFECT_GRANT_UNIT_IN_CITY" Kind="KIND_EFFECT"/>
	</Types>
	<!-- from file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data\Modifiers.xml -->
	<DynamicModifiers>
		<Row>
			<ModifierType>MODIFIER_PLAYER_CITIES_GRANT_UNIT_BY_CLASS</ModifierType>
			<CollectionType>COLLECTION_PLAYER_CITIES</CollectionType>
			<EffectType>EFFECT_GRANT_UNIT_BY_CLASS</EffectType>
		</Row>
		<Row>
			<ModifierType>MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_CITY</ModifierType>
			<CollectionType>COLLECTION_OWNER</CollectionType>
			<EffectType>EFFECT_GRANT_UNIT_IN_CITY</EffectType>
		</Row>
		<Row>
			<ModifierType>MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_NEAREST_CITY</ModifierType>
			<CollectionType>COLLECTION_UNIT_NEAREST_OWNER_CITY</CollectionType>
			<EffectType>EFFECT_GRANT_UNIT_IN_CITY</EffectType>
		</Row>
		<Row>
			<ModifierType>MODIFIER_SINGLE_CITY_GRANT_UNIT_BY_CLASS_IN_NEAREST_CITY</ModifierType>
			<CollectionType>COLLECTION_UNIT_NEAREST_OWNER_CITY</CollectionType>
			<EffectType>EFFECT_GRANT_UNIT_BY_CLASS</EffectType>
		</Row>
		<Row>
			<ModifierType>MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY</ModifierType>
			<CollectionType>COLLECTION_OWNER</CollectionType>
			<EffectType>EFFECT_GRANT_GREAT_PERSON_CLASS_IN_CITY</EffectType>
		</Row>
	</DynamicModifiers>
</GameInfo>
May or may not be more that I missed from a quick seek/find. You would probably need to build your own modifier and spec the effect of the modifier, it's requirements, and other stuff, like they do here by creating a modifier for the Colossus Wonder
Code:
		<Row>
			<ModifierId>COLOSSUS_GRANT_TRADER</ModifierId>
			<ModifierType>MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_CITY</ModifierType>
			<RunOnce>true</RunOnce>
			<Permanent>true</Permanent>
		</Row>
But I am not sure how you create by using Modifiers and Effects the "trigger" for firing the MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_CITY or MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_NEAREST_CITY from being the victim of a declaration of war
 
Last edited:
Code:
<Row>
<ModifierId>TRAIT_CITADELCIVILIZATION_DEFENSIVE_PRODUCTION</ModifierId>
<ModifierType>MODIFIER_PLAYER_ADD_DIPLOMATIC_YIELD_MODIFIER</ModifierType>
</Row>
the only way i can think of using Modifiers and Effects is maybe with the Effect/Modifier from australia:
the Modifier gets 4 arguments:
Code:
<Row>
<ModifierId>TRAIT_CITADELCIVILIZATION_DEFENSIVE_PRODUCTION</ModifierId>
<Name>DiplomaticYieldSource</Name>
<Value>WAR_DECLARATION_RECEIVED</Value>
</Row>
<Row>
<ModifierId>TRAIT_CITADELCIVILIZATION_DEFENSIVE_PRODUCTION</ModifierId>
<Name>TurnsActive</Name>
<Value>10</Value>
</Row>
<Row>
<ModifierId>TRAIT_CITADELCIVILIZATION_DEFENSIVE_PRODUCTION</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_PRODUCTION</Value>
</Row>
<Row>
<ModifierId>TRAIT_CITADELCIVILIZATION_DEFENSIVE_PRODUCTION</ModifierId>
<Name>Amount</Name>
<Value>100</Value>
</Row>
now i wonder if the effect this modifier uses could also take something different as an argument, so you could use it to apply a modifier
similar to how religious beliefs have modifiers that attach modifiers as their effect
 
Back
Top Bottom