1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Mahabodhi Temple Faith on Woods

Discussion in 'Mod Creation Help' started by Starrynite120, Jan 24, 2018.

  1. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Hi Everyone,

    I'm trying to get the Mahabodhi Temple to give 2 faith on woods, but I'm having a bit of trouble. I believe what I'm having trouble with is there is no Plot had woods requirement already, and I'm not sure exactly how to create one. Here is what I have:

    <Requirements>
    <Row>
    <RequirementId>PLOT_HAS_WOODS</RequirementId>
    <RequirementType>REQUIREMENT_PLOT_FEATURE_TYPE_MATCHES</RequirementType>
    </Row>
    <Row>
    <RequirementId>CITY_HAS_MAHABODHI_TEMPLE</RequirementId>
    <RequirementType>REQUIREMENT_CITY_HAS_BUILDING</RequirementType>
    </Row>
    </Requirements>


    <RequirementArguments>
    <Row>
    <RequirementId>PLOT_HAS_WOODS</RequirementId>
    <Name>FeatureType</Name>
    <Value>FEATURE_FOREST</Value>
    </Row>
    <Row>
    <RequirementId>CITY_HAS_MAHABODHI_TEMPLE</RequirementId>
    <Name>BuildingType</Name>
    <Value>BUILDING_MAHABODHI_TEMPLE</Value>
    </Row>
    </RequirementArguments>


    <RequirementSets>
    <Row>
    <RequirementSetId>CITY_HAS_MAHABODHI_TEMPLE_REQUIREMENTS</RequirementSetId>
    <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    </Row>
    </RequirementSets>


    <RequirementSetRequirements>
    <Row>
    <RequirementSetId>CITY_HAS_MAHABODHI_TEMPLE_REQUIREMENTS</RequirementSetId>
    <RequirementId>CITY_HAS_MAHABODHI_TEMPLE</RequirementId>
    </Row>
    </RequirementSetRequirements>

    <Modifiers>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
    <SubjectRequirementSetId>PLOT_HAS_WOODS_REQUIREMENTS</SubjectRequirementSetId>
    </Row>
    </Modifiers>


    <ModifierArguments>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    <Name>YieldType</Name>
    <Value>YIELD_FAITH</Value>
    </Row>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    <Name>Amount</Name>
    <Value>2</Value>
    </Row>
    </ModifierArguments>


    <BuildingModifiers>
    <Row>
    <BuildingType>BUILDING_MAHABODHI_TEMPLE</BuildingType>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    </Row>
    </BuildingModifiers>
     
    Last edited: Jan 24, 2018
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,193
    Location:
    Illinois, USA
    Take a look at Chichen Itza for the culture or production effect on Jungle plots.
    The modifier gives these to all plots in all cities, and then adds a restriction via an additional requirement that the city also must have the Chichen Itza building.


    You can also do it this way, which is for a "Forestry Service" wonder that gives culture to all unimproved forest tiles in the city that constructs the wonder:
    Spoiler :
    Code:
    <GameData>
    	<Types>
    		<Replace Type="BUILDING_FORESTRY_SERVICE_LRS" Kind="KIND_BUILDING"/>
    	</Types>
    	<Buildings>
    		<Replace BuildingType="BUILDING_FORESTRY_SERVICE_LRS" Name="LOC_BUILDING_FORESTRY_SERVICE_LRS_NAME"
    			Description="LOC_BUILDING_FORESTRY_SERVICE_LRS_DESCRIPTION" PrereqCivic="CIVIC_CIVIL_ENGINEERING"
    			MaxWorldInstances="1" IsWonder="true" AdvisorType="ADVISOR_GENERIC" Housing="1" Entertainment="1"
    			Cost="1200" Quote="LOC_BUILDING_FORESTRY_SERVICE_LRS_QUOTE" QuoteAudio="NULL" />
    	</Buildings>
    	<Modifiers>
    		<Replace>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE</ModifierId>
    			<ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
    			<SubjectRequirementSetId>CITY_HAS_FORESTRY_SERVICE_LRS_REQUIREMENTS</SubjectRequirementSetId>
    		</Replace>
    		<Replace>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE_MODIFIER</ModifierId>
    			<ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
    			<SubjectRequirementSetId>PLOT_HAS_FOREST_REQUIREMENTS_LRS</SubjectRequirementSetId>
    		</Replace>
    		<Replace>
    			<ModifierId>LRS_FORESTRY_SERVICE_UNOMPROVED_FOREST_MODIFIER</ModifierId>
    			<ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
    			<SubjectRequirementSetId>LRS_PLOT_HAS_NO_IMPROVEMENT_REQUIREMENTS</SubjectRequirementSetId>
    		</Replace>
    	</Modifiers>
    	<ModifierArguments>
    		<!-- Woods Culture in Constructing City -->
    		<Replace>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE</ModifierId>
    			<Name>ModifierId</Name>
    			<Value>FORESTRY_SERVICE_LRS_FOREST_CULTURE_MODIFIER</Value>
    		</Replace>
    		<Replace>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE_MODIFIER</ModifierId>
    			<Name>ModifierId</Name>
    			<Value>LRS_FORESTRY_SERVICE_UNOMPROVED_FOREST_MODIFIER</Value>
    		</Replace>
    		<Replace>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE_MODIFIER</ModifierId>
    			<Name>YieldType</Name>
    			<Value>YIELD_CULTURE</Value>
    		</Replace>
    		<Replace>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE_MODIFIER</ModifierId>
    			<Name>Amount</Name>
    			<Value>2</Value>
    		</Replace>
    	</ModifierArguments>
    	<BuildingModifiers>
    		<Replace>
    			<BuildingType>BUILDING_FORESTRY_SERVICE_LRS</BuildingType>
    			<ModifierId>FORESTRY_SERVICE_LRS_FOREST_CULTURE</ModifierId>
    		</Replace>
    	</BuildingModifiers>
    	<Requirements>
    		<Replace>
    			<RequirementId>LRS_REQUIRES_PLOT_HAS_NO_IMPROVEMENT</RequirementId>
    			<RequirementType>REQUIREMENT_PLOT_HAS_ANY_IMPROVEMENT</RequirementType>
    			<Inverse>true</Inverse>
    		</Replace>
    		<Replace>
    			<RequirementId>REQUIRES_CITY_HAS_FORESTRY_SERVICE_LRS</RequirementId>
    			<RequirementType>REQUIREMENT_CITY_HAS_BUILDING</RequirementType>
    		</Replace>
    		<Replace>
    			<RequirementId>REQUIRES_PLOT_HAS_FOREST_LRS</RequirementId>
    			<RequirementType>REQUIREMENT_PLOT_FEATURE_TYPE_MATCHES</RequirementType>
    		</Replace>
    	</Requirements>
    	<RequirementArguments>
    		<Replace>
    			<RequirementId>REQUIRES_CITY_HAS_FORESTRY_SERVICE_LRS</RequirementId>
    			<Name>BuildingType</Name>
    			<Value>BUILDING_FORESTRY_SERVICE_LRS</Value>
    		</Replace>
    		<Replace>
    			<RequirementId>REQUIRES_PLOT_HAS_FOREST_LRS</RequirementId>
    			<Name>FeatureType</Name>
    			<Value>FEATURE_FOREST</Value>
    		</Replace>
    	</RequirementArguments>
    	<RequirementSets>
    		<Replace>
    			<RequirementSetId>LRS_PLOT_HAS_NO_IMPROVEMENT_REQUIREMENTS</RequirementSetId>
    			<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    		</Replace>
    		<Replace>
    			<RequirementSetId>CITY_HAS_FORESTRY_SERVICE_LRS_REQUIREMENTS</RequirementSetId>
    			<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    		</Replace>
    		<Replace>
    			<RequirementSetId>PLOT_HAS_FOREST_REQUIREMENTS_LRS</RequirementSetId>
    			<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    		</Replace>
    	</RequirementSets>
    	<RequirementSetRequirements>
    		<Replace>
    			<RequirementSetId>LRS_PLOT_HAS_NO_IMPROVEMENT_REQUIREMENTS</RequirementSetId>
    			<RequirementId>LRS_REQUIRES_PLOT_HAS_NO_IMPROVEMENT</RequirementId>
    		</Replace>
    		<Replace>
    			<RequirementSetId>PLOT_HAS_FOREST_REQUIREMENTS_LRS</RequirementSetId>
    			<RequirementId>REQUIRES_PLOT_HAS_FOREST_LRS</RequirementId>
    		</Replace>
    		<Replace>
    			<RequirementSetId>CITY_HAS_FORESTRY_SERVICE_LRS_REQUIREMENTS</RequirementSetId>
    			<RequirementId>REQUIRES_CITY_HAS_FORESTRY_SERVICE_LRS</RequirementId>
    		</Replace>
    	</RequirementSetRequirements>
    </GameData>
    I believe I grabbed all the relevant stuff from the xml file that addds the wonder to the game.

    You'll note that I had to attach a second modifier to the original one, and then a third modifier to the second in order to get only in the city that constructs the wonder, and then only on plots that are unimproved forest tiles.

    I mostly just copied everything for the Chichen Itza to start with, and then alterred my modifierID and requirementID names as needed, as well as changing to FEATURE_FOREST instead of FEATURE_JUNGLE.

    "Replace" can be used instead of "Row" and if there is already a building (for example) with the same exact xml-name, the new info will literally replace the previous data. This is both useful for repeat-usage of the same Plot requirement set-up (for example) across multiple mods you may make, but is also dangerous in that if you use too generic a name you might be over-writing the original data for something from the base-game, and thereby causing unintended bad consequences. Hence everything in my code has my initials appended to the XML names.
    Code:
    PLOT_HAS_FOREST_REQUIREMENTS_LRS
    instead of
    Code:
    PLOT_HAS_FOREST_REQUIREMENTS
     
    Last edited: Jan 24, 2018
  3. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Thanks for the help there. I looked over your code and got this, but its still not working. Do you see anything wrong with it?

    <Modifiers>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH</ModifierId>
    <ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
    <SubjectRequirementSetId>CITY_HAS_MAHABODHI_TEMPLE_REQUIREMENTS</SubjectRequirementSetId>
    </Row>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
    <SubjectRequirementSetId>PLOT_HAS_WOODS_REQUIREMENTS</SubjectRequirementSetId>
    </Row>
    </Modifiers>

    <ModifierArguments>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH</ModifierId>
    <Name>ModifierId</Name>
    <Value>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</Value>
    </Row>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    <Name>YieldType</Name>
    <Value>YIELD_FAITH</Value>
    </Row>
    <Row>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH_MODIFIER</ModifierId>
    <Name>Amount</Name>
    <Value>2</Value>
    </Row>
    </ModifierArguments>

    <BuildingModifiers>
    <Row>
    <BuildingType>BUILDING_MAHABODHI_TEMPLE</BuildingType>
    <ModifierId>MAHABODHI_TEMPLE_WOODS_FAITH</ModifierId>
    </Row>
    </BuildingModifiers>

    <Requirements>
    <Row>
    <RequirementId>PLOT_HAS_WOODS</RequirementId>
    <RequirementType>REQUIREMENT_PLOT_FEATURE_TYPE_MATCHES</RequirementType>
    </Row>
    <Row>
    <RequirementId>CITY_HAS_MAHABODHI_TEMPLE</RequirementId>
    <RequirementType>REQUIREMENT_CITY_HAS_BUILDING</RequirementType>
    </Row>
    </Requirements>

    <RequirementArguments>
    <Row>
    <RequirementId>PLOT_HAS_WOODS</RequirementId>
    <Name>FeatureType</Name>
    <Value>FEATURE_FOREST</Value>
    </Row>
    <Row>
    <RequirementId>CITY_HAS_MAHABODHI_TEMPLE</RequirementId>
    <Name>BuildingType</Name>
    <Value>BUILDING_MAHABODHI_TEMPLE</Value>
    </Row>
    </RequirementArguments>

    <RequirementSets>
    <Row>
    <RequirementSetId>CITY_HAS_MAHABODHI_TEMPLE_REQUIREMENTS</RequirementSetId>
    <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    </Row>
    <Row>
    <RequirementSetId>PLOT_HAS_WOODS_REQUIREMENTS</RequirementSetId>
    <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    </Row>
    </RequirementSets>

    <RequirementSetRequirements>
    <Row>
    <RequirementSetId>CITY_HAS_MAHABODHI_TEMPLE_REQUIREMENTS</RequirementSetId>
    <RequirementId>CITY_HAS_MAHABODHI_TEMPLE</RequirementId>
    </Row>
    <Row>
    <RequirementSetId>PLOT_HAS_WOODS_REQUIREMENTS</RequirementSetId>
    <RequirementId>PLOT_HAS_WOODS</RequirementId>
    </Row>
    </RequirementSetRequirements>
     
  4. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    I got it to work. The second one I wrote up worked, it just took me awhile to realize that when I changed the name of the xml file it no longer activated it, and of course it took me half an hour to notice a simple typo, but now it works! Thanks!
     
    Last edited: Jan 25, 2018

Share This Page