acluewithout
Deity
- Joined
- Dec 1, 2017
- Messages
- 3,496
Hello
I'm working on a mod for mid / late game buildings.
I'd like to give Cities +1 Housing if they're within 6 Tiles of a Factory. I've written something with .sql, but my games crash when I run them. Does anyone know where I'm going wrong?
Note (0): I'm trying to using the effect "EFFECT_ADJUST_CITY_HOUSING_FROM_GREAT_PEOPLE" to boost housing, as I couldn't find anything else that would boost a City's housing (rather than boosting a Building's housing).
Note (1): I've set housing to 100, just so it's easier to see whether the code is working.
Note (2): @FearSunn I used your IZ mod as a starting point. If you have any comments, it would be very welcome.
I'm working on a mod for mid / late game buildings.
I'd like to give Cities +1 Housing if they're within 6 Tiles of a Factory. I've written something with .sql, but my games crash when I run them. Does anyone know where I'm going wrong?
Code:
--MORE HOUSING
INSERT INTO DynamicModifiers (ModifierType, CollectionType, EffectType)
VALUES ("QNC_MODIFIER_ADJUST_CITY_POPULATION", "COLLECTION_PLAYER_CITIES", "EFFECT_ADJUST_CITY_HOUSING_FROM_GREAT_PEOPLE");
INSERT INTO Types (Type, Kind)
VALUES ("QNC_MODIFIER_ADJUST_CITY_POPULATION", "KIND_MODIFIER");
INSERT INTO BuildingModifiers (BuildingType, ModifierId) VALUES ("BUILDING_FACTORY", "QNC_FACTORY_AOE_HOUSINGBOOST");
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, NewOnly, Permanent, OwnerRequirementSetId, SubjectRequirementSetId, OwnerStackLimit, SubjectStackLimit)
VALUES ("QNC_FACTORY_AOE_HOUSINGBOOST", "QNC_MODIFIER_ADJUST_CITY_POPULATION", 0, 0, 0, null, "QNC_CITY_HAS_NEARBY_FACTORY_REQUIREMENTS", null, null);
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES ("QNC_FACTORY_AOE_HOUSINGBOOST", "Amount", "ARGTYPE_IDENTITY", 100, null, null);
INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES ("QNC_CITY_HAS_NEARBY_FACTORY_REQUIREMENTS", "QNC_REQUIRES_CITY_HAS_NEARBY_FACTORY");
INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES ("QNC_CITY_HAS_NEARBY_FACTORY_REQUIREMENTS", "REQUIREMENTSET_TEST_ANY");
--INSERT INTO RequirementArguments (RequirementId, Name, Type, Value, Extra, SecondExtra)
--VALUES ("QNC_REQUIRES_CITY_HAS_NEARBY_FACTORY", "BuildingType", "ARGTYPE_IDENTITY", "BUILDING_FACTORY", null, null);
--INSERT INTO RequirementArguments (RequirementId, Name, Type, Value, Extra, SecondExtra)
--VALUES ("QNC_REQUIRES_CITY_HAS_NEARBY_FACTORY", "MaxRange", "ARGTYPE_IDENTITY", "6", null, null);
--INSERT INTO RequirementArguments (RequirementId, Name, Type, Value, Extra, SecondExtra)
--VALUES ("QNC_REQUIRES_CITY_HAS_NEARBY_FACTORY", "MinRange", "ARGTYPE_IDENTITY", "0", null, null);
--INSERT INTO Requirements (RequirementId, RequirementType, Likeliness, Impact, Inverse, Reverse, Persistent, ProgressWeight, Triggered)
--VALUES ("QNC_REQUIRES_CITY_HAS_NEARBY_FACTORY", "REQUIREMENT_PLOT_ADJACENT_BUILDING_TYPE_MATCHES", 0, 0, 0, 0, 0, 1, 0);
Note (0): I'm trying to using the effect "EFFECT_ADJUST_CITY_HOUSING_FROM_GREAT_PEOPLE" to boost housing, as I couldn't find anything else that would boost a City's housing (rather than boosting a Building's housing).
Note (1): I've set housing to 100, just so it's easier to see whether the code is working.
Note (2): @FearSunn I used your IZ mod as a starting point. If you have any comments, it would be very welcome.
Last edited: