Hi all,
I've been using commands and timelines extensively in my last project and they turned to be invaluable for providing hooks between code and UI/gameplay.
However they can become pretty cumbersome, especially if one isn't used to stack-based evaluations.
I'd like to propose here a few improvements, lemme know what you think:
- Ability to pack a list of commands into a single blob/script:
0 = Command1 # Command2 # ... # CommandN
could be rewritten
0 = "Command1
Command2
...
CommandN"
However the formatting would be optionnal, people could write them on a single line or indent them as will without modifying their evaluation.
- Ability to use local variables that would disappear as soon as a blob/script is done:
MyVar: Command1
Command2 @MyVar
What punctuation would you prefer for assignment ':' or '=' ? Same for the reference '@', '$', or something else?
- Ability to directly refer to config values (ie. global variables) as shortcuts to Config.SetValue & Config.GetValue:
RunTime.Menu: Object.GetName ^
Object.Delete $RunTime.Menu
Again, which punctuation would you rather see for the reference ('$' ?) and the section/key separation '.', '|', '/', ...
I'd also like to be able to compose a config variable name with the content of local variables:
name: Object.GetName ^
Object.Create $@name.Child
RunTime.@name: ^
- Ability to chain commands directly, ie. use a command in-place as an argument for another one:
Object.Delete Object.GetName ^
This is equivalent to the current
> Object.GetName ^ #
Object.Delete <
Or in the new system, it could also be written:
name: Object.GetName ^
Object.Delete @name
Taking a real world example from the original Commands and TimeLines post:
[CursorTrack]
0 = > Mouse.GetPosition #
> Render.GetWorldPosition < #
> + < (0,0,0.01) #
Object.SetPosition ^ <
Could either be rewritten as short as:
[CursorTrack]
0 = Object.SetPosition ^ + Render.GetWorldPosition Mouse.GetPosition (0,0,0.01)
Or with some fancy identation:
[CursorTrack]
0 = "Object.SetPosition ^
+ Render.GetWorldPosition Mouse.GetPosition
(0,0,0.01)"
Or even, in a more traditional way:
[CursorTrack]
0 = "pos: Mouse.GetPosition
pos: Render.GetWorldPosition @pos
pos: + @pos (0,0,0.01)
Object.SetPosition ^ @pos"
Any thoughts/comments?
Cheers,
Rom