JTN wrote:GriffonSpade wrote:I'm not sure how much our current flag system is good for this, though. Do we have nation flags that can be used for effects or requirements or something? (Code flags I mean, not, you know, flag sprites)
Starting with 2.6, rulesets will be able to test the "nation group" ([ngroup_medieval] etc in nations.ruleset) in effects with the NationGroup requirement, and nation groups can be defined as 'hidden' so they don't show up in the nation selection UI; thus nation groups can behave like unit type flags, etc. See "ngroup_barbarian" for an example.
That will let you do ongoing bonuses this way, but there's no such shortcut to granting initial techs/units/etc; that's baked into individual nation definitions.
(I don't think it will ever be practical for the standard nation set to get different behaviour for different nations. The most we could do would be to add such groups for custom rulesets to hook into, if any sufficiently useful and uncontroversial properties of the >500 shipping nations can be found.)
Edit: Though, thinking about it, using the nation groups for this probably isn't necessary. In hindsight, nation group-based flags probably wouldn't be very useful for units, the only place it would be different from just using the extant nationgroup property. The nation style would be far more important, as far as units are concerned. I've editted the post to not use nation groups in it.
Actually, I'm kinda curious, are units getting the same requirement format as the other files in 3.0? Seems a mite odd that it's different from buildings and governments. It would certainly mitigate a lot (though certainly not all for ruleset modders) of the need if unit requirements become more flexible.
Hmm, the primary purpose of nation group is to group nation selection, so you can't really modify that without mucking up its intended purpose. Likewise, one can't add to nation style at all without breaking it.
What about a "nation flags" property (code flags, need a better name for distinction, nflag for short?) that would be used for this purpose? Default would just be practically identical to nation style, but ruleset modders could alter it without being limited to the nation style. This property could then be used as a requirement for effects, buildings, governments, and especially units. For default rulesets, there would be no truly new information, since all 500+ nations already belong to the parallel groupings for nation style.
So say Abkhaz might have an entry that looks like this:
Because these would be used for nothing BUT code flags, in nationlist.ruleset, the flag entries could look more like terrain or unit flags:
Code: Select all
[control]
; Names for custom terrain flags. There can be up to ## of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
; helptxt = displayed in the help for nations with this flag (optional)
flags =
{ "name", "helptxt"
_("European")
_("Classical"), _("This nation is Classical style.")
_("Tropical")
_("Asian")
_("Babylonian")
_("Celtic")
}
These would need to be appended to the top of individual nation help information, but only if helptxt isn't blank, in the same way as units. (So only Classical would get displayed there)
There are 6 nation styles, so ## would need to be at least 8 for this. 32 would probably be optimal.
units, buildings, and governments would have entries like this:
(unit help)
Code: Select all
; nflag_req = required nation flag, names from nationlist.ruleset
(unit entry)
(governments/buildings/effects entry)
Code: Select all
reqs = { "type", "name", "range"
"nflag", "Classical", "Player"
}