View Single Post
  #2  
Old December 6th, 2004, 09:51 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!

SE5? Not much, seeing as SE5 will have its own built-in formula parser, making the templatizer pretty much obsolete (unless of course Aaron decides NOT to throw in custom formulas like I did )

... that was odd, I did NOT post that at 4:30 this afternoon, I was on my way home from work at 4:30... did someone at work see the message I left without posting and post it after I left??? Yes, I believe they did, because I hadn't finished typing in the quadratic formula yet!

edit: oh, so I might as well finish that feature list... in addition to defining your own functions, you can define your own operators, like this:
#Postfix ! := product(factorialNum, 1, arg1, factorialNum)
which calculates a factorial by looping through the integers until you get to the number specified and multiplying them.
For infix operators, you have to specify a precedence (high, medium, low, or very low level).
(Yes, you will now be able to compute the products and sums of series... once I implement those functions, which will involve actually creating new named constants on the fly )

I hope to eventually get symbolic variables in there so you could put in 3 * x + 4 * x and get 7 * x, (but I don't know how well that would work; how would I tell the program how to, say, recognize polynomials and multiply them out? not TOO hard, but then how would it know which form is the "simplest"? the one with the least number of characters? least number of parentheses? largest or smallest powers? and what if you throw in trig functions and user defined functions??? )

Actually, the templatizer itself is very simple; pretty much all it does is read in files and if it sees anything in brackets after a := symbol, it calls the expression evaluator to do all the dirty work, so the templatizer should (mostly) work with SE5 data files, or even SF or DO data files; the only hardcoded change I had to make was to define the "range" variable and run it through a loop from 1 to 20 (or 21) whenever the "Weapon Damage At Rng" field is found, so I suppose similar things would have to be done for other array fields in the other games as well...
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote