#392 Scriptable Controller

Introduce your project and write about your work.

Moderator: PPS-Leaders

Post Reply
abcdefg
Human Space Navy Private
Posts: 3
Joined: Thu Mar 26, 2015 2:18 pm

#392 Scriptable Controller

Post by abcdefg » Thu Mar 26, 2015 2:28 pm

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

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: #392 Scriptable Controller

Post by x3n » Sat Mar 28, 2015 12:29 pm

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.
Fabian 'x3n' Landau, Orxonox developer

abcdefg
Human Space Navy Private
Posts: 3
Joined: Thu Mar 26, 2015 2:18 pm

Re: #392 Scriptable Controller

Post by abcdefg » Thu Apr 23, 2015 11:50 am

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.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: #392 Scriptable Controller

Post by x3n » Thu Apr 23, 2015 7:14 pm

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?
Fabian 'x3n' Landau, Orxonox developer

abcdefg
Human Space Navy Private
Posts: 3
Joined: Thu Mar 26, 2015 2:18 pm

Re: #392 Scriptable Controller

Post by abcdefg » Thu Apr 30, 2015 11:43 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests