Changes in what a 3.1 ruleset can do

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

Increased requirement vector length. See osdn #41661

You can now make a requirement vector than is 40 requirements long. That doubles the maximum legal size of a 3.0 requirement vector.

The primary motivation for this is that our ruleset compatibility code adds requirements. If you have a need for insanely long requirement vectors in regular Freeciv, like this, let me know. (The example linked above simulates regular moves being action enabler controlled to a high enough degree to let them trigger a Casus Belli. Regular moves are already enabler controlled in Freeciv 3.1. I'm still happy I wasn't the one that had to write that giant requirement vector.)
Last edited by sveinung on Wed Mar 10, 2021 3:57 pm, edited 1 time in total.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

unit_stack_death forced action list. See Feature #920951

You can now decide what actions a unit able to escape unit stack death can attempt to escape unit stack death via the new action list actions.unit_stack_death. So if there if no time to embark while escaping just don't include it in the list.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

Ruleset actor consuming always for conventional nukes. See osdn #41681

A nuke can have a max distance between the actor unit and the target so big that the explosion doesn't destroy the actor unit. You can now make it survive in those cases.

This allows you to create units that are armed with nukes without being nukes them self. You can use movement point or - when it arrives - a ruleset defined counter as ammo. Example: A Submarine that gets to fire one tactical nuke if it has any movement left, ending its turn.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

Ruleset min distance for conventional nukes. See osdn #41701

The (non spy) nuke actions already allowed the ruleset to set the max distance to the target. They can now set the minimum distance too.

This allows you to set a minimum distance to the target that is larger than the nuclear blast radius for units that are supposed to survive causing a nuclear explosion or to use one nuke action to better emulate another so one can replace two and the one freed up can be used for something else.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

More fine grained paradrop control. See osdn #41565

Freeciv 3.0's version of "Paradrop Unit" had the side effects of city conquest, base (Fortress/Castle) conquest and hut popping. You now have more fine grained control over what it does as it has been split so you can specify if a drop should result in conquest and/or hut entry/frightening. This is achieved by splitting the actions "Paradrop Unit Conquer", "Paradrop Unit Frighten", "Paradrop Unit Frighten Conquer", "Paradrop Unit Enter" and "Paradrop Unit Enter Conquer" from "Paradrop Unit". Extra conquest and city conquest is seen as the same side effect and therefore without separate actions but you can use action enabler rules to only allow paratroopers to do the conquer version of the action to tiles without the one you wish to exclude and the non conquest version to the tiles with the one you wish to exclude.

Example: Treuga Dei, a wonder that - for a while - bans the conquest version of paradropping as it is seen as violent but permits the non conquest version.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

Lua API: control over non action move side effects. See osdn #41730

The Lua API allows moving a unit without considering what the move rules are via edit.unit_move() and edit.unit_teleport(). This can be used to create custom move actions, teleporting gates on the map etc. Moving via those functions can trigger side effects like embarking, disembarking, city conquest, extra conquest, hut entry and hut frightening. You can now decide what side effects will happen by specifying additional parameters.

Example: Teleport the unit actor to the tile target. Allow embarking, disembarking and hut frightening. Disallow city conquest, extra conquest and hut entry.

Code: Select all

  local survived = actor:teleport(target,
                                  -- allow transport to transport
                                  find.transport_unit(actor.owner,
                                                      actor.utype, target),
                                  true,
                                  -- assume cities and castles considered
                                  -- the ancient hub when they were built
                                  false, false,
                                  -- a unit appearing from the Ancient
                                  -- Transportation Network is scary to see
                                  false, true)
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

Ruleset defined effect types. See osdn #41745

4 effect types that does nothing has been added. You can given them meaning from Lua.

You can use this to give your Lua script access to information only the requirement system would have had access to before by implementing a boolean effect. You can also use this in a more complex way to implement effect where the numeric value matters.

Example: Implement two boolean effects that determines if bases and city at the tile teleported to are captured.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

Lua API: additional effect evaluation functions. See osdn #41746 and osdn #41749

You can now evaluate an effect type against a unit and - optionally - another player for local DiplRel requirements using the new function effects.unit_bonus(unit, other_player). You can evaluate an effect type against a unit and a tile using the new function effects.unit_vs_tile_bonus().

You can use this to implement your own effect types with ruleset defined effect types or to check the value of a hard coded effect that the Freeciv C code evaluates against the same items.

Example: Implement two boolean effects, one using effects.unit_bonus() and the other effects.unit_vs_tile_bonus(), that determines if bases and cities at the tile teleported to are captured.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 3.1 ruleset can do

Post by sveinung »

New action "Unit Make Homeless". See osdn #41622

You can now allow making a unit that has a home city stop having a home city, say depending on a certain wonder.

You can already strip abilities from homeless units (or give them new abilities) via action enablers. So a wonder that irreversibly turns a unit into a zombie with fewer abilities but no home city that will have to support him is now possible. The same is a wonder that makes units - once they get to it - able to live of the land or - for that matter - to live of donations.
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a 3.1 ruleset can do

Post by cazfi »

Add ruleset control of unlimited airlift without capacity Feature #874937

Ruleset can decide whether setting server setting airliftingstyle to "unlimited" for departing or arrival cities means that just airlift capacity is considered unlimited, or that airlift does not even need to be enabled for the city.
Post Reply