Access to the "formula" calculator for infinite technologies

Things that already exist in the current mod API
totobest
Inserter
Inserter
Posts: 27
Joined: Mon Dec 26, 2016 12:46 am
Contact:

Access to the "formula" calculator for infinite technologies

Post by totobest »

I am writing a mod that calculates the cost of technologies for the Black Market. It uses the count and the ingredients.
For infinite technologies, there is no "count" properties but a "formula" property which allows to get the "count" based on the current level of the technology.

I managed to write a Lua code that evaluate the expression. Though it might not cover all the cases.
Thus I would like to have access the internal formula parser/calculator (as stated here https://www.factorio.com/blog/post/fff-161) from Lua.

Maybe something like :

Code: Select all

formula = "100(L-6)"
engine.formula_calc(formula, 3) -- not 'game.' as it would be nice to use it in the data stage as well.
Post Reply

Return to “Already exists”