|
|
|
|
|
December 7th, 2006, 02:47 AM
|
|
Private
|
|
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Component.txt Knowledge Base
Update: I found the problem with my original formula, I'm an idiot as usual, and missplaced a (.
So I have runs some tests, and all 4 of the methods discussed work as they should.
Method 1. using 40 - ( Int(([%Level%] - 1) / 7) * 10)
Method 2. using 40 - ( Trunc(([%Level%] - 1) / 7) * 10)
Method 3. using 40 - ( Round(([%Level%] - 1) / 7) * 10)
Method 4. using 40 - iif([%Level%] >= 19, 30, iif([%Level%] >= 15, 20, iif([%Level%] >= 8, 10, 0)))
Each method gives slightly different results as expected, except that Trunc and Int seem to be the same.
Hopefully this will be usefull to everyone.
__________________
It's not what you know...
It's not who you know...
It's what you know about who you know.
|
December 7th, 2006, 03:03 AM
|
|
Brigadier General
|
|
Join Date: Nov 2001
Location: WA
Posts: 1,894
Thanks: 5
Thanked 3 Times in 3 Posts
|
|
Re: Component.txt Knowledge Base
Excellent contribution; thank you DeadMilkMan!
__________________
President Elect Shang; Tal-Re Republic of Free Worlds
Welcome to Super Vegeta’s Big Bang Attack… Welcome to OBLIVION!
“Don Panoz made an awesome car and… an incinerator” Bill Auberlen
|
December 21st, 2006, 02:51 PM
|
|
National Security Advisor
|
|
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
|
|
Re: Component.txt Knowledge Base
I know a lot of modders are interested in Space Yard Expansions. Once possible way to achieve that in SE:V is to use the "Space Yard Rate Modifier" ability on your expansion facility. Perhaps someone can test that and see if it works - I think it just might.
|
December 21st, 2006, 04:24 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: Component.txt Knowledge Base
The next patch might have a very easy, clean way to do SYEs...
|
September 4th, 2007, 11:57 PM
|
Sergeant
|
|
Join Date: Feb 2001
Location: Belmont, CA USA
Posts: 285
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Component.txt Knowledge Base
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
|
September 5th, 2007, 12:57 AM
|
|
National Security Advisor
|
|
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
|
|
Re: Component.txt Knowledge Base
Check pg 52 of the modding pdf file - it has a short list of string substitutes that can be used in the data files.
|
September 5th, 2007, 01:48 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
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).
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|