Question: Strength scaling with resource amount?

God 2.0

Chieftain
Joined
Apr 10, 2012
Messages
14
Hello there!

I'm wondering: I there a way to make unit strength scale with strategic resource amount?

I'd like to make a mod where rather than requiring a resource to build a unit, different units scale with the amount of resources available.
I find that often I have more than enough strategic resources for my army needs. Scaling strength against resources would make it more worthwhile to actually find and trade for more strategic resources.
This would also make buildings that rely on the same resources weaken your army, creating more choice for the player.

Hoping for an answer!
 
My question still stands, so I'm necroing the thread in hope of an answer.
 
Hi,

Depending on what you want specifically, it should be possible, though not with xml/sql alone. You'll need to add a bunch of promotions with different combat strength bonuses, and then with lua check amount of resources owned and add the relevant promotion(s) to the relevant unit(s).

You can check out my Nuraghians civ (in my signature) - their UA is a bit similar to what you want (unit strength scale with the number of some specific luxuries exported instead). In order to check the amount of strategic resources available you can use
Code:
GetNumResourceAvailable(ResourceType resource, bool includeImport)
or
Code:
GetNumResourceTotal(ResourceType resource, bool includeImport)

Hopefully that can help you get started.
 
Thanks a bunch for your help, Ulixes and Danmacsch! I'll be sure to check out your mods as well.
 
Top Bottom