Reading RulesParams from AI
Moderator: Moderators
Reading RulesParams from AI
I recently updated the zk ai I've been working on to the latest dev engine (101.0.1-414-g6a6a528) and found that there were some changes to the way unit/gamerulesparams are handled by the ai interface. While I think the new system is definitely cleaner than the old one there is no longer any way to read out the full list of rules params anymore which makes development more difficult/impossible. You need to know the exact name of the rulesparam you're looking for before you can get its value, and rules params are badly documented and scattered all over the place in lua so reading them out directly is generally better than trying to reverse engineer from the game source.
Re: Reading RulesParams from AI
Can you give a concrete example of a place where a full list is needed?
Re: Reading RulesParams from AI
Take mexes for example. In zk they have at least two different rules params regarding how much metal they produce: mexIncome and current_metalIncome (I think they were called). The first describes only base income and the second includes overdrive. I ended up using those values as eco measures because it's more reliable for separating the influence of reclaim and overdrive, but without being able to print out all the rulesparams for mexes I wouldn't have been able to find that out. Unarmed status for bombers was similar. There might be other useful things but because of the changes I can't test anything.
Re: Reading RulesParams from AI
That's an example of using a "print all params" as an offline development aid, which is already available in lua (you can widget this easily, no need to compile etc.)
the AI interface is there for online use, do you have a concrete example for that?
the AI interface is there for online use, do you have a concrete example for that?