View Single Post
  #47  
Old September 5th, 2007, 01:48 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default 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).
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote