(RESOLVED) Adjusting City Strength with Tech

y10

Chieftain
Joined
Oct 20, 2020
Messages
77
I have been trying to add an inner city strength bonus that is activated by researching Future Tech. I tried duplicating the bastions route to add both inner and outer strength to the city (separately), but unfortunately neither worked. I noticed that for bastions, the combat preview text is appears to be stored in the policy table as opposed to ModifierStrings like it is for units. I suspect this may be part of the problem, but I'm not sure.

Here is the code that I have so far:
Code:
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, NewOnly, Permanent, OwnerRequirementSetId, SubjectRequirementSetId, OwnerStackLimit, SubjectStackLimit) VALUES ('FUTURE_TECH_CITY', 'MODIFIER_PLAYER_CITIES_ADJUST_OUTER_DEFENSE', 0, 0, 0, NULL, NULL, NULL, NULL);
INSERT INTO ModifierArguments (ModifierId, Name, Type, Value, Extra, SecondExtra) VALUES ('FUTURE_TECH_CITY', 'Amount', 'ARGTYPE_IDENTITY', '30', NULL, NULL);
INSERT INTO TechnologyModifiers (TechnologyType, ModifierId) VALUES ('TECH_FUTURE_TECH', 'FUTURE_TECH_CITY');
 
I test ran this code using Military Tactics instead of Future Tech and according to GameEffects.log the modifier was applied to all the player's cities. The only other change I made was to set 'Permanent' to boolean true. However there was no obvious easy to see difference esp since the way inner and outer defense are reported in the UI is confusing at best.
 
Thank you for your reply.

I looked at the GameEffects.log and I see that the log shows that the modifier is being applied, but when I actually play the game, the modifier does not seem to apply. I calculated the damage by hand, and saw that the game is just ignoring the modifier completely. Oddly enough, when I tried using the bastions pathway to adjust the city ranged strength (trying to add 30 combat strength), the modification for some reason added 600 to the base strength then added another 600 as a "ranged attack bonus". I have no idea where those numbers came from. Is it possible that since this modifier isn't related to bastions, it isn't applying the modifier because it can't find the combat preview text? If so, where should I put the combat preview text so that the modification can find it?
 
I wouldn't expect the preview text to have any effect on the modifier being applied one way or the other. The modifier as written would apply to AI-vs-AI combat, and AI don't use text preview strings or user interfaces. Generally text is merely for the convenience of the human, so they can understand what the value of the effects are, but have no actual impact on gameplay.
 
I see what you mean. When I calculated the damage by hand (both with and without the modifier), the actual damage inflicted during combat was only consistent with the game ignoring the modifier. Do you know why the modifier would show up in the GameEffects.log but not during gameplay?
 
I think I figured out what was going wrong. Since I was testing with Future Tech (and setting the start point to information era), I had already researched steel walls. Steel walls seems to obsolete any bonus to city strength that uses the bastions pathway since it seems to freeze the outer city strength when it is activated. I switched the dynamic modifier of inner defense to affect COLLECTION_PLAYER_CITIES instead of COLLECTION_OWNER. After that (and switching outer defense for inner defense in the above code) the modifier affects the inner strength of all the cities.
 
Back
Top Bottom