View Single Post
  #2  
Old January 6th, 2005, 06:06 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

Progress report time...
Almost there - just one more bug to fix in the expression evaluator and a few things to add to the templatizer itself! Apparently now when I type in something like 0 * (1 + 2) + 3 I get 0 because the multiplication gets spread across everything, not just the next term (the 1+2). Lots of new features, and yes, I did manage to get the templatizer to use the latest Version of the expression evaluator, and it's MUCH faster now - a data file which used to take several minutes to process now runs in seconds! The new features I wanted to add to the templatizer are to be able to define local functions inside the data files themselves, and to allow more than three tech grid areas (previously the three were hardcoded; now I'm going to define them on the fly! ) So, instead of something like this...

Code:

*BEGIN*

Min LevelA := 1 // primary tech area increases damage
Max LevelA := 12
Min LevelB := 1 // secondary tech area increases range
Max LevelB := 5
Weapon Min Range := 1
Weapon Max Range := [3 + levelb]
Name := Anti - Proton Beam <romana>-<letterb>
Description := Focused energy beam used as a medium range weapon.
Pic Num := 18
Tonnage Space Taken := 30
Tonnage Structure := 30
Cost Minerals := [25 + 25 * levela]
Cost Organics := [100 * (levelb - 1)]
Cost Radioactives := [10 * levela]
Vehicle Type := Ship\Base\Sat\WeapPlat\Drone
Supply Amount Used := 5
Restrictions := None
General Group := Weapons
Family := [2000 + levelb]
Roman Numeral := 1
Custom Group := 0
Number of Tech Req := 2
Tech Area Req 1 := Energy Stream Weapons
Tech Level Req 1 := [levela]
Tech Area Req 2 := Range Enhancement
Tech Level Req 2 := [levelb]
Number of Abilities := 0
Weapon Type := Direct Fire
Weapon Target := Ships\Planets\Ftr\Sat\Drone
Weapon Damage At Rng := [30 + levela * 5 - range * 2]
Weapon Damage Type := Normal
Weapon Reload Rate := 1
Weapon Display Type := Beam
Weapon Display := 1
Weapon Modifier := 0
Weapon Sound := apbeam.wav
Weapon Family := 1

*END*



you could have this:

Code:

*BEGIN*

#TechGrid damagelevel := [1] to [5]
#TechGrid rangelevel := [1] to [5]
#TechGrid minilevel := [1] to [5]
#TechGrid efficlevel := [1] to [5]
Weapon Min Range := 1
Weapon Max Range := [3 + levelb]
Name := Anti - Proton Beam [roman(damagelevel)]-[letter(rangelevel)]-[minilevel]
// nifty switch statement!
Description := Focused energy beam used as a [switch(rangelevel, 1, "point blank", 2, "short", 3, "medium", 4, "long", 5, "siege", "")] range weapon.
Pic Num := 18
#LocalFunction tonnage := [32 - minilevel * 2]
Tonnage Space Taken := [tonnage]
Tonnage Structure := [tonnage] // to save on typing formulas ;-)
Cost Minerals := [25 + 25 * damagelevellevel]
Cost Organics := [100 * (rangelevel - 1)]
Cost Radioactives := [10 * damagelevel]
Vehicle Type := Ship\Base\Sat\WeapPlat\Drone
Supply Amount Used := [6 - efficlevel]
Restrictions := None
General Group := Weapons
Family := [2000 + rangelevel]
Roman Numeral := 1
Custom Group := 0
Number of Tech Req := 4
Tech Area Req 1 := Energy Stream Weapons
Tech Level Req 1 := [damagelevel]
Tech Area Req 2 := Range Enhancement
Tech Level Req 2 := [rangelevel]
Tech Area Req 3 := Miniaturization
Tech Level Req 3 := [minilevel]
Tech Area Req 4 := Supply Efficiency
Tech Level Req 4 := [efficlevel]
Number of Abilities := 0
Weapon Type := Direct Fire
Weapon Target := Ships\Planets\Ftr\Sat\Drone
Weapon Damage At Rng := [30 + damagelevel * 5 - range * 2]
Weapon Damage Type := Normal
Weapon Reload Rate := 1
Weapon Display Type := Beam
Weapon Display := 1
Weapon Modifier := 0
Weapon Sound := apbeam.wav
Weapon Family := 1

*END*

__________________
The Ed draws near! What dost thou deaux?
Reply With Quote