Is it possible to toggle whether a unit is purcheasable with gold using a modifier?

Mettpawwz

Chieftain
Joined
Feb 4, 2017
Messages
73
Is it possible?

I want to make a government disallow all unit gold purchases.

So far I've had the idea of making this government simply use a modifier using EFFECT_ADJUST_UNIT_PURCHASE_COST to increase the cost by 10000% for example, but it turns out that you can only reduce the cost, not increase it. This effect doesn't accept negative numbers as an argument.

Also, even if this did work it would not be a very clean way of doing it because it would need every unit to be individually modified (killing compatibility with mods that add units), not to mention you'd still see the "purchase with gold" option.

Anyone have any suggestions?

Thanks in advance.
 
Last edited:
You wouldn't need a negative number to make EFFECT_ADJUST_UNIT_PURCHASE_COST increase cost, but a fraction. It's a multiplier, so to increase costs you'd need to set it to .50 (50% increase) or .75 (25% increase). However I don't think the parameter can take fractions, which is an irritation of mine. (Same thing happens with Trade Routes which prevents creating, for example, "1 trade route per 2 x items.")

I can't think of any way to make this work. There is a way to do it with Faith but I think that is hardcoded to Faith.
 
Yeah, I tried fractions as well and they didn't work. I could be wrong but I'm pretty sure the effect is % based, not a simple multiplier (a value of 2 doesn't halve the cost, but rather it reduces it by 2%) so in your example of .5 that would actually reduce the cost by 0.5 percent (a negligible amount, and like you said I don't even think it takes fractions), not double it.

Either way, it doesn't really matter since that's not really how I'd like to do it anyway even if it did work.

I suppose I'll have to wait till hopefully Firaxis creates content with an effect like the one I want, if that ever happens. The hard-coding monster strikes again :(

Thanks a bunch anyway though!
 
The workaround way to do it, if you are really dedicated to it, is to increase the cost of everything in the game, then use the Modifier as a bonus to everyone who is not using your ability. But this can have plenty of unexpected results, particularly with how it displays in the UI.
 
Top Bottom