Can a field have more than one entry?

Joined
Apr 11, 2015
Messages
438
For example:

PrereqTech="TECH_CYBERNETICS"

Can other things be added, such as:

PrereqTech="TECH_CYBERNETICS" "TECH_ADVANCED_AI" "TECH_ADVANCED_POWER_CELLS"

Is there a code syntax to try out, such as commas between each of them?
 
Full answer is also "no".

However, since the release of GS the game allows an lua script to enable and disable a unit-type for a given player, so it would be theoretically possible to accomplish the effect with an lua script. But only one TechnologyType can be listed directly in table Units. Doing this sort of thing via an lua script might or might not disable the Great Person ability to grant an early Death Robot however.
 
You can have multiple prerequisites for a tech, you just don’t put them into a single field. Civ uses a relational database, so 1 field = 1 value. N:m relations, and tech prerequisites is such a relation, are put into separate tables - always. Then each row in a table contains one relation, so for multiple prerequisites you need multiple rows.
 
And to be perfectly clear, you can put whatever you want into a text field, like multiple values separated by commas, etc. But this requires underlying programming to process and understand, and is used very rarely in Civ. Such field will be still a text field from DB perspective, and you won’t be able to use any features like constraint checking or references.
 
And to be perfectly clear, you can put whatever you want into a text field, like multiple values separated by commas, etc. But this requires underlying programming to process and understand, and is used very rarely in Civ. Such field will be still a text field from DB perspective, and you won’t be able to use any features like constraint checking or references.
About the only tables that appear coded to implement comma separated values is ModifierArguments (perhaps RequirementArguments but I've never tried it) and column 'Value' within those tables.

And to be clear to other forum members, Civ implements such entries as a Boolean ALL in the sense of all the arguments in the comma-separated entries are implemented. You cannot use any sort of AND or OR or NOT even when coding comma-separated entries when using SQL.

So, this sort of thing
Code:
	<!-- ============================================================================================================ -->
	<!-- ======== BUILDING_PETRA plot yield effect empire-wide: ought to double the effect in the Petra City ======== -->
	<!-- ============================================================================================================ -->
	<Modifiers>
		<Row>
			<ModifierId>PETRA_GLOBAL_YIELD_MODIFIER</ModifierId>
			<ModifierType>MODIFIER_PLAYER_ADJUST_PLOT_YIELD</ModifierType>
			<SubjectRequirementSetId>PETRA_YIELD_MODIFIER_REQUIREMENTS</SubjectRequirementSetId>
		</Row>
	</Modifiers>
	<ModifierArguments>
		<Row>
			<ModifierId>PETRA_GLOBAL_YIELD_MODIFIER</ModifierId>
			<Name>YieldType</Name>
			<Value>YIELD_FOOD,YIELD_GOLD,YIELD_PRODUCTION</Value>
		</Row>
		<Row>
			<ModifierId>PETRA_GLOBAL_YIELD_MODIFIER</ModifierId>
			<Name>Amount</Name>
			<Value>2,2,1</Value>
		</Row>
	</ModifierArguments>
	<BuildingModifiers>
		<Row>
			<BuildingType>BUILDING_PETRA</BuildingType>
			<ModifierId>PETRA_GLOBAL_YIELD_MODIFIER</ModifierId>
		</Row>
	</BuildingModifiers>
But if you try this
Code:
	<Buildings>
		<Row BuildingType="BUILDING_BATHHOUSE" Name="LOC_BUILDING_BATHHOUSE_NAME" PrereqTech="TECH_ENGINEERING,TECH_STEEL"
			PrereqDistrict="DISTRICT_AQUEDUCT" PurchaseYield="YIELD_GOLD" Cost="155" AdvisorType="ADVISOR_CULTURE" Entertainment="2" Maintenance="2"/>
	</Buildings>
The game will probably just throw an Invalid Reference error message into Database.log and then shove you back to the main menu since there is no such animal as "TECH_ENGINEERING,TECH_STEEL" rather than using "TECH_ENGINEERING" or using "TECH_STEEL". It will not treat it as "TECH_ENGINEERING" AND "TECH_STEEL"
 
Last edited:
Back
Top Bottom