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

Re: Changes in what a rule set can do

Post by cazfi »

Try to remember that (AFAIK) your audience here are potential modders, not freeciv developers. Try to explain, in as easy terms as possible, what these changes enable for them, and not so much the change in technical terms - though one should be allowed to expect modpack authors to be familiar with terminology in modding interface (once you have explained new terms once) and those are usually needed to describe things in their full scope and not just the most obvious example of the use of the new feature.
User avatar
Arbogast
Elite
Posts: 412
Joined: Tue Jul 16, 2013 9:09 am
Location: France

Re: Changes in what a rule set can do

Post by Arbogast »

amen! :mrgreen:
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

A requirement vector using the DiplRel requirement type can now test if there exist a reason to go to war against another player. "Provided Casus Belli" is true if the player provided a reason to go to war against him. "Has Casus Belli" is true if the player has a reason to go to war against another player. A reason to go to war in this context is stuff that would get your declaration of war past the Senate. An example is that if a Spy incites one of your cities to change to his side you have a Casus Belli against the player that did it.

Example that will allow you to incite one city of the player that did something against you (but not more than one as inciting his city gives HIM a Casus Belli against you):

Code: Select all

[actionenabler_join_the_light_side]
action = "Incite City"
actor_reqs    =
    { "type",   "name", "range", "present"
      "DiplRel", "Has Casus Belli", "Local", TRUE
      "DiplRel", "Provided Casus Belli", "Local", FALSE
    }
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

Make action enablers control the spy action "Establish Embassy". (patch #4204) Note that this don't control other ways you can establish an embassy, like giving one during negotiations. It is still impossible to establish an embassy when you already have a real embassy. Should anyone think of a good reason to make it possible let me know and I'll move the restriction to the rule set.
louis94
Hardened
Posts: 270
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Changes in what a rule set can do

Post by louis94 »

Should anyone think of a good reason to make it possible let me know and I'll move the restriction to the rule set.
Let's say I'm in the following situation:
* For some reason, my spy units cannot enter territory of player A, and A doesn't want to give me an ambassady.
* Player B is attacking A.
So I could do the following:
* Establish an ambassady in city b of player B.
* Wait for A to conquer that city.
If ambassady is bound to city, I could then have an ambassady with player A.

Louis
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a rule set can do

Post by cazfi »

Though diplomat establish embassy by entering single city, that city does not matter at all after that - embassy is with a player, not with a city. Even if player loses all his/her cities, and lives only as a couple of nomad units, embassies still remain.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

Make action enablers control stealing a technology using a Spy/Diplomat. (patch #4207) Note that this don't control other ways you can steal a tech, like invading a city. Two new actions are added: "Steal Tech" and "Targeted Steal Tech". The former will steal a random tech. The later let you choose a tech at the cost of a lover chance of success. If the effect "Not_Tech_Source" is active on the target player no tech will be stolen. An embassy is required to get the list of technologies to choose from.

PS! louis94: Nice suggestion but as cazfi already explained embassies are to a player. Foreign buildings/extras in cities would be required to implement what you suggest. cazfi: Thank you for explaining embassies to louis94.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

The unit flag "Unbribable" has been removed. (patch #4212)

If you used it add it back as a custom unit flag. Add a requirement that the unit flag "Unbribable" shouldn't be present in any target in all action enablers that enables "Bribe Unit". A benefit of doing it this way is that beginners won't be tricked into trying to bribe a unit that an experienced player knows is impossible to bribe.

In units.ruleset, in the section control, after

Code: Select all

flags =
  { "name", "helptxt"
add

Code: Select all

    "Unbribable", _("May not be bribed.")
It don't matter if it is above, below or between other flags.

In game.ruleset, change all "Bribe Unit" action enablers so their target_reqs include the requirement seen in target_reqs of the action enabler below:

Code: Select all

[actionenabler_bribe_unit]
action = "Bribe Unit"
actor_reqs    =
    { "type",   "name", "range", "present"
      "DiplRel", "Alliance", "Local", FALSE
      "DiplRel", "Team", "Local", FALSE
    }
target_reqs    =
    { "type",   "name", "range", "present"
      "UnitFlag", "Unbribable", "Local", FALSE
    }
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a rule set can do

Post by sveinung »

Want to create an ambassador unit that is able to establish embassies but no other spy action? Want to create a terrorist unit that can poison cities and sabotage units but not establish embassies or steal techs? This is now possible.

The spy action "Investigate City" just became ruleset controlled via action enablers. (patch #4209) It was the last spy action not controlled by action enablers. (I'm not counting a regular move here as that isn't specific to spies) You can therefore pick and choose what spy actions an unit with the diplomat flag should be able to do.

As all other action enabler work this only exist in Freeciv trunk (2.6)
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 »

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