Speculation: ThereScript is [Lua], described as "a powerful light-weight programming language designed for extending applications". The current version of Lua is 5.0; you can read the [reference manual] on-line. Lua is free software. I have done some comparisons between the Lua reference manual and some example files, and it seems to correspond very closely. What this means is that if you want to process ThereScript files, you can download Lua and bind it into your own (C) applications. -- IanYoung
My intention is to try and waffle about the grammar of ThereScript here, inasmuch as I can guess what it might be. I think it makes sense to separate this from the pages for TsFiles and AconfFiles, where we can instead restrict discussion to the particular uses of ThereScript. -- IanYoung
Here is an example TsFile for a designer object, specifically Resources\gamekit\epobs\fu\92552851.ts (my own free-standing picture add-on):
PIECE
{
name = "Winter Trees, Livingston",
id = "dev92552851",
model = "fl/92552851.model",
modelSettings = {
[ "pic" ] = {
colormap = "fl/92552851_1.jpg",
lit = 0,
twosided = 0,
},
[ "frame" ] = {
colormap = "fl/92552851_2.jpg",
lit = 0,
twosided = 0,
},
[ "tape" ] = {
colormap = "fl/92552851_3.jpg",
lit = 1,
twosided = 0,
},
[ "back" ] = {
colormap = "fl/92552851_4.jpg",
lit = 1,
twosided = 0,
},
},
layoutClass = "Structures",
sinkToGround = dropOnTop,
}
CONTENTS
{
{ "dev92552851", 1 },
}
What I read into this is as follows:
name = value pairs separated by commas (but also allowing an ignored trailing comma for ease of machine generation).
dropOnTop is an example of this. My guess would be that the validity of such identifiers isn't truly global but depends on the context in which the ThereScript is imported.
PIECE is followed by an array specification.
CONTENTS works slightly differently, obviously, and it isn't so obvious how to map this second syntax onto the first. It may be that missing out the name = part of the syntax simply gives an integer indexed array instead of an associative (string-named) map. This would be like PHP, for example.
This seems to explain everything in the above TsFile. My next step will to formalise that as an Antlr grammar and try verifying that all TsFiles in my client installation match such a grammar.
20040423: The capitalised words PIECE and CONTENTS look to me like they are actually in-line function calls to functions defined in the file gamekit\gamekitsystem.ts. There also seems to be some relevant code in gamekit\gamekitframework.rs which includes the former. Speculation: these files are the context in which the add-on kit TsFiles are executed.
Some other observation from the gamekit framework files:
nil until a value is assigned to them.
==, ~=
..
or
not, ~, -
for name,entry in t do ... end
function name(args) ... end
table["name"] or table.name
local fred = value
-- to end of line
NIL rather than nil at one point. This might mean:
nil is not case sensitive but other words are
nil anyway, no harm is done.
if boolean then ... end
; at the end, but usually not.
CONTENTS is indeed integer indexed. It looks like integer indices start from 1.