LeeS
Imperator
Buildings Require Local Resources Utility
(see zipped attachment to opening post)
(see zipped attachment to opening post)
this utility is now superceeded by this far more capable one: LeeS' Dummy Buildings Utilities
If you are looking to add this to your mod you should use the newer better system instead of this one.
For those already using this version, it is not affected by the new system. The same game can use both systems whenever a mod is using this older system and another mod is using the newer more-capable system. I will not be expanding capability of this older version in any way, however.
- This is a utility meant for the use of other mod-makers and allows a city-building to require the city has an available map resource within the city's territory before a building can be constructed within the city. The utility uses a combination of lua scripting and dummy buildings to create the desired effects.
- The way the xml side of the system works is we create a dummy building that has no purpose except to act as a prerequisite for the 'real' building.
- The lua side of the system works by adding the dummy building to cities as is appropriate.
- Once the lua script adds the dummy building to the city, the 'real' building becomes available for construction or purchase in the city.
- The game's modifier system cannot achieve this effect. Don't leave comments on this thread about using the modifier system to accomplish the goals of this utility.
- The reason a dummy building will be used instead of a direct lua CityCanConstruct event is that Firaxis hasn't implemented such an event for Civ6.
- Resources must always be 'visible' to the owner of the city for the purposes of this utility. So if the player hasn't discovered the tech that reveals a particular resource, this utility will not enact a dummy building in a city when that dummy building is linked to that unrevealed resource.
Creating a Dummy and Real Building Where The Dummy Will Act As a Prereq For the Real Building:
- For the purposes of explaining how to use this utility, assume we want to create a building called a Stoneworks that will add +1 Production to the city center and +1 Production to every Stone and Marble resource plot the city works. But we only want this Stoneworks building to be available to a city if the city already has an improved copy of Stone or Marble within its working area. So, we want:
- The city must have improved stone or marble in its map plots
- the improved map plot with the stone or marble must be in the city's borders and must 'belong' to the city
- once these two conditions are met, the city can construct or purchase a Stoneworks building.
- Our "Real" building will be called BUILDING_STONEWORKS. Here is what we need for the definition of the the real building that cities will be able to construct:
Spoiler :All this info is included in the files that are part of the utility in the way it is packaged as a functioning mod.
In an xml file for the actual building definition:Code:<GameInfo> <Types> <Row Type="BUILDING_STONEWORKS" Kind="KIND_BUILDING" /> </Types> <Buildings> <!-- ============ Stoneworks ============= --> <Row BuildingType="BUILDING_STONEWORKS" Name="LOC_BUILDING_STONEWORKS_NAME" Description="LOC_BUILDING_STONEWORKS_DESCRIPTION" PrereqTech="TECH_MASONRY" PrereqDistrict="DISTRICT_CITY_CENTER" Entertainment="1" PurchaseYield="YIELD_GOLD" Cost="80" AdvisorType="ADVISOR_GENERIC" /> </Buildings> <Building_YieldChanges> <Row BuildingType="BUILDING_STONEWORKS" YieldType="YIELD_PRODUCTION" YieldChange="1"/> </Building_YieldChanges> <BuildingModifiers> <!--Adjust City Yield--> <Row> <BuildingType>BUILDING_STONEWORKS</BuildingType> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> </Row> <Row> <BuildingType>BUILDING_STONEWORKS</BuildingType> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> </Row> </BuildingModifiers> <Modifiers> <!--Adjust Plot Yield--> <Row> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType> <SubjectRequirementSetId>RESOURCE_IS_STONE</SubjectRequirementSetId> </Row> <Row> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType> <SubjectRequirementSetId>RESOURCE_IS_MARBLE</SubjectRequirementSetId> </Row> </Modifiers> <ModifierArguments> <!--Adjust Plot Yield--> <Row> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> <Name>Amount</Name> <Value>1</Value> </Row> <Row> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> <Name>YieldType</Name> <Value>YIELD_PRODUCTION</Value> </Row> <Row> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> <Name>Amount</Name> <Value>1</Value> </Row> <Row> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> <Name>YieldType</Name> <Value>YIELD_PRODUCTION</Value> </Row> </ModifierArguments> <Requirements> <Row> <RequirementId>REQUIRES_STONE_IN_PLOT</RequirementId> <RequirementType>REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES</RequirementType> </Row> <Row> <RequirementId>REQUIRES_MARBLE_IN_PLOT</RequirementId> <RequirementType>REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES</RequirementType> </Row> </Requirements> <RequirementArguments> <Row> <RequirementId>REQUIRES_STONE_IN_PLOT</RequirementId> <Name>ResourceType</Name> <Value>RESOURCE_STONE</Value> </Row> <Row> <RequirementId>REQUIRES_MARBLE_IN_PLOT</RequirementId> <Name>ResourceType</Name> <Value>RESOURCE_MARBLE</Value> </Row> </RequirementArguments> <RequirementSets> <Row> <RequirementSetId>RESOURCE_IS_STONE</RequirementSetId> <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType> </Row> <Row> <RequirementSetId>RESOURCE_IS_MARBLE</RequirementSetId> <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType> </Row> </RequirementSets> <RequirementSetRequirements> <Row> <RequirementSetId>RESOURCE_IS_STONE</RequirementSetId> <RequirementId>REQUIRES_STONE_IN_PLOT</RequirementId> </Row> <Row> <RequirementSetId>RESOURCE_IS_MARBLE</RequirementSetId> <RequirementId>REQUIRES_MARBLE_IN_PLOT</RequirementId> </Row> </RequirementSetRequirements> </GameInfo>
Code:<GameData> <LocalizedText> <!-- ================================================================================================= --> <!-- ====================================== STONEWORKS =============================================== --> <!-- ================================================================================================= --> <Row Tag="LOC_BUILDING_STONEWORKS_NAME" Language="en_US"> <Text>Stoneworks</Text> </Row> <Row Tag="LOC_BUILDING_STONEWORKS_DESCRIPTION" Language="en_US"> <Text>Provides +2 [ICON_Production] Production in the city center, and +1 [ICON_Production] Production to every [ICON_RESOURCE_MARBLE] Marble and [ICON_RESOURCE_STONE] Stone plot worked by the city. The city must have quarry-improved local [ICON_RESOURCE_MARBLE] Marble or [ICON_RESOURCE_STONE] Stone.</Text> </Row> </LocalizedText> </GameData>
Code:<GameData> <IconDefinitions> <Row Name="ICON_BUILDING_STONEWORKS" Atlas="ICON_ATLAS_BUILDINGS" Index="20"/> <Row Name="ICON_BUILDING_STONEWORKS_FOW" Atlas="ICON_ATLAS_BUILDINGS_FOW" Index="20"/> </IconDefinitions> </GameData>
- note that we are borrowing the icon used by the workshop. Civ6 allows us to do this.
- Now we need to define a dummy building that will act as an unlocker prerequisite for the Stoneworks building:
- To make it easier to understand our own code, the tagname of the dummy building will be BUILDING_STONEWORKS_UNLOCKER
- Defining the dummy building to register it as a valid building within the game's system:
Code:<GameInfo> <Types> <Row Type="BUILDING_STONEWORKS_UNLOCKER" Kind="KIND_BUILDING" /> </Types> <Buildings> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" Name="LOC_BUILDING_STONEWORKS_UNLOCKER_NAME" Description="LOC_BUILDING_STONEWORKS_UNLOCKER_DESCRIPTION" PrereqDistrict="DISTRICT_CITY_CENTER" Cost="1" PrereqTech="TECH_FUTURE_TECH" /> </Buildings> <BuildingPrereqs> <Row Building="BUILDING_STONEWORKS" PrereqBuilding="BUILDING_STONEWORKS_UNLOCKER"/> </BuildingPrereqs> </GameInfo>
- Keeping the Ai from constructing the dummy building:
- Neither using EnabledByReligion="true" without specifying a belief that allows purchase of the building, nor stating MustPurchase="true" without specifying a "Yield Type" for PurchaseYield work successfully to keep the AI from adding a dummy building to their city build qeue:
- Using EnabledByReligion="true" without specifying a belief that allows purchase of the building merely locks all Religious buildings from being purchaseable or constructable.
- Stating MustPurchase="true" without specifying a "Yield Type" for PurchaseYield does not actually keep the AI from adding the building to its city build qeues. They are quite able to do so as evidenced by a "listener" code I added in lua to print out every turn what every city in the game was trying to construct in its Build Qeue.
- Only setting either "TECH_FUTURE_TECH" as the PrereqTech or "CIVIC_FUTURE_CIVIC" as the PrereqCivic seems to successfully keep the AI from adding the dummy building to city build qeues. I prefer PrereqTech="TECH_FUTURE_TECH" because it seems in most games that the Civics tree is always finished before the Technology tree.
- by doing things in this manner for the vast majority of any single game the ability to construct a dummy building where otherwise not desired will not come up because "TECH_FUTURE_TECH" will not have been reached by any player, AI or Human.
- Neither using EnabledByReligion="true" without specifying a belief that allows purchase of the building, nor stating MustPurchase="true" without specifying a "Yield Type" for PurchaseYield work successfully to keep the AI from adding a dummy building to their city build qeue:
- We do not specify a purchase type of yield, again to keep the building from becoming acquirable via 'normal' methods as much as is possible.
- We cannot use InternalOnly="true" because while this allows us the other advantages we are looking for, once we place such a building into a city, we are unable to remove it from the city via an lua script if we would like our code to be able to do so.
- For the game's normal 'baked-in' systems, it is the designation of BUILDING_STONEWORKS_UNLOCKER as a PrereqBuilding for BUILDING_STONEWORKS that allows this utility to work.
- Since in Civ6 the <BuildingPrereqs> table acts as an "OR" table, your real building (such as the BUILDING_STONEWORKS) must only have one entry in the table, tying it to the dummy building (such as the BUILDING_STONEWORKS_UNLOCKER)
- If for example you want the real building (such as the BUILDING_STONEWORKS) to also require another real building already exist in the city (such as the BUILDING_WORKSHOP), the utility has a built-in method to accomplish this, which will be discussed later. In all cases, however, the dummy building must be the one and only prerequisite listed in the <BuildingPrereqs> table.
- Keeping the Ai from constructing the dummy building:
- Definition of the Dummy Building's Icon.
Code:<GameData> <IconDefinitions> <Row Name="ICON_BUILDING_STONEWORKS_UNLOCKER" Atlas="ICON_ATLAS_BUILDINGS" Index="0"/> <Row Name="ICON_BUILDING_STONEWORKS_UNLOCKER_FOW" Atlas="ICON_ATLAS_BUILDINGS_FOW" Index="0"/> </IconDefinitions> </GameData>
- Definition of the Dummy Building's In-Game Text:
Code:<GameData> <LocalizedText> <Row Tag="LOC_BUILDING_STONEWORKS_UNLOCKER_NAME" Language="en_US"> <Text>Stoneworks Unlocker</Text> </Row> <Row Tag="LOC_BUILDING_STONEWORKS_UNLOCKER_DESCRIPTION" Language="en_US"> <Text>Acts as a Prereq Building for the Stoneworks. Has no other effect.</Text> </Row> </LocalizedText> </GameData>
- In the utility I have packaged all of these definitions of the buildings, their text, and their icons into three xml files within a folder called XML_RESOURCE_UNLOCKS
- Building Definitions: XML_RESOURCE_UNLOCKS/Buildings.xml
Spoiler :Code:<GameInfo> <Types> <Row Type="BUILDING_STONEWORKS_UNLOCKER" Kind="KIND_BUILDING" /> </Types> <Buildings> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" Name="LOC_BUILDING_STONEWORKS_UNLOCKER_NAME" Description="LOC_BUILDING_STONEWORKS_UNLOCKER_DESCRIPTION" PrereqDistrict="DISTRICT_CITY_CENTER" Cost="1" EnabledByReligion="true" /> </Buildings> <!-- =================================================================================== ================================ STONEWORKS BUILDING =================================== ======================================================================================== --> <Types> <Row Type="BUILDING_STONEWORKS" Kind="KIND_BUILDING" /> </Types> <BuildingPrereqs> <Row Building="BUILDING_STONEWORKS" PrereqBuilding="BUILDING_STONEWORKS_UNLOCKER"/> </BuildingPrereqs> <Buildings> <!-- ============ Stoneworks ============= --> <Row BuildingType="BUILDING_STONEWORKS" Name="LOC_BUILDING_STONEWORKS_NAME" Description="LOC_BUILDING_STONEWORKS_DESCRIPTION" PrereqTech="TECH_MASONRY" PrereqDistrict="DISTRICT_CITY_CENTER" Entertainment="1" PurchaseYield="YIELD_GOLD" Cost="80" AdvisorType="ADVISOR_GENERIC" /> </Buildings> <Building_YieldChanges> <Row BuildingType="BUILDING_STONEWORKS" YieldType="YIELD_PRODUCTION" YieldChange="1"/> </Building_YieldChanges> <BuildingModifiers> <!--Adjust City Yield--> <Row> <BuildingType>BUILDING_STONEWORKS</BuildingType> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> </Row> <Row> <BuildingType>BUILDING_STONEWORKS</BuildingType> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> </Row> </BuildingModifiers> <Modifiers> <!--Adjust Plot Yield--> <Row> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType> <SubjectRequirementSetId>RESOURCE_IS_STONE</SubjectRequirementSetId> </Row> <Row> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType> <SubjectRequirementSetId>RESOURCE_IS_MARBLE</SubjectRequirementSetId> </Row> </Modifiers> <ModifierArguments> <!--Adjust Plot Yield--> <Row> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> <Name>Amount</Name> <Value>1</Value> </Row> <Row> <ModifierId>STONEWORKS_ADDSTONEPROD</ModifierId> <Name>YieldType</Name> <Value>YIELD_PRODUCTION</Value> </Row> <Row> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> <Name>Amount</Name> <Value>1</Value> </Row> <Row> <ModifierId>STONEWORKS_ADDMARBLEPROD</ModifierId> <Name>YieldType</Name> <Value>YIELD_PRODUCTION</Value> </Row> </ModifierArguments> <Requirements> <Row> <RequirementId>REQUIRES_STONE_IN_PLOT</RequirementId> <RequirementType>REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES</RequirementType> </Row> <Row> <RequirementId>REQUIRES_MARBLE_IN_PLOT</RequirementId> <RequirementType>REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES</RequirementType> </Row> </Requirements> <RequirementArguments> <Row> <RequirementId>REQUIRES_STONE_IN_PLOT</RequirementId> <Name>ResourceType</Name> <Value>RESOURCE_STONE</Value> </Row> <Row> <RequirementId>REQUIRES_MARBLE_IN_PLOT</RequirementId> <Name>ResourceType</Name> <Value>RESOURCE_MARBLE</Value> </Row> </RequirementArguments> <RequirementSets> <Row> <RequirementSetId>RESOURCE_IS_STONE</RequirementSetId> <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType> </Row> <Row> <RequirementSetId>RESOURCE_IS_MARBLE</RequirementSetId> <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType> </Row> </RequirementSets> <RequirementSetRequirements> <Row> <RequirementSetId>RESOURCE_IS_STONE</RequirementSetId> <RequirementId>REQUIRES_STONE_IN_PLOT</RequirementId> </Row> <Row> <RequirementSetId>RESOURCE_IS_MARBLE</RequirementSetId> <RequirementId>REQUIRES_MARBLE_IN_PLOT</RequirementId> </Row> </RequirementSetRequirements> </GameInfo>
- Icon Definitions: XML_RESOURCE_UNLOCKS/Buildings_Icons.xml
Spoiler :Code:<GameData> <IconDefinitions> <Row Name="ICON_BUILDING_STONEWORKS_UNLOCKER" Atlas="ICON_ATLAS_BUILDINGS" Index="0"/> <Row Name="ICON_BUILDING_STONEWORKS_UNLOCKER_FOW" Atlas="ICON_ATLAS_BUILDINGS_FOW" Index="0"/> <Row Name="ICON_BUILDING_STONEWORKS" Atlas="ICON_ATLAS_BUILDINGS" Index="20"/> <Row Name="ICON_BUILDING_STONEWORKS_FOW" Atlas="ICON_ATLAS_BUILDINGS_FOW" Index="20"/> </IconDefinitions> </GameData>
- Text Definitions: XML_RESOURCE_UNLOCKS/Buildings_Text.xml
Spoiler :Code:<GameData> <LocalizedText> <!-- ================================================================================================= --> <!-- ====================================== STONEWORKS =============================================== --> <!-- ================================================================================================= --> <Row Tag="LOC_BUILDING_STONEWORKS_UNLOCKER_NAME" Language="en_US"> <Text>Stoneworks Unlocker</Text> </Row> <Row Tag="LOC_BUILDING_STONEWORKS_UNLOCKER_DESCRIPTION" Language="en_US"> <Text>Acts as a Prereq Building for the Stoneworks. Has no other effect.</Text> </Row> <Row Tag="LOC_BUILDING_STONEWORKS_NAME" Language="en_US"> <Text>Stoneworks</Text> </Row> <Row Tag="LOC_BUILDING_STONEWORKS_DESCRIPTION" Language="en_US"> <Text>Provides +2 [ICON_Production] Production in the city center, and +1 [ICON_Production] Production to every [ICON_RESOURCE_MARBLE] Marble and [ICON_RESOURCE_STONE] Stone plot worked by the city. The city must have quarry-improved local [ICON_RESOURCE_MARBLE] Marble or [ICON_RESOURCE_STONE] Stone.</Text> </Row> </LocalizedText> </GameData>
- Building Definitions: XML_RESOURCE_UNLOCKS/Buildings.xml
- These three files are set-up in the modinfo file as follows:
Code:
<Files> <File>XML_RESOURCE_UNLOCKS/Buildings_Icons.xml</File> <File>XML_RESOURCE_UNLOCKS/Buildings.xml</File> <File>XML_RESOURCE_UNLOCKS/Buildings_Text.xml</File> </Files> <Components> <Icons id="Dummy_UnlockerResources_ICONS"> <Items> <File>XML_RESOURCE_UNLOCKS/Buildings_Icons.xml</File> </Items> </Icons> <UpdateDatabase id="Dummy_UnlockerResources_XML"> <Items> <File>XML_RESOURCE_UNLOCKS/Buildings.xml</File> </Items> </UpdateDatabase> <LocalizedText id="Dummy_UnlockerResources_Text"> <Items> <File>XML_RESOURCE_UNLOCKS/Buildings_Text.xml</File> </Items> </LocalizedText> </Components>
- Now that the "Real" building called the Stoneworks and its "Dummy Unlocker" called the Stoneworks Unlocker are set up to be added to the game's database, we can implement these two buildings within the code of the utility.
- So far, except for defining the dummy building, there is nothing that has been shown that you would not already need to do in order to create a Stoneworks building and make it give the desired extra production to a city.
Adding Needed Files From This Utility to Your Mod:
- You will need three of the files from the attached mod. You will copy/paste these files into your mod.
- DummyUnlockerResources.sql from the folder "SQL_RESOURCE_UNLOCKS"
- You must add this whole file to your mod, and you must not make any changes to it.
- DummyUnlockerResources.xml from the folder "XML_RESOURCE_UNLOCKS"
- You will alter the xml-code as needed for your dummy and real building(s). You can also just add the stuff that will be shown in this file to any other convenient xml file.
- DummyUnlockerResources.lua from the folder "LUA_RESOURCE_UNLOCKS"
- You will make one minor change to the code within this file, but otherwise you will make no changes to it.
- DummyUnlockerResources.sql from the folder "SQL_RESOURCE_UNLOCKS"
- Set-up in your modinfo file, as follows. It is important that the SQL file is listed above the xml file and the lua file in the mod's <Files> list, and also that it's UpdateDatabase in <Components> appears above that for the xml file.
Code:<Files> <File>SQL_RESOURCE_UNLOCKS/DummyUnlockerResources.sql</File> <File>XML_RESOURCE_UNLOCKS/DummyUnlockerResources.xml</File> <File>LUA_RESOURCE_UNLOCKS/DummyUnlockerResources.lua</File> </Files> <Components> <UpdateDatabase id="Dummy_UnlockerResources_SQL"> <Items> <File>SQL_RESOURCE_UNLOCKS/DummyUnlockerResources.sql</File> </Items> </UpdateDatabase> <UpdateDatabase id="Dummy_UnlockerResources_XML"> <Items> <File>XML_RESOURCE_UNLOCKS/DummyUnlockerResources.xml</File> </Items> </UpdateDatabase> <GameplayScripts id="Dummy_UnlockerResources_LUA"> <Items> <File>LUA_RESOURCE_UNLOCKS/DummyUnlockerResources.lua</File> </Items> </GameplayScripts> </Components>
- You can alter the folder names where you place these three files, for example, to meet your own needs within your mod. Just be sure the folder names where you actually place them match to what you designate within the modinfo file.
- What do these three files do?
- The SQL file creates three new tables where information can be placed into the game's database. You must not change the contents of this file because when multiple mods are all using this system, they need to see the same definition of the three new tables as they are expecting, not an altered version of the new tables that work for your mod but kill off everyone else's who is using this system.
- The XML is where you actually register your links between the dummy building and the needed map resources that you want to use as your requirments.
- The LUA file reads the data entered in the XML file and implements the effects of the three new tables, and adds or removes the dummy buildings as appropriate.
The New Game XML Tables:
- DummyUnlocker_LocalResources:
- This table is used to specify map-tile resources near a city that must exist in order for the city to be given the specified dummy building
- This table does not care whether the resource is improved or not, only that the resource exist on the map in a plot "owned" by the city.
- NEVER use this table and the DummyUnlocker_ImprovedLocalResources for the same dummy building. Each dummy building either needs to be in this table or the DummyUnlocker_ImprovedLocalResources table, but not both tables.
- Columns for the table:
- BuildingType: this is the dummy building
- ResourceType: this is the resource.
- when multiple resources are listed for the same dummy building in the table, any one resource being present will allow the dummy building
- CustomModId: this is a text string the need for which will be explained later
- Example:
Code:<DummyUnlocker_LocalResources> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" ResourceType="RESOURCE_MARBLE" CustomModId="LeeS_Cheeseburgers" /> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" ResourceType="RESOURCE_STONE" CustomModId="LeeS_Cheeseburgers" /> </DummyUnlocker_LocalResources>
- DummyUnlocker_ImprovedLocalResources:
- This table is used to specify map-tile resources near a city that must exist and be improved with the correct improvement in order for the city to be given the specified dummy building
- NEVER use this table and the DummyUnlocker_LocalResources for the same dummy building. Each dummy building either needs to be in this table or the DummyUnlocker_LocalResources table, but not both tables.
- Columns for the table:
- BuildingType: this is the dummy building
- ResourceType: this is the resource.
- when multiple resources are listed for the same dummy building in the table, any one resource being present will allow the dummy building
- CustomModId: this is a text string the need for which will be explained later
- Example:
Code:<DummyUnlocker_ImprovedLocalResources> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" ResourceType="RESOURCE_MARBLE" CustomModId="LeeS_Cheeseburgers" /> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" ResourceType="RESOURCE_STONE" CustomModId="LeeS_Cheeseburgers" /> </DummyUnlocker_ImprovedLocalResources>
- DummyUnlocker_RequiresBuildingPreReqORS:
- This table is used to specify that the dummy building also needs a "real" building to exist in the city in addition to any resource requirements.
- This table acts as an "ORS" table. This means that if more than one "real" building is listed as a prerequisite for a dummy building, only one of the listed "real" buildings is needed in the city. This is intentional to match the way the usual buildings-prereqs table works. So you could make a dummy need either a Barracks or a Stable exist in the city, for example, to make a similar effect to the way the Armory requires either a Barracks or a Stable.
- Columns for the table:
- BuildingType: this is the dummy building
- PrereqBuilding: this is the "real" building that also must be in the city before the dummy will be added.
- CustomModId: this is a text string the need for which will be explained later
- Example:
Code:<DummyUnlocker_RequiresBuildingPreReqORS> <Row BuildingType="BUILDING_STONEWORKS_UNLOCKER" PrereqBuilding="BUILDING_MARKET" CustomModId="LeeS_Cheeseburgers"/> </DummyUnlocker_RequiresBuildingPreReqORS>
Attachments
Last edited: