There is SetEmpireMeter for set a meter and EmpireMeter for comparing in a query.
As far as I understand the parser and scripting system, there is currently no way to get the value of an empire meter (e.g. for using it in a sitrep).
In which of the parsers would I add this? I looked around awhile am not completely sure where to add it.
Adding FOCS way to get empire meter value
Moderator: Committer
Adding FOCS way to get empire meter value
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!
-
- Programmer
- Posts: 389
- Joined: Sun Feb 14, 2016 12:08 am
Re: Adding FOCS way to get empire meter value
Which value are you looking for, most are in parse/DoubleValueRefParser.cpp
e.g. for supply:
e.g. for supply:
Code: Select all
tag = "rawtext" data = Target.Supply
Re: Adding FOCS way to get empire meter value
I was not looking really looking for a specific value. You can add empire meters using FOCS. I think it would be good to have a scripting access to the current value as well.dbenage-cx wrote:Which value are you looking for, most are in parse/DoubleValueRefParser.cpp
e.g. for supply:Code: Select all
tag = "rawtext" data = Target.Supply
And of course there is also a specific value. The reason is that i added empire meters (e.g. for yield) for the implementation of imperial stockpile. I want to give a sitrep indication about it.
And as long there is no automatic UI and effect accounting for an empire meter this might be the only way for a scripter to communicate values .
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Adding FOCS way to get empire meter value
You'd need to add cases in ComplexVariable<double>::Eval to handle "EmpireDetection", "EmpireProductionStockpileYield", "EmpireProductionStockpileMax", and perhaps others. Then add cases in DoubleComplexValueRefParser.cpp to parse this. Should add cases for all the empire meters in Empire::Init. Any new symbols need to be added to Tokens.h for the parser.
Re: Adding FOCS way to get empire meter value
I addressed the general meter access first and created a pull requestGeoff the Medio wrote:You'd need to add cases in ComplexVariable<double>::Eval to handle "EmpireDetection", "EmpireProductionStockpileYield", "EmpireProductionStockpileMax", and perhaps others. Then add cases in DoubleComplexValueRefParser.cpp to parse this. Should add cases for all the empire meters in Empire::Init. Any new symbols need to be added to Tokens.h for the parser.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!
Re: Adding FOCS way to get empire meter value
The general case is merged.Ophiuchus wrote:I addressed the general meter access first and created a pull requestGeoff the Medio wrote:You'd need to add cases in ComplexVariable<double>::Eval to handle "EmpireDetection", "EmpireProductionStockpileYield", "EmpireProductionStockpileMax", and perhaps others. Then add cases in DoubleComplexValueRefParser.cpp to parse this. Should add cases for all the empire meters in Empire::Init. Any new symbols need to be added to Tokens.h for the parser.
So for those special cases, a question regarding the parser concepts.
Why should those be "complex" compared to not-complex variables?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Adding FOCS way to get empire meter value
An empire meter is not a property of an UniverseObject. Target.Stealth make sense. Target.SomeEmpireShowhowRelatedToTargetOrMaybeNotsDetection doesn't really.Ophiuchus wrote:So for those special cases, a question regarding the parser concepts.
Why should those be "complex" compared to not-complex variables?
Re: Adding FOCS way to get empire meter value
Ok, thanksGeoff the Medio wrote:An empire meter is not a property of an UniverseObject. Target.Stealth make sense. Target.SomeEmpireShowhowRelatedToTargetOrMaybeNotsDetection doesn't really.Ophiuchus wrote:So for those special cases, a question regarding the parser concepts.
Why should those be "complex" compared to not-complex variables?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!