FANDOM


(See also: Template:UpdateNavbox row integrated into Template:EditRulesetNavbox)
(Update to 14-Mar-18 level)
Line 2: Line 2:
 
ruleset to development version (one that will become freeciv 3.1)
 
ruleset to development version (one that will become freeciv 3.1)
 
compatible ones. Currently this goes up to compatibility with
 
compatible ones. Currently this goes up to compatibility with
freeciv master commit ??????, ??-???-17.
+
freeciv master commit 4e44401177, 14-Mar-18.
   
 
==Capability==
 
==Capability==
Line 10: Line 10:
 
options="+Freeciv-ruleset-Devel-2017.Jan.02"
 
options="+Freeciv-ruleset-Devel-2017.Jan.02"
 
format_version=20</pre>
 
format_version=20</pre>
  +
  +
==parser.lua==
  +
New '''parser.lua''' lua script is needed in the ruleset. Empty file by that name is enough when not wanting any new features from it but only to update ruleset with existing functionality.
  +
  +
==Unit vision layer==
  +
Add '''vision_layer''' entry for unit types requiring it. You don't need to define it for units on default layer, but only for those units that have had '''Partial_Invis''' flag. Remove the flag and set vision_layer="Stealth" for them.
  +
  +
==Bridge rules==
  +
Any extra can now require bridge building tech, not only roads. Each extra lists other extras that, if present, make it to require a bridge technology. Road flags '''RequiresBridge''' and '''PreventsOtherRoads''' are removed as obsolete.
  +
For each road that had '''RequiresBridge''' add '''bridged_over''' list of extras to equivalent '''extra''' section. That list should contain all the extras that formerly had '''PreventsOtherRoads''' in their '''road''' section. Once you've done that, remove the flags from all road sections.
  +
  +
<pre>[road_road]
  +
extra = "Road"
  +
...
  +
flags = "RequiresBridge"
  +
  +
[road_rail]
  +
extra = "Railroad"
  +
...
  +
flags = "RequiresBridge"
  +
  +
[road_river]
  +
extra = "River"
  +
...
  +
flags = "PreventsOtherRoads"
  +
  +
[road_canal]
  +
extra = "Canal"
  +
...
  +
flags = "PreventsOtherRoads"</pre>
  +
  +
->
  +
  +
<pre>[extra_road]
  +
name = _("Road")
  +
...
  +
bridged_over = "River", "Canal"
  +
  +
[extra_rail]
  +
name = _("Railroad")
  +
...
  +
bridged_over = "River", "Canal"</pre>
  +
  +
==Convert effects to Action Enablers==
  +
Some boolean effects have been replaced by Action Enablers.
  +
  +
===Transform_Possible effect to Transform_Terrain Enabler==
  +
Replace any '''Transform_Possible''' effect with equivalent '''Transform_Terrain''' Action Enabler.
  +
  +
<pre>[effect_transform]
  +
type = "Transform_Possible"
  +
value = 1
  +
reqs =
  +
{ "type", "name", "range"
  +
"Tech", "Fusion Power", "Player"
  +
"UnitFlag", "Transform", "Local"
  +
}</pre>
  +
  +
->
  +
  +
<pre>[actionenabler_transform_terrain]
  +
action = "Transform Terrain"
  +
actor_reqs =
  +
{ "type", "name", "range"
  +
"Tech", "Fusion Power", "Player"
  +
"UnitFlag", "Transform", "Local"
  +
}</pre>
  +
   
 
==See also==
 
==See also==
 
{{EditRulesetNavbox}}
 
{{EditRulesetNavbox}}
 
 
[[Category:Editing rulesets]]
 
[[Category:Editing rulesets]]

Revision as of 02:17, March 14, 2018

This document describes how to convert freeciv 3.0 compatible ruleset to development version (one that will become freeciv 3.1) compatible ones. Currently this goes up to compatibility with freeciv master commit 4e44401177, 14-Mar-18.

Capability

Capability string of each ruleset file must be changed. Also a new format_version field needs to be added. For 3.1 rulesets the format version is 20.

[datafile]
options="+Freeciv-ruleset-Devel-2017.Jan.02"
format_version=20

parser.lua

New parser.lua lua script is needed in the ruleset. Empty file by that name is enough when not wanting any new features from it but only to update ruleset with existing functionality.

Unit vision layer

Add vision_layer entry for unit types requiring it. You don't need to define it for units on default layer, but only for those units that have had Partial_Invis flag. Remove the flag and set vision_layer="Stealth" for them.

Bridge rules

Any extra can now require bridge building tech, not only roads. Each extra lists other extras that, if present, make it to require a bridge technology. Road flags RequiresBridge and PreventsOtherRoads are removed as obsolete. For each road that had RequiresBridge add bridged_over list of extras to equivalent extra section. That list should contain all the extras that formerly had PreventsOtherRoads in their road section. Once you've done that, remove the flags from all road sections.

[road_road]
extra = "Road"
...
flags = "RequiresBridge"

[road_rail]
extra = "Railroad"
...
flags = "RequiresBridge"

[road_river]
extra = "River"
...
flags = "PreventsOtherRoads"

[road_canal]
extra = "Canal"
...
flags = "PreventsOtherRoads"

->

[extra_road]
name = _("Road")
...
bridged_over = "River", "Canal"

[extra_rail]
name = _("Railroad")
...
bridged_over = "River", "Canal"

Convert effects to Action Enablers

Some boolean effects have been replaced by Action Enablers.

=Transform_Possible effect to Transform_Terrain Enabler

Replace any Transform_Possible effect with equivalent Transform_Terrain Action Enabler.

[effect_transform]
type    = "Transform_Possible"
value   = 1
reqs    =
    { "type", "name", "range"
      "Tech", "Fusion Power", "Player"
      "UnitFlag", "Transform", "Local"
    }

->

[actionenabler_transform_terrain]
action        = "Transform Terrain"
actor_reqs    =
    { "type",          "name",         "range"
      "Tech",          "Fusion Power", "Player"
      "UnitFlag",      "Transform",    "Local"
    }


See also

Editing Rulesets
Editing BuildingsEditing CitiesEditing EffectsEditing GameEditing Governments
Editing NationsEditing StylesEditing TechsEditing TerrainEditing Units
Update from 2.2 to 2.32.3 to 2.42.4 to 2.52.5 to 2.62.6 to 3.03.0 to 3.1
Community content is available under CC-BY-SA unless otherwise noted.