This part here makes no sense:
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId) VALUES
('TRAIT_INDUSTRIAL_GREAT_PERSON_1', 'MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY', 0, 1, 'PLAYER_NEEDS_INDUSTRYTECH'),
('TRAIT_INDUSTRIAL_GREAT_PERSON_2', 'MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY', 1, 1, 'PLAYER_ENGINEERBRIT_REQUIREMENTS'),
('TRAIT_INDUSTRIAL_GREAT_PERSON_3', 'MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY', 0, 1, 'DISTRICT_IS_INDUSTRIAL_BRITISH');
and
INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES
('TRAIT_CIVILIZATION_ENGLAND_2', 'TRAIT_INDUSTRIAL_GREAT_PERSON_1'),
('TRAIT_CIVILIZATION_ENGLAND_2', 'TRAIT_INDUSTRIAL_GREAT_PERSON_2'),
('TRAIT_CIVILIZATION_ENGLAND_2', 'TRAIT_INDUSTRIAL_GREAT_PERSON_3');
You are creating three disconnected sets of Traits/Modifiers, only one of which is functional (TRAIT_CIVILIZATION_ENGLAND_2 / TRAIT_INDUSTRIAL_GREAT_PERSON_2), while the other two have no content apart from their Requirements. Set 1 and Set 3 are useless in this setup. So, your Requirements #1 and #3 have no effect and do not limit the Trait that you are creating.
What you have is:
Trait A
Modifier I (No Effect + Requirement 1)
Modifier II (ModifierEffect(Create GPIndividual) IF Requirement 2 IS SATISFIED)
Modifier III (No Effect + Requirement 3)
In order to function the way you intended, Requirements must either (1) be grouped under one RequirementSet linked to a single Modifier, or (2) be stacked through their respective Modifiers, which, in turn, fit inside each other like Russian dolls. So, it's like this:
Approach A
Trait I (Modifier)
Modifier (ModifierEffect(Create GPIndividual) IF ALL OF (or any of/none of/etc.) Requirement 1, Requirement 2, Requirement 3 ARE SATISFIED)
Approach B
Trait A
Modifier I (ModifierEffect(Apply Modifier II) IF Requirement 1 IS SATISFIED)
Modifier II (ModifierEffect(Apply Modifier III) IF Requirement 2 IS SATISFIED)
Modifier III (ModifierEffect(Create GPIndividual) IF Requirement 3 IS SATISFIED)
The only Modifier that has arguments (i.e. functionality) attached to it is the second one. Now, if you were to use separate Modifiers (an approach that, for reasons explained below, actually has a greater chance of success than Approach A, which I have tried ad nauseum and discarded), it would go something like this:
Approach C
(i) England Trait / (Grant Access to a Dummy Building & Dummy Building Alternative)
(ii) Dummy Building / Required Technology + TraitType + Specified District (CAN create GP)
(iii) Dummy Building Alternative / No TechPrereq + TraitType + Specified District (CANNOT create GP)
(iii) Building Modifier / Modifier I (ModifierEffect(Create GPIndividual When Dummy Building Created) IF Requirement 1 (England Has Required Technology) )
(iv) District Modifier / Modifier II (ModifierEffect(Grant Dummy Building in City) IF Requirement 1 (England Has Required Technology) ARE SATISFIED)
(v) District Modifier / Modifier III (ModifierEffect(Grant Dummy Building Alternative in City) IF Requirement 1 in Inverse (England DOES NOT HAVE Required Technology) ARE SATISFIED)
Unfortunately, because we are doing this in XML only, we cannot use EnabledByReligion to "hide" the Dummy Building from the player, but, and I have not tested this, we might still be able to omit specifying the purchase type of yield and make the Dummy Building MustPurchase, which would preclude the player from purchasing or building the building (this does work, as I tested it, and the building does not appear in the build lists).
Part (i) is fairly simple. Just follow any of the examples in the base game (e.g. Poland's TRAIT_CIVILIZATION_BUILDING_SUKIENNICE).
Part (ii) is also fairly simple. You are setting up the Dummy Building and its Alternative (made mutually exclusive via MutuallyExclusiveBuildings table). Active Dummy Building will require TECH_INDUSTRIALIZATION. Dummy Building Alternative will have no tech requirements.
So, for the Modifiers:
ModifierEffect(Create GPIndividual When Dummy Building Created) -- this one is as you have above: MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY. Here is a caveat about this modifier. It is coded as follows:
<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>
This means that the Effect of the Modifier is applied to a specific group: COLLECTION_OWNER. This is the owner of the city in question, i.e. CIVILIZATION_ENGLAND. Herein lies the problem with applying Requirements. First of all, I believe only SubjectRequirementSetId column can be used, since there is no Owner to an Owner. Second, you can't use REQUIREMENT_DISTRICT_TYPE_MATCHES, because Civilization Type cannot match a District Type. These are two different tables, columns, and values and are incompatible. Hence, the district Requirement must come somewhere else. Finally, as for the REQUIREMENT_PLAYER_CAN_EVER_EARN_GREAT_PERSON_CLASS, I do not see the need for it. It is superfluous. I believe it is meant to address situations where Kongo builds Stonehenge, or a player builds Stonehenge after getting a great prophet by other means, or the unlikely situation Stonehenge is built
after all the great prophets have been distributed and there are none to distribute. So, it seems to me that you can safely discard this requirement, provided that you do not allow Minor Civilizations (City States) to ever build the Dummy Building.
The other modifier we'll need is: MODIFIER_SINGLE_CITY_GRANT_BUILDING_IN_CITY. The only requirement we'll need is: REQUIREMENT_PLAYER_HAS_TECHNOLOGY. Anyways, long story short, here are the two parts of the code in XML:
Code:
-- CIVILIZATION TRAIT
INSERT INTO Types (Type, Kind) VALUES
('TRAIT_BUILDING_GP_GENERATOR', 'KIND_TRAIT');
INSERT INTO Traits (TraitType, Name, Description) VALUES
('TRAIT_BUILDING_GP_GENERATOR', 'Trait Generating GPs', 'Trait that enables GP generation upon certain conditions being reached');
INSERT INTO CivilizationTraits (CivilizationType, TraitType) VALUES
('CIVILIZATION_ENGLAND', 'TRAIT_BUILDING_GP_GENERATOR');
-- ACTIVE DUMMY BUILDING FOR GENERATING A GP
INSERT INTO Types (Type, Kind) VALUES ('BUILDING_GP_GENERATOR', 'KIND_BUILDING');
INSERT INTO Buildings (BuildingType, Name, Description, PrereqTech, PrereqDistrict, Cost, EnabledByReligion, MustPurchase, TraitType) VALUES
('BUILDING_GP_GENERATOR', 'GP Generator Asset', 'Dummy building that generates a GP', 'TECH_INDUSTRIALIZATION', 'DISTRICT_INDUSTRIAL_ZONE', 1, 0, 1, "TRAIT_BUILDING_GP_GENERATOR");
-- ANTI DUMMY BUILDING TO PRECLUDE INVALID GP GENERATION
INSERT INTO Types (Type, Kind) VALUES ('BUILDING_ANTI_GP_GENERATOR', 'KIND_BUILDING');
INSERT INTO Buildings (BuildingType, Name, Description, PrereqDistrict, Cost, EnabledByReligion, MustPurchase) VALUES
('BUILDING_ANTI_GP_GENERATOR', 'GP Generation Limiter', 'Precludes generation of GPs for districts built prior to completing required technology', 'DISTRICT_INDUSTRIAL_ZONE', 1, 0, 1);
INSERT INTO MutuallyExclusiveBuildings (Building, MutuallyExclusiveBuilding) VALUES
('BUILDING_GP_GENERATOR', 'BUILDING_ANTI_GP_GENERATOR'),
('BUILDING_ANTI_GP_GENERATOR', 'BUILDING_GP_GENERATOR');
-- PLACING THE BUILDING IN THE SPECIFIED DISTRICT
INSERT INTO DistrictModifiers (DistrictType, ModifierId) VALUES
('DISTRICT_INDUSTRIAL_ZONE', 'BUILDING_GP_GENERATOR_MODIFIER');
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
('BUILDING_GP_GENERATOR_MODIFIER', 'MODIFIER_SINGLE_CITY_GRANT_BUILDING_IN_CITY', 0, 1, NULL, 'PLAYER_HAS_DESIGNATED_TECH_REQUIREMENTS');
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES
('BUILDING_GP_GENERATOR_MODIFIER', 'BuildingType', 'ARGTYPE_IDENTITY', 'BUILDING_GP_GENERATOR', NULL, NULL);
INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES
('PLAYER_HAS_DESIGNATED_TECH_REQUIREMENTS', 'REQUIREMENTSET_TEST_ALL');
INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES
('PLAYER_HAS_DESIGNATED_TECH_REQUIREMENTS', 'REQUIRES_DESIGNATED_TECHNOLOGY');
INSERT INTO Requirements (RequirementId, RequirementType) VALUES
('REQUIRES_DESIGNATED_TECHNOLOGY', 'REQUIREMENT_PLAYER_HAS_TECHNOLOGY');
INSERT INTO RequirementArguments (RequirementId, Name, Value) VALUES
('REQUIRES_DESIGNATED_TECHNOLOGY', 'TechnologyType', 'TECH_INDUSTRIALIZATION');
-- TRIGGERING GP GENERATION WITH THE ACTIVE DUMMY BUILDING
INSERT INTO BuildingModifiers (BuildingType, ModifierId) VALUES
('BUILDING_GP_GENERATOR', 'GP_GENERATOR_MODIFIER');
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
('GP_GENERATOR_MODIFIER', 'MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY', 0, 1, NULL, 'PLAYER_HAS_DESIGNATED_TECH_REQUIREMENTS');
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES
('GP_GENERATOR_MODIFIER', 'GreatPersonClassType', 'ARGTYPE_IDENTITY', 'GREAT_PERSON_CLASS_ENGINEER', NULL, NULL),
('GP_GENERATOR_MODIFIER', 'Amount', 'ARGTYPE_IDENTITY', '1', NULL, NULL);
-- PRECLUDING GP GENERATION WITH THE ANTI DUMMY BUILDING
INSERT INTO DistrictModifiers (DistrictType, ModifierId) VALUES
('DISTRICT_INDUSTRIAL_ZONE', 'BUILDING_ANTI_GP_GENERATOR_MODIFIER');
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
('BUILDING_ANTI_GP_GENERATOR_MODIFIER', 'MODIFIER_SINGLE_CITY_GRANT_BUILDING_IN_CITY', 0, 1, NULL, 'PLAYER_LACKS_DESIGNATED_TECH_REQUIREMENTS');
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES
('BUILDING_ANTI_GP_GENERATOR_MODIFIER', 'BuildingType', 'ARGTYPE_IDENTITY', 'BUILDING_ANTI_GP_GENERATOR', NULL, NULL);
INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES
('PLAYER_LACKS_DESIGNATED_TECH_REQUIREMENTS', 'REQUIREMENTSET_TEST_ALL');
INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES
('PLAYER_LACKS_DESIGNATED_TECH_REQUIREMENTS', 'REQUIRES_LACK_OF_DESIGNATED_TECHNOLOGY');
INSERT INTO Requirements (RequirementId, RequirementType, Likeliness, Inverse, Triggered) VALUES
('REQUIRES_LACK_OF_DESIGNATED_TECHNOLOGY', 'REQUIREMENT_PLAYER_HAS_TECHNOLOGY', 0, 1, 0);
INSERT INTO RequirementArguments (RequirementId, Name, Value) VALUES
('REQUIRES_LACK_OF_DESIGNATED_TECHNOLOGY', 'TechnologyType', 'TECH_INDUSTRIALIZATION');
I see no other way, but I may well have overlooked something. But this method works and works well.
(As an aside, as to why you are getting the "ERROR: no such table: Requirements" error, I have no clue, because there clearly is such a table in 01_GameplaySchema.xml. However, if this error shows, it probably means that the Requirements table has not been generated for some reason. This is a serious and game-breaking issue. If the table does not exist, all the connections breakdown, and much of the Modifier/Requirement functionality disappears for all the processes in the game).