[R&F] How do you mod amenities from luxury resources?

Question

King
Joined
Mar 12, 2008
Messages
950
How do you mod amenities from luxury resources so that each copy of the resources is valid for 4 cities, instead of a flat 4 cities max

Or is that not possible due to hardcoding?
 
Last edited:
Also interested about this. Clearly is available in game through world congress. I think "NO_CAP_LUXURY_RESOURCE" is the modifier used to allow multiple copies. While "BAN_LUXURY_RESOURCE" is used to make amenities 0. Unfortunately their doesn't appear to be modifier arguments in the database for these 2 modifiers. Probably something like Name = "Resource" Amount = "lux_resource_name" but unsure.
 
@Wolffleet Those modifiers are attached to the ResolutionTypes in the ResolutionEffects table. There's no ModifierArguments because it's handled via the WC_Validate_LuxuryBan GameEffect in WorldCongress.lua. You could probably construct your own Modifiers based off those ModifierTypes/EffectTypes to do what you want though.
 
I got it working by guessing the ModifierArgument!

SQL:
INSERT OR REPLACE INTO Modifiers (ModifierId, ModifierType) SELECT 'NO_CAP_HAPPINESS_' || ResourceType, 'MODIFIER_PLAYER_ADJUST_NO_CAP_RESOURCE'
    FROM Resources WHERE ResourceClassType IN ('RESOURCECLASS_BONUS', 'RESOURCECLASS_LUXURY');

INSERT OR REPLACE INTO ModifierArguments (ModifierId, Name, Value) SELECT 'NO_CAP_HAPPINESS_' || ResourceType, 'ResourceType', ResourceType
    FROM Resources WHERE ResourceClassType IN ('RESOURCECLASS_BONUS', 'RESOURCECLASS_LUXURY');

INSERT OR REPLACE INTO GameModifiers (ModifierId) SELECT 'NO_CAP_HAPPINESS_' || ResourceType
    FROM Resources WHERE ResourceClassType IN ('RESOURCECLASS_BONUS', 'RESOURCECLASS_LUXURY');

-- works for bonus resource too
-- UPDATE Resources SET Happiness = 1 WHERE ResourceClassType = 'RESOURCECLASS_BONUS';

luxury copies.jpg


Cheers! :lol:
 
I got it working by guessing the ModifierArgument!

SQL:
INSERT OR REPLACE INTO Modifiers (ModifierId, ModifierType) SELECT 'NO_CAP_HAPPINESS_' || ResourceType, 'MODIFIER_PLAYER_ADJUST_NO_CAP_RESOURCE'
    FROM Resources WHERE ResourceClassType IN ('RESOURCECLASS_BONUS', 'RESOURCECLASS_LUXURY');

INSERT OR REPLACE INTO ModifierArguments (ModifierId, Name, Value) SELECT 'NO_CAP_HAPPINESS_' || ResourceType, 'ResourceType', ResourceType
    FROM Resources WHERE ResourceClassType IN ('RESOURCECLASS_BONUS', 'RESOURCECLASS_LUXURY');

INSERT OR REPLACE INTO GameModifiers (ModifierId) SELECT 'NO_CAP_HAPPINESS_' || ResourceType
    FROM Resources WHERE ResourceClassType IN ('RESOURCECLASS_BONUS', 'RESOURCECLASS_LUXURY');

-- works for bonus resource too
-- UPDATE Resources SET Happiness = 1 WHERE ResourceClassType = 'RESOURCECLASS_BONUS';

View attachment 656680

Cheers! :lol:

Hey! Your codes are brilliant and work well in my own mod. However, I find that it would give duplicated amenities to same city from one luxury resource. For example, I have 3 copies of whale and 6 cities. I expect to see that all these 6 cities (exceed the 4 cities cap) receive 1 amenity from whale. But what happened is that 12 amenities from whale had been assigned to my 6 cities. In your picture, the whale also gives amenities to 8 cities although I am not sure if you have at least 8 cities. What's wired is that when I only have 1 copy, it works properly and will only give amenity to one city. But if I have 2 copies, I will then receive 8 amenities from this luxury resource even I have only 1 city.
I did not enable any other mod when I did the test. So, I guess that is the effect of your codes.
I think it is overpowered to let cities receive more than 1 amenities from the same luxury resource. But I do not know much about the CIV6 code structure. I wonder if you have any idea of this.
 
Hey! Your codes are brilliant and work well in my own mod. However, I find that it would give duplicated amenities to same city from one luxury resource. For example, I have 3 copies of whale and 6 cities. I expect to see that all these 6 cities (exceed the 4 cities cap) receive 1 amenity from whale. But what happened is that 12 amenities from whale had been assigned to my 6 cities. In your picture, the whale also gives amenities to 8 cities although I am not sure if you have at least 8 cities. What's wired is that when I only have 1 copy, it works properly and will only give amenity to one city. But if I have 2 copies, I will then receive 8 amenities from this luxury resource even I have only 1 city.
I did not enable any other mod when I did the test. So, I guess that is the effect of your codes.
I think it is overpowered to let cities receive more than 1 amenities from the same luxury resource. But I do not know much about the CIV6 code structure. I wonder if you have any idea of this.
No idea but it's how the feature in congress works. You could tweak the happiness value of luxury resources and GlobalParameters' CITY_POP_PER_AMENITY and LUXURY_HAPPINESS_LOSS_PER_ERA to rebalance this. The biggest drawback I can see is that there is no longer any point of trading luxury resources with AI civs.
 
No idea but it's how the feature in congress works. You could tweak the happiness value of luxury resources and GlobalParameters' CITY_POP_PER_AMENITY and LUXURY_HAPPINESS_LOSS_PER_ERA to rebalance this. The biggest drawback I can see is that there is no longer any point of trading luxury resources with AI civs.
Thank you for your response!
That's sad. Yes I agree that it would break the luxury resources trading with other civs. I will see if there is any other way to achieve it.
 
Top Bottom