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: 3105
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a rule set can do

Post by cazfi »

Caedo wrote:I think there should be action enablers for move and attack, so that we can make turrets: A normal unit that can't fight, but can be transformed into a turret at the target location. The turrent can attack, but not move. Would be nice if something like that would be possible.
This is possible with "Convert unit" action (the feature was originally introduced for this very use-case). Have two units: "Cannon building crew" and "Huge Cannon", latter with 0 movement, and as "convert_to" target for the former (whether you want that to work the other direction too is matter of taste).

In freeciv-2.4 and earlier unit conversion is immediate action (if you have transformer unit with two forms, it can switch between forms as many times as it wants during the turn), but in freeciv-2.5 conversion is like other unit actions, taking some movement points and always happening during turn change, not during the turn.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

It used to be impossible to bribe a unit in a city. This has changed. (patch #4217) Note that it currently only is possible to see (and therefore target) a unit in a city if you are allied to its owner. This makes this change quite limited.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Changes in what a rule set can do

Post by Alien Valkyrie »

cazfi wrote:
Caedo wrote:I think there should be action enablers for move and attack, so that we can make turrets: A normal unit that can't fight, but can be transformed into a turret at the target location. The turrent can attack, but not move. Would be nice if something like that would be possible.
This is possible with "Convert unit" action (the feature was originally introduced for this very use-case). Have two units: "Cannon building crew" and "Huge Cannon", latter with 0 movement, and as "convert_to" target for the former (whether you want that to work the other direction too is matter of taste).

In freeciv-2.4 and earlier unit conversion is immediate action (if you have transformer unit with two forms, it can switch between forms as many times as it wants during the turn), but in freeciv-2.5 conversion is like other unit actions, taking some movement points and always happening during turn change, not during the turn.
Yeah, I had that idea too, but I never tested it because I thought movement 0 also means that the unit can't attack, and that would turn our beatiful turret into a wall. Although, that would be a nice idea too. I might do just that now.
~ AVL
User avatar
HanduMan
Posts: 44
Joined: Sat Feb 02, 2013 9:14 am

Re: Changes in what a rule set can do

Post by HanduMan »

Caedo wrote:Yeah, I had that idea too, but I never tested it because I thought movement 0 also means that the unit can't attack, and that would turn our beatiful turret into a wall. Although, that would be a nice idea too. I might do just that now.
If it turns out that movement 0 makes attacking impossible, you might want to try something like this.
  1. Define a third unit, let's call it "ammo"
  2. Make "ammo" a missile unit with 1 fuel
  3. Make "turret" a carrier for "ammo"

Get the picture? :P

Hmm.. We would also need another carrier for reloading the turret. Is there a way to restrict "ammo" launching only from "turret"?

Just a thought...
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

Requriement vectors can now use the new requirement type MaxUnitsOnTile. (patch #4224) It is defined for the ranges local, cadjecent and adjecent. If no more than the specified number of units are present on the tile it is true. This means that if you negate it ("present" = FALSE) it will be true if more than the specified number of units is present on a tile. For the range local you can combine this to specify a range like more than one but no more than five.

An example that requires that exactly one unit is present at a tile.

Code: Select all

reqs	=
    { "type", "name", "range", "present"
      "MaxUnitsOnTile", "1", "Local", TRUE
      "MaxUnitsOnTile", "0", "Local", FALSE
    }
cazfi
Elite
Posts: 3105
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a rule set can do

Post by cazfi »

There's new requirement range Alliance. It works for all the requirement types that Player range does. This allows for example wonders of which all the allies of the owner benefit.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Changes in what a rule set can do

Post by Alien Valkyrie »

cazfi wrote:There's new requirement range Alliance. It works for all the requirement types that Player range does. This allows for example wonders of which all the allies of the owner benefit.
Finally! Does the AI already take it into consideration?
~ AVL
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

While adding an extra specialist kind in the ruleset is possible it isn't easy. One problem was that the client would crash when the rule set was loaded since the tile set didn't have graphics for the new specialist kind. A custom tile set was therefore required. This has changed.

Patch 4239 to 2.6 makes it possible to set an alternative in the graphic_alt field of the specialist definition in cities.ruleset. If the tile set don't support the specialist you added it will use that in stead. The alternative is a regular graphics tag. This allows you to avoid confusing your players by using an icon not already in use by one of the other specialist kinds. The alternative graphic is only used when the tile set don't support your specialist so those that has a supported tile set won't lose the specialist graphic specific features if you add the alternative for those that don't.

Example:

Code: Select all

[specialist_farmer]
name            = _("Farmers")
rule_name       = "farmer"
short_name      = _("?Farmer:F")
graphic_alt     = "s.warming_sun_7"
reqs            =
    { "type", "name", "range"
      "Building", "Algae Tank Factory", "City"
    }
helptext        = _("\
Produce 4 food pr turn.\
")
bard
Veteran
Posts: 121
Joined: Fri Jun 14, 2013 2:00 pm

Re: Changes in what a rule set can do

Post by bard »

Thank you for the info in this topic.

One question about the new requirement MaxUnitsOnTile. Does it takes into account enemy units?
I can't compile v2.6 right now, and I'm curious to know if it will be possible to create a rule that gives a bonus to defense to a unit if there are friendly units adjacent.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

bard wrote:One question about the new requirement MaxUnitsOnTile. Does it takes into account enemy units?
Yes. Sorry.
Post Reply