Page 5 of 12

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 9:43 pm
by Alien Valkyrie
Corbeau wrote: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.
Think about it. The Upgrade_Unit effect dictates how many units the player gets upgraded per turn. If it was evaluated at a city range, then in the classic ruleset, Leonardo's Workshop would give you one free upgrade per turn per city.
And I don't know that Terrain requirements work for Veteran_Build. I just assumed that, since it's evaluated at a city range (evident from the way Barracks work). If you haven't tested it yet, I wouldn't take it for granted.
The way I see it, there's enough information in README.effects that if you already know those things, you'll feel like it's obvious, but if you don't know yet, it can be quite a riddle. So if you're ever not sure, and thinking about it for a moment doesn't make it clear, just test it. There are a lot of interesting things to discover.

Re: Corbeau's ruleset (2.5)

Posted: Wed Sep 06, 2017 11:12 pm
by JTN
Corbeau wrote:Considering renaming "Library" to "Schoolhouse" but then a lot of stuff should be tracked down and changed and I'm kind of too lazy for that.
You can of course, if you're lazy, leave 'rule_name' as "Library" and set 'name' to "Schoolhouse"; that way, all the references to "Library" in effects etc don't need changing (and also old savegames will work, if you care).
Corbeau wrote: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"
    }
Yes, that sort of thing works; civ2civ3 does this sort of thing (e.g.). (As Caedo says, your "CityTile" range needs to be "Local", not "Player".)
Caedo wrote:"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.
A City-ranged requirement for an effect like Upgrade_Unit (which is never evaluated in the context of a specific city) is quietly never met, I think.
(It ought to be possible to catch these at ruleset load time, but we don't, I'm afraid. We do have a lot of ruleset sanity-checking, but not effects-against-requirement-ranges sanity checking.)
Caedo wrote:And I don't know that Terrain requirements work for Veteran_Build. I just assumed that, since it's evaluated at a city range (evident from the way Barracks work). If you haven't tested it yet, I wouldn't take it for granted.
Looking at the code, I think it will work (but haven't tested it). Things taken into account for this particular effect are player (city owner), city, tile city is on, and unit type. (code 1, 2).

Re: Corbeau's ruleset (2.5)

Posted: Thu Sep 07, 2017 6:48 am
by Corbeau
Ok. Thanks, guys :)

Re: Corbeau's ruleset (2.5)

Posted: Sun Oct 22, 2017 6:09 pm
by Corbeau
Right now I'm trying to implement one of the things I mentioned above: base veteran "bonus" is -25% and all governments except Democracy and Republic give additional veteran status to all units.

My question: what do I have to put here in order to have ALL units gain veteran status? I would like to avoid (PLEASE) havign to list EVERY class for every government that modifies it.

Code: Select all

[effect_veteran_monarchy]
type    = "Veteran_Build"
value	= 2
reqs	=
    { "type", "name", "range"
      "Gov", "Monarchy", "Player"
      "UnitClass   (???)", "(????)", "Local"
Also, does this "value = 2" work for giving two veteran levels?

Re: Corbeau's ruleset (2.5)

Posted: Sun Oct 22, 2017 7:41 pm
by cazfi
Corbeau wrote:My question: what do I have to put here in order to have ALL units gain veteran status?
Simple. Don't require any specific unit class at all, i.e., leave such an requirement out.

README.effects:
Veteran_Build
Increases the veteran class of newly created units of this type. The
total amount determines the veteran class (clipped at the maximum for the
unit).

Re: Corbeau's ruleset (2.5)

Posted: Sun Oct 22, 2017 8:59 pm
by Corbeau
*headdesk*

Thank you.

Re: Corbeau's ruleset (2.5)

Posted: Mon Dec 04, 2017 12:52 am
by Corbeau
When starting the ruleset, I get a (sort of) error:

Invalid veteran definition 'veteran_system.veteran_power_fact[0]'!
Invalid veteran definition 'veteran_system.veteran_power_fact[1]'!


However, the game starts fine. But I'd like to be sure that things are working as intended. And the intention is that the first two veteran levels actually give units a decreased power. Can anyone tell me where exactly is the code for this? Is it actually possible to have a negative veteran "bonus" (value smaller than 100)?

Re: Corbeau's ruleset (2.5)

Posted: Mon Dec 04, 2017 6:01 pm
by Alien Valkyrie
Apparently there's a couple of "sanity checks", ensuring (among others that are genuinely necessary) the following things:
  • The initial level's power factor has to be exactly 100%
  • One veteran level's power factor must not be smaller than the previous one's
So apparently it's not possible to have a negative veteran level. But then again, is there a specific reason you don't just lower the units' base power?

EDIT: Also, the code for this specific stuff is here. The sanity checks are below the line where they're defined.

Re: Corbeau's ruleset (2.5)

Posted: Mon Dec 04, 2017 6:29 pm
by Corbeau
Caedo wrote:But then again, is there a specific reason you don't just lower the units' base power?
Yeah, the only reason would be "clean accounting", but I guess this will do. And I was thinking about adjusting firepower, but I'll think about it a bit more, it may be a can of worms. Thanks.

Re: Corbeau's ruleset (2.5)

Posted: Mon Dec 04, 2017 6:40 pm
by Corbeau
One more thing. I tried to implement the Provisional Government city improvement. It would make a change of governemnt immediate, but the improvement would cost, say, 100 shields and have upkeep 20 gold per turn. The effect would be that you build it, change government and then sell it because it costs so much, rebuild it later if the need occurs and, basically, allowing you to pay in material (shields or money) for a peaceful transition if you wish to do so. An idea I picked up from another game.

However, it seems the "No_Anarchy" effect can't be tied to a regular city improvement, only to a Wonder (either small or big). So I've given up on the idea for now. if anyone has any suggestions, feel free to share.