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?
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.
Code:
Name := Star Shield
Description := Generator that creates an energy field around a starship preventing damage that gets stronger the more stars there are in the star system
Picture Number := 52
Maximum Level := 20
Tonnage Space Taken Formula := 25 - trunc( ( [%Level%] - 1 ) * 0.7 )
Tonnage Structure Formula := 25 + trunc( ( [%Level%] - 1 ) * 0.75 )
Cost Minerals Formula := 200 + ( ( [%Level%] - 1 ) * 10 )
Cost Organics Formula := 100 + ( ( [%Level%] - 1 ) * 5 )
Cost Radioactives Formula := 160 + ( ( [%Level%] - 1 ) * 8 )
Supply Amount Used Formula := 0
Ordnance Amount Used Formula := 0
Can Be Placed On Vehicle Types := Ship, Base, Satellite, Weapon Platform, Drone
Can Be Placed In Ship Sections := Inner Hull, Outer Hull
Component Type List := Technological
General Group := Shields
Custom Group := 0
Number Of Requirements := 2
Requirements Evaluation Availability := AND
Requirements Evaluation Allows Placement := TRUE
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have at least tech level 1 in Shields.
Requirement 1 Formula := Get_Empire_Tech_Level("Shields") >= ( 1 + ( [%Level%] - 1) )
Requirement 2 Description := Empire must have at least tech level 1 in Stellar Manipulation.
Requirement 2 Formula := Get_Empire_Tech_Level("Stellar Manipulation") >= ( 1 + ( [%Level%] - 1) )
Number Of Abilities := 1
Ability 1 Type := Shield Generation
Ability 1 Description := Shield Generators provide [%Amount2%] normal shield points.
Ability 1 Scope := Space Object
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := "Normal Shields"
Ability 1 Amount 2 Formula := 100 + ( ( [%Level%] - 1 ) * 10 ) + ( ( 50 + ( ( [%Level%] - 1 ) * 10 ) ) * [%NumberOfStars%] )
Weapon Type := None