Re: Component.txt Knowledge Base
Devnullicus said:
Does anyone know why this doesn't work? Specifically, it always gives shield points as if there were 0 stars in the system. [%NumberOfStars%] is used in Formulas.txt, so it should be usable in other places as well, correct?
I suspect that pretty much every data field has its own parser... or at least there are several parsers for different "types" of data fields, perhaps related to file. There is very little crossover in having functions and built-in variables that work in one place translate successfully to another. For example, only a system has any stars, so only files dealing with systems or stellar object properties would ever even need to consider having access to the [%NumberOfStars%] variable... or so Aaron's thinking seems to go.
Edit: I even tried putting the formula in formulas.txt and then using the name in components.txt and it still acts as if there are 0 stars. *sigh*. I really wish there were easy ways to add variables like this to formulae.
You cannot use formulas in Formulas.txt in any fields in the data files where they are not already used (pretty much just planet temperature/radiation/gravity field). There is absolutely no support for user-defined functions in the data files (only the AI/event/intel scripts).
|