r/Tf2Scripts • u/ArgosOfIthica • Sep 04 '20
Resource scalu: A programming language for configuration files
Hey everyone!
A while ago, I made a post about implementing arithmetic into the scripting system. I've been iterating on it since then, and its come quite a ways.
scalu is a stand-alone event based programming language written in Python, with support for 8-bit arithmetic, if-else control flow, recursion, printing variables to console, sandboxing, and automatic generation and management of binds and special files (classes, autoexec, listenserver, etc), that all compiles down to a single cfg file. The language is semantically as expressive as config files alone, which means that almost all programs that can be expressed with regular configuration files can also be expressed in scalu, but usually much more easily.
The source code as well as examples can be found on the Github: https://github.com/ArgosOfIthica/scalu. Examples currently include a "perfect" weapon state script (tracks all classes), as well as the classic null movement script. There's also a small wiki: https://github.com/ArgosOfIthica/scalu/wiki
I've also created a repl for those who want to try it out in their browser, though obviously having the compiler locally is a far superior experience. Edit the program string, then hit "run" to compile a text based config.
Its also worth noting this will work for most source games. Nothing about this compiler is actually specific to TF2. A lot of testing was done in Half-Life: Source, for instance. The only assumption it makes is that the config system has bind , alias and other basic Quake-like syntax.
View all comments
Show parent comment
2
u/pdatumoj Sep 04 '20
It's certainly one heck of an accomplishment. I'd tried going in this direction at one point a while back myself, but ran into enough special case type situations I began to doubt the project enough to make me stop.
Thanks a lot for the output sample. :)
By the way, will this take into account TF2's limits on config file size and break things up into chunks before it hits that boundary?