Page 1 of 1

Help needed to implement strategic resources

Posted: Thu Jan 22, 2015 12:26 pm
by bard
I want to introduce in my earth scenario the idea of strategic resources, so some units can be cheaper when your city have access to certan resource. For example, knights being cheaper to upgrade or upkeep if there is Iron within the city radius.

There is a new requirement in v2.5 that seems to make it possible:

Code: Select all

reqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }
However, I'm unable to find any effect where this condition actually works. I have tried:

Code: Select all

type    = "Upgrade_Unit"
value   = 1
reqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }

type    = "Upgrade_Price_Pct"
value   = -50
reqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }

type    = "Upkeep_Factor"
value   = 1
nreqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }
The only effect I found that seems to work is Unit_Upkeep_Free_Per_City, but since it affects only the city where the resource is placed, in practice it is the same as if the Iron simply produces some extra shield.
Any suggestion?

Re: Help needed to implement strategic resources

Posted: Thu Jan 22, 2015 6:17 pm
by cazfi
bard wrote:However, I'm unable to find any effect where this condition actually works. I have tried:

Code: Select all

type    = "Upgrade_Unit"
value   = 1
reqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }

type    = "Upgrade_Price_Pct"
value   = -50
reqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }

type    = "Upkeep_Factor"
value   = 1
nreqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }
Of those Upgrade_Price_Pct is already documented (in README.effects) like: "This effect works at player level. You cannot adjust upgrade costs for certain unit type or for units upgraded in certain city."
City limitation applies to others, I think (you usually can't have city to affect units supported/present). We should improve the documentation.

Re: Help needed to implement strategic resources

Posted: Mon Apr 13, 2015 4:37 pm
by bard
I found a effect that seems to work: Veteran_Build.
I'm testing to use these strategic resources as requirements to recruit certain units as veterans.

Code: Select all

type    = "Veteran_Build"
value   = 1
reqs    =
    { "type", "name", "range"
      "Resource", "Iron", "City"
    }
But I think the best way to introduce strategic resources in a ruleset is to allow the construction of certain building in the city with the resource (for example Iron mine), and then to use this building as requisite for any effect you want.

Re: Help needed to implement strategic resources

Posted: Fri Apr 17, 2015 1:39 am
by GriffonSpade
bard wrote:I found a effect that seems to work: Veteran_Build.
I'm testing to use these strategic resources as requirements to recruit certain units as veterans.
...
But I think the best way to introduce strategic resources in a ruleset is to allow the construction of certain building in the city with the resource (for example Iron mine), and then to use this building as requisite for any effect you want.
Yes, it works just fine in effects and buildings, it's specifically allowing troops to be built that it doesn't work with yet.

Also, Blacksmith in a city rather than Iron Mine :)

The biggest obstacle to having units requiring buildings is actually getting art for them. It's actually pretty easy on the ruleset side.

I know I'd like to have a set of buildings for almost every unit.