Page 3 of 15

Re: Changes in what a rule set can do

Posted: Thu Sep 19, 2013 1:26 pm
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.

Re: Changes in what a rule set can do

Posted: Thu Sep 19, 2013 1:44 pm
by Arbogast
amen! :mrgreen:

Re: Changes in what a rule set can do

Posted: Fri Sep 20, 2013 11:35 am
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
    }

Re: Changes in what a rule set can do

Posted: Mon Sep 23, 2013 10:04 am
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.

Re: Changes in what a rule set can do

Posted: Mon Sep 23, 2013 7:04 pm
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

Re: Changes in what a rule set can do

Posted: Mon Sep 23, 2013 8:03 pm
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.

Re: Changes in what a rule set can do

Posted: Tue Sep 24, 2013 10:38 am
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.

Re: Changes in what a rule set can do

Posted: Tue Sep 24, 2013 11:59 pm
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
    }

Re: Changes in what a rule set can do

Posted: Wed Sep 25, 2013 11:17 pm
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)

Re: Changes in what a rule set can do

Posted: Thu Sep 26, 2013 4:43 pm
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.