Custom formulas with parameters? |

I know you can put formulas in Formulas.txt, but those seem to be only formulas which take no parameters... Is it possible to put custom formulas anywhere that DO take parameters, such that I could define a formula
miniaturize(amount) := [%amount%] * (1 - 0.05 * ([%Level%] - 1))
for instance, that I could call as follows:
Tonnage Space Taken := miniaturize(100)
and the component would take up 100 spaces at level 1, 95 spaces at level 2, 90 spaces at level 3, reducing by 5 for each level, but then I could do
Cost Minerals := miniaturize(5000)
and it would cost 5000 minerals at level 1, 4750 at level 2, 4500 at level 3, etc.?
Re: Custom formulas with parameters?
I'm pretty sure that this isn't possible. There is a formula list text file, but only certain files seem to take inputs from that.
Your best bet is to go down the component list and add, "* (1 - 0.05 * ([%Level%] - 1))" to the end of every Tonnage Space Taken line (and probably tonnage structure, too!)
Re: Custom formulas with parameters?
Your best bet is to go down the component list and add, "* (1 - 0.05 * ([%Level%] - 1))" to the end of every Tonnage Space Taken line (and probably tonnage structure, too!)
Tonnage structure is what you want to increase as it is what is taking damage. The other tonnage is used to know how much you can fit on the design... Also take note that making stuff too light may create the problem that you have more space than you can fill due to all the slots being filled with low tonnage items. This is what happen in my mod when the larger ships reach high tonnage capacity...




Hmmm...
An interesting question you pose...
I know you can do this with the AI scripting (it's nessesary, actually).
I am uncertain whether the Data files allow for this...
It would depend on how and when the program calls the files. This is definatly worth of experimentation.