|
Last change
on this file since 10046 was
10046,
checked in by smerkli, 11 years ago
|
|
Fixed some more things. What works now:
- Setting an ID for the scriptcontroller to be used from
C++ in lua
- Running a script from the controllerdirector triggered
by an event
- Getting an instance of a ScriptController object pointer
from lua, and also calling a function of this object
with parameters.
Next steps will be implementing different IDs per controller
object and actually swapping out controllers.
|
|
File size:
584 bytes
|
| Line | |
|---|
| 1 | --k = 1.2 |
|---|
| 2 | |
|---|
| 3 | --orxonox.execute("orxout message test " .. k) |
|---|
| 4 | |
|---|
| 5 | x = 1.1 |
|---|
| 6 | y = 2.2 |
|---|
| 7 | z = 3.3 |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | local ctrl = orxonox.ScriptController:getScriptController() |
|---|
| 11 | if ctrl ~= nil then |
|---|
| 12 | ctrl:moveToPosition_beta(x, y, z) |
|---|
| 13 | end |
|---|
| 14 | |
|---|
| 15 | --ctrl.moveToPosition(x,y,z) |
|---|
| 16 | -- |
|---|
| 17 | if newctrlid ~= nil then |
|---|
| 18 | orxonox.execute("orxout message test " .. newctrlid) |
|---|
| 19 | end |
|---|
| 20 | |
|---|
| 21 | local docks = orxonox.Dock:getNumberOfActiveDocks() |
|---|
| 22 | local docklist = {} |
|---|
| 23 | for i = 0, docks-1 do |
|---|
| 24 | table.insert(docklist, orxonox.Dock:getActiveDockAtIndex(i)) |
|---|
| 25 | end |
|---|
| 26 | local dock = docklist[1] |
|---|
| 27 | if dock ~= nil then |
|---|
| 28 | dock:dock() |
|---|
| 29 | end |
|---|
| 30 | |
|---|
| 31 | --orxonox.execute("setPause 1") |
|---|
| 32 | |
|---|
| 33 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.