Second irrigation (farmland)

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

Second irrigation (farmland)

Post by Wahazar »

Where I can alter prerequisites for farmland transformation? Is it hardcoded for Refrigeration?
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
User avatar
vodot
Veteran
Posts: 81
Joined: Thu May 17, 2018 4:54 pm

Re: Second irrigation (farmland)

Post 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.
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: Second irrigation (farmland)

Post by Wahazar »

Thank you for help. I didn't found any Farmland definition in rulesets shipped with freeciv, thus my concerns about hardcoded feature.
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Second irrigation (farmland)

Post 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 = "-"
User avatar
vodot
Veteran
Posts: 81
Joined: Thu May 17, 2018 4:54 pm

Re: Second irrigation (farmland)

Post 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.
Post Reply