I'm trying to introduce the next change in my mod:
- cities yield per population is decreased greatly,
- each district generates a yield of the corresponding type based on city population
- you can build any number of districts of the same type for the city, their summed yield should be additive.
Here is what I've done using modifiers:
At first sight that worked like a charm. Base cities science yield was 0.1 per pop, when I build the first campus 0.45/pop, the second one 0.8/pop, the third one 1.15/pop (or some very near values).
But then I realized that this works for EVERY my city. So every campus in every city provides bonus to every city!
I haven't found any other yield effect related to the city population.
Is there a way to overcome the problem? For example, to use Lua for this. I haven't used it at all, so even any basic suggestions about how it can be used for the problem are very appreciated.
- cities yield per population is decreased greatly,
- each district generates a yield of the corresponding type based on city population
- you can build any number of districts of the same type for the city, their summed yield should be additive.
Here is what I've done using modifiers:
Code:
UPDATE GlobalParameters SET Value='10' WHERE Name='SCIENCE_PERCENTAGE_YIELD_PER_POP';
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, NewOnly, Permanent) VALUES ('AARS_DISTRICT_CAMPUS_SCIENCE_YIELD_CHANGE', 'MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_POPULATION', '0', '0', '0');
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES ('AARS_DISTRICT_CAMPUS_SCIENCE_YIELD_CHANGE', 'Amount', 'ARGTYPE_IDENTITY', '0.35');
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES ('AARS_DISTRICT_CAMPUS_SCIENCE_YIELD_CHANGE', 'YieldType', 'ARGTYPE_IDENTITY', 'YIELD_SCIENCE');
INSERT INTO DistrictModifiers (DistrictType, ModifierId) VALUES ('DISTRICT_CAMPUS', 'AARS_DISTRICT_CAMPUS_SCIENCE_YIELD_CHANGE');
UPDATE Districts SET OnePerCity='0' WHERE DistrictType='DISTRICT_CAMPUS';
At first sight that worked like a charm. Base cities science yield was 0.1 per pop, when I build the first campus 0.45/pop, the second one 0.8/pop, the third one 1.15/pop (or some very near values).
But then I realized that this works for EVERY my city. So every campus in every city provides bonus to every city!
I haven't found any other yield effect related to the city population.
Is there a way to overcome the problem? For example, to use Lua for this. I haven't used it at all, so even any basic suggestions about how it can be used for the problem are very appreciated.