LIL is a scripting language i have written in C (and made a second implementation in FreePascal for my
3D world editor). It is very Tcl-like, although in my opinion a bit simpler (and *way* smaller, since the C implementation is just a pair of c/h files and the FP implementation a single unit). The code looks like (fake function names, just to get an idea):
set dude [spawn dude]
set-texture $dude dude.jpg
on $dude collision { print $other hit $me }
It is a fully dynamic language based on string substitution, which makes it extremely flexible (and extremely slow :-P but if you use it for decision making and leave the workload to the native side, it is fine even for old machines). As an example, control structures like if, while, set even func (for function declaration) are regular functions.
About how this will be used via C#, it is simple: i have
written C# bindings for the C DLL, so i can use the language from C# too. The current C#/XNA engine will simply expose the same functions to LIL scripts as the C engine so the game scripts will be transferred without issues. The C#/XNA engine is temporary because it wasn't written for a big project and i don't plan on doing advanced stuff there like menus, guis, etc - these will be done in the C engine.
An example of something i'm talking about are pickable entities. These entities emit a "picked" message to all the entities they are linked to (links are made
via the editor) so that they can trigger other things. The code for creating a pickable entity could be
func spawn-pickable {} {
set entity [spawn]
on $entity collision {
if [is-player $other] {
foreach link [links $entity] {
send $link picked $link $other
}
}
}
# other setup here, like rotation, etc
return $entity
}
The golden pickaxe could use the above like
func spawn-pickaxe {} {
set entity [spawn-pickable]
entity-model $entity pickaxe
# other setup here, like collision modes, etc
return $entity
}
When loading the world file, the engine will simply call a spawn-<blah> function (where <blah> is the name of the entity as stored in the world file) and expect an entity as the function's result.