.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   SE4 Scripting in Python (templatizer again) (http://forum.shrapnelgames.com/showthread.php?t=12459)

Ed Kolis August 12th, 2004 11:19 PM

Re: SE4 Templatizer Ready for Download!
 
New Version of the (text-based) Templatizer ready - now with caching, so it's much faster! http://forum.shrapnelgames.com/images/smilies/cool.gif

Hmm, when will I ever get back to work on that graphical modding tool? http://forum.shrapnelgames.com/image...es/redface.gif

Ruatha August 31st, 2004 01:18 AM

Re: SE4 Templatizer Ready for Download!
 
What's happening with the graphical shell?

Ed Kolis October 18th, 2004 01:23 PM

Re: SE4 Templatizer Ready for Download!
 
Oops, sorry, must have lost track of your post, Ruatha... I haven't done anything on a graphical shell yet, but what I am doing is completely rewriting the program to make it faster and more powerful. See, right now, it's horribly inefficient at parsing the text, because basically if you have 5 + (2 * 3), it searches for the outermost operation (the plus), and splits it up into two expressions, 5 and 2 * 3. Then it takes the 5 and says "oh, that's a number", and stores it away. The 2 * 3 then gets parsed AGAIN (even though it was already searched through to find the plus) and split into the 2 and 3. Then, those numbers are multiplied to get 6, and then 5 is added to get 11. This may not seem to inefficient, but imagine a long expression with many subexpressions, such as sin(pi * (2 + atan(6) * e) - 1? http://forum.shrapnelgames.com/images/smilies/eek.gif

So what I WANT to do is do all the parsing at once, only once, and THEN do the evaluation. This will involve something I've come up with called "functional notation" where every operation, constant, or variable is represented as a function, so for instance 5 + 2 would be represented as +(5,2), and sin(pi / 3) would be represented as sin(/(pi(),3)). Actually functional notation has probably been invented already, but I thought of it independently, so there http://forum.shrapnelgames.com/image...ies/tongue.gif

Which leads me into the main reason for this post: I noticed that using functional notation, there could only be one function or operator with the same name and "arity" (which is the number of operands). This reminds me a LOT of a programming language called Erlang, because there was the same restriction on Erlang's functions, seeing as Erlang was a weakly-typed language. SO... what I'm thinking of doing is, while I'm already rewriting everything, adding a *scripting language* to my expression evaluator, so that you can define your own functions without having to compile any C# code. Basically, I'd have only the most rudimentary functions and operators predefined, and the rest would be called through script. I know, you say scripting Languages are slow, but C# has this nifty feature which lets you compile and execute code "on the fly", so I could compile the scripts whenever the program is run (don't worry, C# code compiles fast http://forum.shrapnelgames.com/images/smilies/wink.gif), and then execute them as compiled code in memory! http://forum.shrapnelgames.com/images/smilies/cool.gif

SO... what my question is, is what would be the preferred language of the Users of this program to base the scripting language on? The most natural choice for me would be C#, because that's what I use, but VB would work as well, since the on-the-fly compiler can work with either language. But since I'll probably have to write my own language parser (to allow only harmless instructions like "return x+y" and "if p then loop until q" and nothing like "delete c:\windows\*.*" http://forum.shrapnelgames.com/images/smilies/wink.gif), I could just as well base it on some other language, like Python or Erlang... problem is, I don't know much ABOUT Python or Erlang... http://forum.shrapnelgames.com/images/smilies/frown.gif

So, anyone have a preference?

Aiken October 18th, 2004 02:39 PM

Re: SE4 Templatizer Ready for Download!
 
I'd prefere native c syntax. It'll make your work much easier. Just don't forget to rewrite documentation http://forum.shrapnelgames.com/images/smilies/happy.gif

Fyron October 18th, 2004 02:47 PM

Re: SE4 Templatizer Ready for Download!
 
VB is not an option... Stick to real Languages. http://forum.shrapnelgames.com/image...ies/tongue.gif Python would be a very good choice. Python has similar syntax to C/C++.

Gandalf Parker October 18th, 2004 03:03 PM

Re: SE4 Templatizer Ready for Download!
 
Quote:

Imperator Fyron said:
VB is not an option... Stick to real Languages. http://forum.shrapnelgames.com/image...ies/tongue.gif Python would be a very good choice. Python has similar syntax to C/C++.

Really? VB not an option for a scripting language? Of a game that is Windows restricted? You would rather have scripters in C syntax instead of basic?

Aiken October 18th, 2004 04:20 PM

Re: SE4 Templatizer Ready for Download!
 
The best scripting language is the language you know best of all. http://forum.shrapnelgames.com/images/smilies/happy.gif It really doesn't matter VBS, JScript, python or perl or pseudoC script.
Probably VBS or JScript are more convenient than others, because of WSH.
Personaly, I don't like VBS and VB (in general) too - many inherent flaws and bad design. So my next vote will go to JScript.

Fyron October 18th, 2004 04:25 PM

Re: SE4 Templatizer Ready for Download!
 
Quote:

Gandalf Parker said:
Quote:

Imperator Fyron said:
VB is not an option... Stick to real Languages. http://forum.shrapnelgames.com/image...ies/tongue.gif Python would be a very good choice. Python has similar syntax to C/C++.

Really? VB not an option for a scripting language? Of a game that is Windows restricted? You would rather have scripters in C syntax instead of basic?

You can easily install other scripting language interpreters on Windows, including other "basic" type Languages... it is just a few clicks away. VB is no good.

Ed Kolis October 18th, 2004 06:35 PM

Re: SE4 Templatizer Ready for Download!
 
Hmm... a divided opinion... well, I could always have functions loaded as modules, and let the user choose between VB and C#, and screw the security considerations - if you're dumb enough to run a malicious program when the source is sitting right in front of you, it's your fault! http://forum.shrapnelgames.com/images/smilies/laugh.gif

Gandalf Parker October 18th, 2004 08:22 PM

Re: SE4 Templatizer Ready for Download!
 
Quote:

Imperator Fyron said:You can easily install other scripting language interpreters on Windows, including other "basic" type Languages... it is just a few clicks away. VB is no good.

That wasnt what I meant. Not that Im big on "run this, but of course you will have to go get this first" type of programs. I was just totally disagreeing with a blanket sheep statement like "VB is no good". Everything has its pros and cons. VB doesnt have many but as a beginners scripting language in fairly english usage that would seem to be what its for.

But dont mind me, I wouldnt prefer VB either. I prefer to do all my coding on linux then run it in windows

Ed Kolis October 18th, 2004 11:51 PM

Re: SE4 Templatizer Ready for Download!
 
Hmmm... looks like the scripting language might have to wait... I just remembered that the on-the-fly code compilation that I was going to use uses something called "reflection", which is VERY slow, and is what was slowing down my program so much in the first place! http://forum.shrapnelgames.com/images/smilies/eek.gif

I don't suppose throwing together my own interpreter would run code any faster than Microsoft's reflection, would it? http://forum.shrapnelgames.com/image...s/rolleyes.gif Even though I'd be limiting the instruction set, hopefully speeding up the parsing, I don't think I'm that good that I could compete with the likes of them http://forum.shrapnelgames.com/images/smilies/wink.gif

On the other hand......

The compilation feature of .NET also has the ability to actually compile code into a DLL *on disk*, so maybe what I could do is provide a very basic language that is easy to use, write a compiler for it, which of course would run as quickly as anything I hardcode...

So, what features would you like to be in such a language? Basic math and logical operations are obvious, as are conditional and looping statements (though loops can be created by conditionals and gotos, should I choose to include gotos http://forum.shrapnelgames.com/image...ies/tongue.gif) Variable declarations might also help...

Now since we're only going to be defining functions and no fancy data structures in this language, I suppose it might make sense to cut down on the typing and use something similar to Erlang's function definition style, which looks a LOT like the formal mathematical style (forgive my poor syntax; I've never actually written anything in Erlang before http://forum.shrapnelgames.com/image...ies/tongue.gif)

Recursive algorithm for finding factorials:
<font class="small">Code:</font><hr /><pre>
fact(0) -&gt; 1.
fact(1) -&gt; 1.
fact(n) -&gt; if n &lt; 0 error() else n * fact(n - 1).
</pre><hr />

How does that look? Readable? Maybe I'll get the hang of Erlang after all... then maybe I can even work on writing PLUGINS and stuff for Wings! http://forum.shrapnelgames.com/images/smilies/eek.gif (Nah, I won't have the time, and besides, I've barely scratched the surface of the language http://forum.shrapnelgames.com/image...ies/tongue.gif)

(Wow, I never thought I'd be developing my own .NET language, but really, I might be!)

Or maybe I SHOULD start over in Python... I'm already pretty much starting over as it is http://forum.shrapnelgames.com/images/smilies/frown.gif

Ed Kolis December 6th, 2004 06:19 PM

Re: SE4 Templatizer Ready for Download!
 
Looks like templatizer v2.0.0 might be coming out soon... pretty much all I need to do is implement parentheses and fix up a few bugs, then plug in the new Version of the expression evaluator into the templatizer! http://forum.shrapnelgames.com/images/smilies/laugh.gif

New features in 2.0.0:
-You can now script your own functions and operators without writing a single line of C# code! Just define them in functions.txt like these:
Quadratic solver:
#Function quadfirstroot = (-arg2+sqrt(4*arg1*arg3

This is almost turning into a programming language, isn't it? http://forum.shrapnelgames.com/images/smilies/wink.gif

Of course, I just HAD to use the latest 2.0 beta release of the .NET framework, just because I wanted to try out the nifty new generic classes and such... sorry about the huge download again http://forum.shrapnelgames.com/images/smilies/frown.gif

Atrocities December 6th, 2004 07:27 PM

Re: SE4 Templatizer Ready for Download!
 
Sounds like your enjoying yourself Ed. http://forum.shrapnelgames.com/images/smilies/happy.gif What do you have planned for SE V?

Ed Kolis December 6th, 2004 09:51 PM

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 http://forum.shrapnelgames.com/images/smilies/frown.gif)

... 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! http://forum.shrapnelgames.com/image...ies/tongue.gif

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 http://forum.shrapnelgames.com/images/smilies/laugh.gif)

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??? http://forum.shrapnelgames.com/images/smilies/eek.gif)

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...

Fyron December 7th, 2004 01:21 AM

Re: SE4 Templatizer Ready for Download!
 
Quote:

Ed Kolis said:

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??? http://forum.shrapnelgames.com/images/smilies/eek.gif)

Just pick with the form that is easiest to use calculationally, and convert all functions to it. For example, the "simplest form" could be the standard form of a polynomial, a(n) * x ^ n + a(n-1) * x (n-1) + ... + a(0). You would probably want to convert the equations to matrix form and use linear algebra anyways, as it is really the only sane way to deal with polynomials http://forum.shrapnelgames.com/images/smilies/wink.gif. This uses the standard form of the functions.

Ed Kolis December 25th, 2004 03:57 PM

Re: SE4 Templatizer Ready for Download!
 
No, no templatizer 2.0 yet... but I have a question - what would be a good name for a function which performs a specified function on every character in a string and returns the concatenation of all the results? E.g. a hexadecimal to binary converter: you'd call it something like this

functionname(htob, "DEADBEEF")

where functionname is my function I'm trying to find a name for and htob is the hex-to-binary function which converts a single hex digit to binary... I thought of concat and foreach, but concat is already taken and foreach I want to reserve for an even more general case that's kind of nebulous in my mind right now...

Ed Kolis January 6th, 2005 06:06 PM

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! http://forum.shrapnelgames.com/images/smilies/eek.gif 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! http://forum.shrapnelgames.com/images/smilies/laugh.gif) So, instead of something like this...

<font class="small">Code:</font><hr /><pre>
*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 &lt;romana&gt;-&lt;letterb&gt;
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*
</pre><hr />

you could have this:

<font class="small">Code:</font><hr /><pre>
*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*
</pre><hr />

NarfsCompIsBack January 6th, 2005 10:31 PM

Re: SE4 Templatizer Ready for Download!
 
Woot! Not that I can do anything with it right now.

Nodachi January 23rd, 2005 09:52 AM

Re: SE4 Templatizer Ready for Download!
 
How's this coming along, Ed?
BTW, the link for this is incorrect on your site. http://forum.shrapnelgames.com/image...es/redface.gif

Ed Kolis January 23rd, 2005 11:51 AM

Re: SE4 Templatizer Ready for Download!
 
Oh, I've fallen into one of those lulls again... I've tried working on it a few times, and I think I have one thing figured out but then another problem crops up... and given that I don't get around to working on it every day that can take a while http://forum.shrapnelgames.com/images/smilies/frown.gif

Right now I have the linear interpolation function working (I think) but something's wrong with the geometric and logarithmic functions and I want to make sure that it's not something in the code (as opposed to just a bad formula definition in formulas.txt) before I release anything... and right now the prospects aren't looking too good http://forum.shrapnelgames.com/image...ies/tongue.gif

Plus then I still have to add those new features to the templatizer itself - the usage of more than 3 level variables, the definition of user-defined functions, etc. That all shouldn't be too hard because it's primarily just calling methods I already have defined (or copying and pasting http://forum.shrapnelgames.com/images/smilies/wink.gif), rather than writing a lot of new code.

Ed Kolis February 20th, 2005 06:46 PM

Re: SE4 Templatizer Ready for Download!
 
All right, the bad news is I gave up on the .NET-powered templatizer... the good news is I moved to Java! http://forum.shrapnelgames.com/images/smilies/laugh.gif

This was actually prompted by my switch to Linux; Mono's IDE isn't very developed at this point, whereas with Java you can use NetBeans.

Well, over the past 3 days I completely rewrote the templatizer part of the program, and gave up on the expression evaluator - because I finally found one that does exactly what I want, only it's even better than the one I wrote! http://forum.shrapnelgames.com/images/smilies/laugh.gif

Have a look at this:
http://directory.fsf.org/science/math/calc.html

One problem I foresee is that it's called "calc" which is the name of the standard Windows calculator... well I could put in a dialog to locate the "real" calc, but for now - hey, who uses the crappy Windows calculator anyway? Just rename it! http://forum.shrapnelgames.com/image...ies/tongue.gif

The templatizer is almost working again, and it even has a GUI, but the thing I'm stuck on right now is trying to get the thing to not skip tech grids! http://forum.shrapnelgames.com/images/smilies/mad.gif It would be much easier if I weren't trying to support an unlimited number of tech grids... the very first templatizer supported 3; would 16 do? I say this because if I have a set number of grids, I can use nested for loops, but with an unlimited number, I have to use recursion and that gets messy! http://forum.shrapnelgames.com/images/smilies/eek.gif

Unless SJ wants to help me out, seeing as he's solved this problem already, even though I'm trying to make something that will compete with his Tech Gridder... hey, I did give up on .NET http://forum.shrapnelgames.com/image...ies/tongue.gif

Ed Kolis February 21st, 2005 11:34 PM

Re: SE4 Templatizer Ready for Download!
 
Templatizer 3 is here!!!!!
http://home.fuse.net/koliset/SE4/tem...-3.0.0.tar.bz2
You'll need the aforementioned calc program, as well as the latest Java (not .NET) runtime.
Questions? Comments? http://forum.shrapnelgames.com/images/smilies/wink.gif

Ed Kolis February 22nd, 2005 02:57 AM

Re: SE4 Templatizer Ready for Download!
 
I just fixed up some bugs... c'mon, somebody download this thing &amp; try it out! Get calc and see if it works on Windows - it's a pretty nifty tool http://forum.shrapnelgames.com/images/smilies/wink.gif
http://home.fuse.net/koliset/SE4/tem...-3.0.1.tar.bz2

Ed Kolis February 22nd, 2005 04:19 AM

Re: SE4 Templatizer Ready for Download!
 
Fixed another bug, or maybe broke something else, who knows/cares, I'm tired... http://forum.shrapnelgames.com/image...ies/tongue.gif
http://home.fuse.net/koliset/SE4/tem...-3.0.2.tar.bz2

leo1434 February 22nd, 2005 09:31 PM

Re: SE4 Templatizer Ready for Download!
 
Isn't it possible to distribute an .exe file, or give more complete intructions on how to use this tool?

Ed Kolis February 22nd, 2005 10:45 PM

Re: SE4 Templatizer Ready for Download!
 
Hmm, an .exe... might be tricky to do on my Linux system... I could make a zip version though... oh, and just put this into a file called templatizer.bat and then you can double click the batch file to run it (assuming you have Java 1.5 and calc installed):

java -jar templatizer.jar

What kinds of more complete instructions are you looking for?

Oh, and congratulations &amp; thanks for being the first to respond here - for a while I thought I was going to do this for nothing! http://forum.shrapnelgames.com/images/smilies/frown.gif

BTW, I still have another bug to fix up - functions defined out of alphabetical order don't work properly http://forum.shrapnelgames.com/image...s/rolleyes.gif I hope to get to it tonight or at least sometime in the next few days...

Ed Kolis February 23rd, 2005 01:38 AM

Re: SE4 Templatizer Ready for Download!
 
OK, version 3.0.3 is out...
http://home.fuse.net/koliset/Program...izer-3.0.3.zip

I've fixed lots of bugs... though I still haven't tried actually loading any of the generated files into SE4... I wonder if SE4 will choke on the UNIX formatted files, since I forgot to tell it to place the carriage return after each newline like Windows prefers... http://forum.shrapnelgames.com/image...s/rolleyes.gif

Aiken February 23rd, 2005 05:26 AM

Re: SE4 Templatizer Ready for Download!
 
Do I still need a EEE part to get it to work?
I can't find calc's binaries, do I need them actually? And where to get them?

Spoo February 23rd, 2005 11:22 AM

Re: SE4 Templatizer Ready for Download!
 
It looks like calc is only available as source files. Most windows users don't have a compiler handy, you know.

Ed Kolis February 23rd, 2005 11:43 AM

Re: SE4 Templatizer Ready for Download!
 
No, you don't need EEE; you do need calc binaries though.
Hmm, let me go see where the binaries are... I can't find them either; if you want you can compile it with cygwin though... sorry, I only noted that calc runs on Windows; I didn't check for Windows binaries... I really need to plan better... http://forum.shrapnelgames.com/images/smilies/frown.gif
But basically what I gather from the Windows build instructions is that you need to set up Cygwin (make sure you get the gcc package, it's the C compiler!), put the source in your Cygwin directory, run cygwin, go to your source directory in cygwin (cd /usr/src/calc or whatever your source is under), copy the Windows-specific files to the source directory (cp win32/*.c win32/*.h .) and build the executable (make win32_hsrc)
I have cygwin on the old laptop; maybe I can do all that for you, assuming distributing binaries of someone else's software is OK under the LGPL (I think it is, as long as I include the source or at least say where to get it...)
Alternatively, you could use the DJGPP compiler... that runs natively under Windows... see the above readme for instructions on how to compile it with DJGPP...
Hmm, this all needs to go in the documentation for the templatizer... http://forum.shrapnelgames.com/image...ies/tongue.gif

Aiken February 23rd, 2005 12:44 PM

Re: SE4 Templatizer Ready for Download!
 
1) I have a debian install in colinux (gcc 3.3.3) at hand now, would you wrote some instructions how to build win32 binaries in linux? I see one need to mess with a makefile, but where?

2) se4 is unable to load text files in unix format (lf). Please add conversion to dos format (crlf).

3) Do I strictly need jre 1.5 or 1.4.x will be sufficient?

4) Thanks for getting rid of dotnet and all the work http://forum.shrapnelgames.com/images/smilies/happy.gif

edit: about #1 - just have realized that compilation in cygwin and native *nix will be identical http://forum.shrapnelgames.com/images/smilies/happy.gif So ignore #1.

leo1434 February 23rd, 2005 09:40 PM

Re: SE4 Templatizer Ready for Download!
 
Ed:

I have read the instructions in the calc and I think you have to be a PC-Wizard to follow them. Why such pain? Why not "click on the install file". I think this will be better for the average player (er..., modder) assuming modders are a bit more "PC Skilled" than players. It is noticeable that people who make calc is a bit "Win-hater" but I think that we have to cope with the fact that windows systems are majority. Linux systems are said to run very well, but not all of us have the time and will to become computer technicians in order to learn how to use/install such systems.
On the other hand, I wish to thank you for your work in making such a program.Ithink it fills an important place in my SE4 Toolbox!!

Ed Kolis February 23rd, 2005 10:02 PM

Re: SE4 Templatizer Ready for Download!
 
@Aiken:
2. Oops! I will do that! http://forum.shrapnelgames.com/image...es/redface.gifops:
3. Yes, you need 1.5 because I was lazy and used generic classes. http://forum.shrapnelgames.com/image...ies/tongue.gif Java is pretty insistent about pushing updates at you so you might already have it.
4. What's so bad about .NET compared to Java? The runtimes are about the same size to install... http://forum.shrapnelgames.com/image...s/confused.gif

@leo1434:
Yeah, sorry about all the trouble... I've just been wanting to get something out there. Calc is licensed under the LGPL, though, so I'm pretty sure I'd be allowed to include a Windows binary with my distribution of the templatizer, as long as I provided a link to the source code as well. (Anyone want to back me up on that? I don't feel like perusing the whole license again! http://forum.shrapnelgames.com/images/smilies/eek.gif)
As for an installer, I'd have to see... I've never found a really decent installer generator, and the program doesn't require a whole lot of files to run. But I could whip up a little batch file or Java program which would copy the files to convenient locations, and maybe even put them in your PATH environment variable so you can call them from anywhere...

Aiken February 24th, 2005 01:29 AM

Re: SE4 Templatizer Ready for Download!
 
Quote:

Ed Kolis said:
4. What's so bad about .NET compared to Java? The runtimes are about the same size to install... http://forum.shrapnelgames.com/image...s/confused.gif

It will be #5:
5) Send Java there dotnet is already buried http://forum.shrapnelgames.com/image...ies/tongue.gif
5.1) Don't take it seriously, I'm just nitpicking http://forum.shrapnelgames.com/images/smilies/happy.gif

I bet that lgpl allow you to redistribute compiled libraries if you put a license and credits files into your package. But you better ask about it in the calc mailing list, I think.

Ed Kolis February 24th, 2005 01:57 AM

Re: SE4 Templatizer Ready for Download!
 
All right, I've asked the primary author of calc for permission to include a Windows binary with the templatizer... we'll see how that goes! http://forum.shrapnelgames.com/images/smilies/happy.gif

Ed Kolis February 24th, 2005 02:21 AM

Re: SE4 Templatizer Ready for Download!
 
OK, I fixed the bug with the file format, and also fixed the Linux/UNIX shell script so it can actually pass command line arguments to the templatizer.

Ed Kolis June 18th, 2005 06:12 PM

3.0.5 bugfix release
 
1 Attachment(s)
Fixed a bug in the templatizer - it didn't like when I divided an array item by something; it treated the slash as a comment! http://forum.shrapnelgames.com/image...ies/tongue.gif New version attached.

Ed Kolis July 28th, 2005 07:22 PM

Re: 3.0.5 bugfix release
 
Hey, I found out about this Java library called JEP which can do pretty much everything that calc does, so hopefully we'll soon have a fully Java-based templatizer - no more compiling C code to run it on windows http://forum.shrapnelgames.com/image...ies/tongue.gif

Atrocities July 29th, 2005 12:44 AM

Re: 3.0.5 bugfix release
 
pme eptf. Dedp,r@

narf poit chez BOOM July 29th, 2005 01:24 AM

Re: 3.0.5 bugfix release
 
Uh??

Ed Kolis August 1st, 2005 03:55 PM

Re: 3.0.5 bugfix release
 
The templatizer is now Java-only!
Download latest version here:
http://kolis.dyndns.org/ed/prog/templatizer.zip

You'll need:
Java 5.0 runtime environment (www.java.com)
JEP parser plus the XJep and VectorJep packages (http://www.singsurf.org/djep/index.html) - or just grab the "Full Class Library"

Run the Java installer, extract templatizer.zip somewhere, and put the JEP stuff somewhere handy where Java can get to it (your templatizer directory is pretty much guaranteed to work; can't recall where else java might find it)! http://forum.shrapnelgames.com/images/smilies/laugh.gif

Look at the engine-template.txt for instructions (you can see its output in engine.txt)... the format has changed a bit since v3; hopefully it will be easier to use now (no more cryptic "#" symbols for a tech grid http://forum.shrapnelgames.com/image...ies/tongue.gif)

Ed Kolis September 10th, 2005 06:29 PM

Contemplating a graphical Templatizer...
 
I was thinking of rewriting the templatizer *yet again*, this time to give it a graphical user interface. Anyone think this would be a good idea, or would I just be wasting my time?

Basically the way this GUI would work is like the Art of Illusion texture editor. You'd have a bunch of "blocks" each representing some elementary function or variable, and by plugging the blocks into each other you could create complex equations, with the added ability to save a set of blocks as a new block for future use. Of course, I'd hope to still support typing in equations (don't want to have to add 3 separate blocks just for 3 + TechLevel! http://forum.shrapnelgames.com/images/smilies/eek.gif), but I'm hoping making the program more "visual" will increase its usability... do you agree, disagree, not really care, whatever? http://forum.shrapnelgames.com/images/smilies/wink.gif

Kana September 11th, 2005 04:19 AM

Re: Contemplating a graphical Templatizer...
 
Yeah that would be great...just make it for SEV instead...

http://forum.shrapnelgames.com/image...es/biggrin.gif

Kana

Ed Kolis September 11th, 2005 05:39 PM

Re: Contemplating a graphical Templatizer...
 
Eh, shouldn't be hard to modify for SE5, if I ever get it done http://forum.shrapnelgames.com/images/smilies/wink.gif
Besides, a templatizer for SE5 would be of slightly less use, as in SE5 you're supposed to be able to type in formulas directly into the data fields...

Ed Kolis October 17th, 2005 08:22 PM

Re: Contemplating a graphical Templatizer...
 
1 Attachment(s)
Well, maybe I won't do a graphical templatizer... but I could always redo it so it just uses XML transforms to create the SE4 data files - I'm taking a course in XML right now, so this would be a good application http://forum.shrapnelgames.com/images/smilies/wink.gif
Anyway, does this file I've attached look readable/writable to anyone? It's not quite the same as the SE4 data files, but it uses the same fields, and once I write the XSLT (the hard part http://forum.shrapnelgames.com/images/smilies/wink.gif) it should be translatable into SE4 data just by viewing it in your browser! http://forum.shrapnelgames.com/images/smilies/eek.gif

Ed Kolis October 26th, 2005 02:57 AM

Re: Contemplating a graphical Templatizer...
 
1 Attachment(s)
OK, I've got a basic XML-based templatizer here...
http://kolis.dyndns.org/ed/prog/temp...tizer-XSLT.zip

Ed Kolis November 24th, 2005 12:34 AM

Re: Contemplating a graphical Templatizer...
 
1 Attachment(s)
I have rewritten the templatizer (yet again http://forum.shrapnelgames.com/image...s/rolleyes.gif) - this time in Python!
http://kolis.dyndns.org/ed/prog/temp...latizer-py.zip
And this time I won't make the mistake of not uploading it here just in case my computer fails http://forum.shrapnelgames.com/image...ies/tongue.gif

Atrocities November 24th, 2005 05:01 AM

Re: Contemplating a graphical Templatizer...
 
Cool, what does it do?

Ed Kolis November 24th, 2005 08:25 PM

Re: Contemplating a graphical Templatizer...
 
Same thing it's always done - let you plug in formulas and it churns out components, facilities, mounts, vehicle sizes, or whatever you want in copious quantities! http://forum.shrapnelgames.com/images/smilies/laugh.gif

narf poit chez BOOM November 25th, 2005 01:02 AM

Re: Contemplating a graphical Templatizer...
 
The cure for the common allergies?


All times are GMT -4. The time now is 04:41 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.