Changes in what a 2.6 rule set can do

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
cazfi
Elite
Posts: 1603
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a 2.6 rule set can do

Postby cazfi » Sun Feb 28, 2016 10:04 am

This feature is not strictly about what a modpack can do, but meant for modpack authors anyway:
Emitting warnings about deprecated constructs in the modpacks. Such constructs have been the right way to do something in older freeciv version, work in current one though better way to do the same thing exist, and are going to stop working in future versions. Warnings about them can come handy when updating modpack from freeciv version to another - things that still work might need adjusting to make them to use the new better way, that will also work in the future.
These warnings are only emitted when commandline parameter (to client, server, or both, depending which deprecations one wants to follow) '--warnings' has been given. It's recommended that modpack authors use that option, but the end-user is not annoyed with those warnings when running without the parameter.
This is still work-in-progress in current S2_6 codebase, so if your modpack comes warnings-clean now it's worth checking it again later when more things are being checked.
It's a known issue that freeciv's own helpdata gives some warnings that custom modpack author can do nothing about. Just ignore those for now.

sveinung
Elite
Posts: 430
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Postby sveinung » Tue Mar 08, 2016 3:21 pm

The actor_reqs requirement vector of the action enablers actors performed by a unit can now check city stuff (patch #7039)

The city stuff is checked against the city the actor unit is inside. If the actor unit is outside a city the requirement isn't there.

Example: any unit that has the user unit type flag LowMoraleExploiter and is behind City Walls can bribe a low HP enemy unit outside the walls.

Code: Select all

[actionenabler_bribe_unit_city_walls]
action = "Bribe Unit"
actor_reqs    =
    { "type",   "name", "range"
      "UnitFlag", "LowMoraleExploiter", "Local"
      "DiplRel", "War", "Local"
      "UnitState", "OnLivableTile", "Local"
      "MinMoveFrags", "1", "Local"
      "Building", "City Walls", "City"
    }
target_reqs    =
    { "type",   "name", "range", "present"
      "UnitFlag", "Unbribable", "Local", FALSE
      "CityTile", "Center", "Local", FALSE
      "Gov", "Republic", "Player", FALSE
      "Gov", "Democracy", "Player", FALSE
      "MaxUnitsOnTile", "1", "Local", TRUE
      "MinHitPoints", "6", "Local", FALSE
    }

The above action enabler assumes that the user unit type flag LowMoraleExploiter is defined. It can be translated to English as: It is also legal to bribe a unit if the actor unit has the LowMoraleExploiter unit type flag, the actor unit's owner is at war with the target unit, the actor unit can live outside a transport at its current tile, the actor unit has 1 or more move fragments left, the actor unit is inside a city with City Walls, the target unit isn't unbribable, the target unit isn't inside a city, the target unit doesn't belong to a Republic, the target unit doesn't belong to a Democracy, the target unit is alone at its tile and the target unit doesn't have 6 or more hit points.

sveinung
Elite
Posts: 430
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Postby sveinung » Thu Mar 10, 2016 1:49 pm

You can now turn of automatic help text generation for an action (patch #7046)

You can now prevent automatic help text generation about what enables or disables an action. Use this if you already have documented it by hand.

Example: you have documented unit bribing and city inciting. (What units can do it, who it can be done to, who are immune etc)

Code: Select all

quiet_actions = "Bribe Unit", "Incite City"

bard
Veteran
Posts: 110
Joined: Fri Jun 14, 2013 2:00 pm

Re: Changes in what a 2.6 rule set can do

Postby bard » Wed Mar 23, 2016 7:56 pm

Is it possible to allow units to survive after they perform an action? For example diplomats that survive when they "Investigate City".

sveinung
Elite
Posts: 430
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Postby sveinung » Wed Mar 23, 2016 8:32 pm

bard wrote:Is it possible to allow units to survive after they perform an action? For example diplomats that survive when they "Investigate City".

A unit with the "Spy" flag will survive "Investigate City". I didn't get around to fine grained action by action control. I hope to do it as a part of generalized actions in 3.0.

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

Re: Changes in what a 2.6 rule set can do

Postby JTN » Mon Sep 04, 2017 9:29 pm

A summary of the new 2.6 stuff available to modders can now be found in NEWS-2.6.0.