Page 4 of 12

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 9:42 am
by Corbeau
BTW, would it be possible to assign veteran levels based on the type of terrain the city producing the unit is placed on? :)

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 11:33 am
by Corbeau
Implemented

veteran_power_fact = 75, 90, 100, 110, 120, 140, 150, 160, 170, 180, 200, 210, 220, 230, 240, 260, 280

Republic and Fundamentalism give 1 Veteran bonus. Democracy gives 0. All others give 2.


QUESTION: Is there a way for a Wonder to give +1 shield to each city? Something like this:

Code: Select all

[effect_5yrPlan]
type    = "Output_Add_Tile"
value   = 1
reqs    =
    { "type", "name", "range"
      "Building", "Five Year Plan", "Player"
      "CityTile", "Center", "Player"
      "OutputType", "Shield", "Local"
    }

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 1:08 pm
by Alien Valkyrie
Corbeau wrote:BTW, would it be possible to assign veteran levels based on the type of terrain the city producing the unit is placed on? :)
I haven't tested this, but I don't see why Veteran_Build shouldn't be able to use Terrain_Type requirements at Local range.
Corbeau wrote:QUESTION: Is there a way for a Wonder to give +1 shield to each city? Something like this:

Code: Select all

[effect_5yrPlan]
type    = "Output_Add_Tile"
value   = 1
reqs    =
    { "type", "name", "range"
      "Building", "Five Year Plan", "Player"
      "CityTile", "Center", "Player"
      "OutputType", "Shield", "Local"
    }
It would have to be "CityTile", "Center", "Local", but yeah, that should work.

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 1:34 pm
by Corbeau
Caedo wrote:
Corbeau wrote:BTW, would it be possible to assign veteran levels based on the type of terrain the city producing the unit is placed on? :)
I haven't tested this, but I don't see why Veteran_Build shouldn't be able to use Terrain_Type requirements at Local range.
Oh, thanks. Didn't really think it would be possible! So, more possibilities to make a mess open up!

I'm trying to figure out the combination, but I can't make sense of the requirement syntax. Would it be something like

"Terrain_Type", "Mountain", "Local"

?

Is there a comprehensive tutorial/manual about requirement syntax? I'm trying to figure it out, but I guess things are complicated because different effects interpret requirement fields in a different way, according to their particular need, correct?

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 7:14 pm
by Alien Valkyrie
Corbeau wrote:I'm trying to figure out the combination, but I can't make sense of the requirement syntax. Would it be something like

"Terrain_Type", "Mountain", "Local"

?

Is there a comprehensive tutorial/manual about requirement syntax? I'm trying to figure it out, but I guess things are complicated because different effects interpret requirement fields in a different way, according to their particular need, correct?
I've checked, the requirement type is just "Terrain", without a "_Type". As noted in some of the comments of the supplied rulesets' files, everything relevant about effect requirement vectors can be found in /doc/README.effects, in your Freeciv install directory.

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 7:55 pm
by Corbeau
Ok, I've been finding those files scattered around the internet and it's not really well documented. For example, now that you told me that this particular thing is doable with this effect, I can roughly understand why, but if you asked me to do something different, I'm not sure I'd be able to figure out which combination of fields to use.

For example, it's perfectly clear what ranges like "Player" and "Continent" mean. But what is "Local"? And why doesn't "Give veteran bonus to a unit created in a city on a mountain" ask for the "City" range instead of "Local"?

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 8:16 pm
by Alien Valkyrie
Corbeau wrote:For example, it's perfectly clear what ranges like "Player" and "Continent" mean. But what is "Local"? And why doesn't "Give veteran bonus to a unit created in a city on a mountain" ask for the "City" range instead of "Local"?
Yeah, I admit that the "Local" range is a bit confusing. It's basically everything where an OOP-developer would write "this" (or "self" if we're working with Python), and then some. For example, basic information on the current tile is part of the "Local" range. I mean, it's obviously not part of the "City" range (since e.g. terrain type exists outside of cities), but there's no dedicated "Tile" range.

That reminds me, I've been wanting to suggest that for a while, since, for example, different unit types on the current tile aren't encoded in the "Local" range (or anywhere, for that matter), so you can't make a medic unit that gives other units on its tile a regeneration bonus, or some inspiring war leader giving attack and defense bonus etc. I've raised hrm #695469 about this.

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 8:40 pm
by Corbeau
Ok, translating "Local" as "this" (or "here"?) makes sense.

Some more questions:

Would it be possible to give additional Defence Bonus in, say, forests and jungles only to some units? Looking at some examples, I'd say the answer is yes.

Also, when I asked about Military Academy that would upgrade one unit in each city it is built in (multiple cities), JTN said "The "Upgrade_Unit" effect is checked at player range." But what if I put range as "Local" (or "City")?

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 9:16 pm
by Alien Valkyrie
Corbeau wrote:Would it be possible to give additional Defence Bonus in, say, forests and jungles only to some units? Looking at some examples, I'd say the answer is yes.
Unfortunately, it's not possible to give the additional Defend_Bonud to some units, only against some units. The UnitType, UnitFlag etc. requirement types (which are only available at "Local" range) are evaluated against the attacking unit, not the defending unit. Otherwise, City Walls would give a defense bonus to land units (but not sea units) within the city, instead of defending against land units from outside the city.
Corbeau wrote:Also, when I asked about Military Academy that would upgrade one unit in each city it is built in (multiple cities), JTN said "The "Upgrade_Unit" effect is checked at player range." But what if I put range as "Local" (or "City")?
"Upgrade_Unit" is an effect type, not a requirement type. That it's "checked at player range" means that for the requirements, only the range "Player" and bigger ones (e.g. "Allied", "Team" and "World") are valid. I'm not sure if requirements at other ranges are simply ignored, always evaluate to FALSE or cause an error while loading, but either way, they don't work.

In general, you'll be able to find most of what you're looking for in README.effects – not all of it, some of it is trial and error (or asking other people), but most stuff is documented there (or can be figured out from what's there by thinking about it exactly).

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 9:32 pm
by Corbeau
Actually, the README.effects that I have contains a list of effects and a very rough description of what they do, but not *how* they do it. For example, if you guys hadn't told me, there is no way in hell that I'd be able to figure out myself that "Terrain", "Mountain", "Local" also works for creating veteran units or that you can't have multiple automatic upgrading improvements.