Second irrigation (farmland)

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Wahazar
Veteran
Posts: 74
Joined: Mon Jul 02, 2018 1:49 pm

Second irrigation (farmland)

Postby Wahazar » Fri Jul 13, 2018 2:31 pm

Where I can alter prerequisites for farmland transformation? Is it hardcoded for Refrigeration?

User avatar
vodot
Veteran
Posts: 79
Joined: Thu May 17, 2018 4:54 pm

Re: Second irrigation (farmland)

Postby vodot » Fri Jul 13, 2018 5:52 pm

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.

Wahazar
Veteran
Posts: 74
Joined: Mon Jul 02, 2018 1:49 pm

Re: Second irrigation (farmland)

Postby Wahazar » Sat Jul 14, 2018 7:57 pm

Thank you for help. I didn't found any Farmland definition in rulesets shipped with freeciv, thus my concerns about hardcoded feature.

User avatar
JTN
Elite
Posts: 462
Joined: Wed Jan 30, 2013 12:15 am

Re: Second irrigation (farmland)

Postby JTN » Sat Jul 14, 2018 10:05 pm

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 = "-"

User avatar
vodot
Veteran
Posts: 79
Joined: Thu May 17, 2018 4:54 pm

Re: Second irrigation (farmland)

Postby vodot » Sun Jul 15, 2018 1:55 pm

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.