Lua: Research information API
First question: Does lua API already know if the there's an embassy within the team? Otherwise the script can't tell if zero returned by some of these methods is a "real" zero, or just lack of embassy.
Reply To cazfi
First question: Does lua API already know if the there's an embassy within the team? Otherwise the script can't tell if zero returned by some of these methods is a "real" zero, or just lack of embassy
That matter is requested in #44772 and might be resolved in #44779, neither is yet resolved. But you can check if plr:researching()==false that happens if you don't know what they are researching that happens when you don't have embassy.
About TECH_COST_CIV1CIV2 "/* Avoid getting error messages and return at least something */" : Does the value returned make any sense in any use-case, or is it just a nonsense number which the script cannot tell to be nonsense? Could we just return a negative value to indicate an error? (or can negative value be valid return?)
Maybe clarify "needs at least an embassy" -comments about the cases (all of these?) where the embassy is required from the team, and not necessarily from the player themself.
api_methods_player_tech_bulbs() outside multiresearch could still work logically with no much implementation effort -> current bulbs count for current research target, zero for any other.
Reply To ihnatus
But you can check if plr:researching()==false that happens if you don't know what they are researching that happens when you don't have embassy.
Appears that you can't. A_UNSET is sent to clients insto A_UNKNOWN when no embassy info is provided. Maybe it's a bug since comments in research.h tell another.
Reply To cazfi
About TECH_COST_CIV1CIV2 "/* Avoid getting error messages and return at least something */" : Does the value returned make any sense in any use-case, or is it just a nonsense number which the script cannot tell to be nonsense? Could we just return a negative value to indicate an error? (or can negative value be valid return?)
There are methods to detect the unclear case if it's needed, I don't think we should elaborate here too much over basic functions, at least in this patch.
Maybe clarify "needs at least an embassy" -comments about the cases (all of these?) where the embassy is required from the team, and not necessarily from the player themself.
Made comments, in my view, more clear. The embassy checking should be resolved elsewhere.
api_methods_player_tech_bulbs() outside multiresearch could still work logically with no much implementation effort -> current bulbs count for current research target, zero for any other.
Modified api_methods_player_tech_bulbs() to do sensible thing out of multiresearch:
Thanks. I'll try to get this handled in a timely manner (try = some things interfere, this has not been a good week)
I'd appreciate if you can take care of the wiki update part (you've been active in updating that lua manual anyway)
Add functionality to test costs and progress of players' research.
This ticket is a natural base of #44936 and is related to #42683.
In the patch attached I have introduced an API to game.info object with research-related ruleset data, maybe more fields should be made available in it in further tickets.