The current script syntax is problematic, so I've been considering a new one.
There are 4 main problems with the current syntax:
1. Everything has to be surrounded by square brackets so the script interpreter can distinguish separate parameters.
2. Parameters have to be in a fixed order and in a lot of cases can't be omitted/defaulted.
3. To accommodate #2, I have to make several versions of the same command to help script writers not have to worry about parameters they're not interested in.
4. Parameters are mostly unnamed so it's harder for script writers to remember what each parameter is, and it makes the script interpreter code more complex.
I've considered various other syntax formats, and I think the most suitable one for our scripts is the standard command line syntax most operating system command shells use.
e.g.
> command [name] [/a[=attributes]] [/b] [/c]..
where /a, /b, /c are named parameters, usually followed by some value, but not always
e.g.
rain /point=x,y,z /radius=value /duration=value /intensity=value /color=r,g,b
parameter names can be shorted to the least significant characters, e.g:
rain /p=x,y,z /r=value /d=value /i=value /c=r,g,b
any non mandatory parameters can be easily omitted, e.g:
rain /p=x,y,z /r=value
or
rain /p=x,y,z /i=value
an example of params that don't need values:
sound brook /p=x,y,z /delete
sound brook /p=x,y,z /d
or
sound brook /p=x,y,z /loop
sound brook /p=x,y,z /l
the /delete and /loop params don't need values
Parameters can be entered for the command in any order, you won't have to remember the fixed order again. e.g.
rain /p=x,y,z /r=value /d=value /i=value /c=r,g,b
and
rain /d=value /c=r,g,b /p=x,y,z /i=value /r=value
are both (the same) valid commands.
The syntax might seem a little cryptic at first, but I think once you get used to it, you'll find it much easier to write and understand scripts, and you won't have to refer to the documentation so much.
Naturally if I was to do something like this, I'd convert existing scripts to the new syntax, so you wouldn't have to worry it'll break your scripts and you wouldn't have to write them again.
In general, because you won't need square brackets anymore and you'll be able to omit unused parameters, the number of characters you'll need to type to write scripts should be reduced, speeding up the process.
Thoughts?