Page 1 of 1

#392 Scriptable Controller

Posted: Thu Mar 26, 2015 2:28 pm
by abcdefg
Hey guys,

I'm currently tackling the scriptable controller ticket. As you may or may not be aware, currently there are only two commands available and adding new ones is a rather cryptic and difficult task. My aims thus are:

- Add more standard commands
- Improve the syntax to add costum commands
- Improve the management of the timing parameters

So far:

- Added new command: ral ("rotate and look", no more unnecessary loops)
- Parameters are no more restricted to vector coordinates only

Re: #392 Scriptable Controller

Posted: Sat Mar 28, 2015 12:29 pm
by x3n
I didn't use the scriptable controller so far, but I wonder if it is currently possible to define loops? E.g. a spaceship that does the same actions over and over? Or are the actions only executed once and then the script stops?

If this is not possible yet, I think this could be an interesting task to implement.

Re: #392 Scriptable Controller

Posted: Thu Apr 23, 2015 11:50 am
by abcdefg
As the controller script is written in Lua you have all the control goodies already at your disposal (if-else, loops, e.t.c.), there is no need for a dedicated C++ implementation.

Re: #392 Scriptable Controller

Posted: Thu Apr 23, 2015 7:14 pm
by x3n
Really? Because I thought the Script-Events are put into a list in ScriptController. So what happens if the controller script (in Lua) contains an endless loop?

Re: #392 Scriptable Controller

Posted: Thu Apr 30, 2015 11:43 am
by abcdefg
The issue you are describing is related to timing: The user is supposed to keep track of the event timing specifications within the lua code himself (unfortunately my attempts at automating this in the C++ code were not rewarding at all...). Thus, as long as you update the time correctly within your code any loop or conditional structure works just fine. If you happen to run to events simultaneously by mistake, things will go wrong.