- It is not possible to reach an instance of the InfluenceQueue. Recommendation -> remove it. Influence purchases are applied in one turn. I don't see any use-case for AI.
- I played for 6 tuns: all this outputs are 0.0. Is it a bug?
Code: Select all
empire.resourceProduction(fo.resourceType.influence) empire.resourceProduction(fo.resourceType.influence) empire.resourceProduction(fo.resourceType.influence)
- I don't know how to get policy info (cost and cost per turn). I could hardcode this, since I will need hardcode policies effects.
Influence and policies API overview
Moderator: Committer
Influence and policies API overview
I am inspecting what API could be used for working with influence and policies from Python.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Influence and policies API overview
Can do.
IS this any different for other resource types? Either way, I think you need to do call universe.updateMeterEstimates() first, for thost values to be meaningful.I played for 6 tuns: all this outputs are 0.0. Is it a bug?Code: Select all
empire.resourceProduction(fo.resourceType.influence) empire.resourceProduction(fo.resourceType.influence) empire.resourceProduction(fo.resourceType.influence)
some_policy.adoptionCost(empire_id) should work. There is usually a cost to adopt apolicy, but there is no fixed cost per turn to keep it adopted. Policies can have effects that modify planets' influence output, but you'd have to adopt one and do a meter update and add up all the new empire target influence meters (and every other meter that might be affected) to know what the medium-term result of adopting is on influence output. It can also be a net positive to adopt a policy...I don't know how to get policy info (cost and cost per turn). I could hardcode this, since I will need hardcode policies effects.
Re: Influence and policies API overview
Cool.
Just moved my test after that block and it works.I think you need to do call universe.updateMeterEstimates() first, for thost values to be meaningful.
Missed this class.some_policy.adoptionCost(empire_id) should work.
Thank you.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0