Page 1 of 1

Second irrigation (farmland)

Posted: Fri Jul 13, 2018 2:31 pm
by Wahazar
Where I can alter prerequisites for farmland transformation? Is it hardcoded for Refrigeration?

Re: Second irrigation (farmland)

Posted: Fri Jul 13, 2018 5:52 pm
by vodot
Wahazar wrote:Where I can alter prerequisites for farmland transformation? Is it hardcoded for Refrigeration?

Terrain improvements like Farmland are handled inside terrain.rulest. Below is the section you're looking for:

Code: Select all

[extra_farmland]
name           = _("Farmland")
category       = "Infra"
causes         = "Irrigation"
rmcauses       = "Pillage"
graphic        = "tx.farmland"
graphic_alt    = "-"
activity_gfx   = "unit.farmland"
act_gfx_alt    = "unit.irrigation"
act_gfx_alt2   = "unit.irrigate"
rmact_gfx      = "None"
rmact_gfx_alt  = "-"
reqs           =
    { "type", "name", "range"
      "Tech", "Refrigeration", "Player"
      "Extra", "Irrigation", "Local"
    }
build_time     = 0
removal_time   = 0
conflicts      = "Mine", "Oil Well"
; /* xgettext:no-c-format */
helptext       = _("\
Once Refrigeration is known, irrigation systems can be upgraded to \
farmland by irrigating them a second time; if the city working the tile \
has a Supermarket, a farmland tile provides 50% more food.\
"), _("\
Like irrigation, farmland is incompatible with mines and oil wells.\
")


If you change the req, remember to change the helptext in both the Farmland entry above and in the refrigeration entry in tech.ruleset, since it is not automatically linked.

Re: Second irrigation (farmland)

Posted: Sat Jul 14, 2018 7:57 pm
by Wahazar
Thank you for help. I didn't found any Farmland definition in rulesets shipped with freeciv, thus my concerns about hardcoded feature.

Re: Second irrigation (farmland)

Posted: Sat Jul 14, 2018 10:05 pm
by JTN
The construction vodot refers to is only in the current beta/RC versions, 2.6+.

In the stable release, 2.5.x, Farmland existence and behaviour is more hardcoded. It is a tech flag that controls when it is available, and you can change which tech(s) have that flag. For instance, from 2.5 data/classic/techs.ruleset, here is the linkage from Refrigeration to Farmland:

Code: Select all

[advance_refrigeration]
name     = _("Refrigeration")
req1     = "Sanitation"
req2     = "Electricity"
flags    = "Farmland"
graphic     = "a.refrigeration"
graphic_alt = "-"

Re: Second irrigation (farmland)

Posted: Sun Jul 15, 2018 1:55 pm
by vodot
JTN wrote:The construction vodot refers to is only in the current beta/RC versions, 2.6+.

In the stable release, 2.5.x, Farmland existence and behaviour is more hardcoded. It is a tech flag that controls when it is available, and you can change which tech(s) have that flag. For instance, from 2.5 data/classic/techs.ruleset, here is the linkage from Refrigeration to Farmland:

Code: Select all

[advance_refrigeration]
name     = _("Refrigeration")
req1     = "Sanitation"
req2     = "Electricity"
flags    = "Farmland"
graphic     = "a.refrigeration"
graphic_alt = "-"


man, I had forgotten that. You guys have continued to make terrific progress on this thing.