Follow-up Comment #2, patch #4405 (project freeciv): > Don't know if it matters, but remember that it's not > necessarily exactly "new tech made one new road generally > possible". Indeed, it's not necessarily a tech that triggers it any more (although I think that's all we'll handle at the moment?) Would probably need to iterate over each road/base type and then cities inside that.
> Even classic ruleset has Bridge Building technology that > doesn't allow new road types, but one to build existing roads > on river tiles. Playing on trunk, I had noticed getting one of these messages when I learned Bridge Building, and wondered why. I had not noticed that we'd got rid of free city bridges in the classic ruleset by not having AlwaysOnCityCenter, although now I see it was discussed extensively in patch #3522 and patch #3826. We should remember to put that in NEWS. In fact this is an example of where a ruleset custom message would be really useful -- I can't see it being practical to have the core game engine come up with a sensible description of this. I'm now thinking a signal like: bool city_infrastructure_upgraded(extra, reason, cause) * "extra" somehow describes which base/road has been enabled. Could be just a string, or we could add bases/roads/extras as first-class Lua types and pass one of those. * "reason" textually describes what triggered the upgrade: ** Techs: similar set to tech_researched, but qualified by "tech_": "tech_researched", "tech_traded", "tech_stolen", "tech_hut" -- allows "discovery" to be distinguished ** Others: another plausible place we should be calling upgrade_all_city_extras() is on building wonders, to enable a wonder/building tech. (Should this even be limited to the current player? -- this is a new ticket, anyway) We'd have "building_*" (or just "building") reason for that. * "cause" is the specific tech, building, etc that triggered the upgrade (this can be a first class Lua type). So for the classic ruleset our signal handler would go something like: * Is reason "tech_*" with cause "Bridge Building": print a new message "Discovery of Bridge Building leads workers to build bridges in all your river cities". * Else, if reason is "tech_*", print the traditional "new hope" or "the people are pleased" message, either switching on tech/extra names or just using a default fallback in default.lua which mentions extra names. * Else: shouldn't happen (no wonders cause upgrades in default rulesets), so do nothing. (Maybe default.lua does have words for this, however.) _______________________________________________________ Reply to this item at: <http://gna.org/patch/?4405> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev