Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ScriptableController/data/gui/scripts/testscript.lua @ 10046

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
RevLine 
[10037]1--k = 1.2
[10035]2
[10037]3--orxonox.execute("orxout message test " .. k)
[10035]4
[10037]5x = 1.1
6y = 2.2
7z = 3.3
[10035]8
[10037]9
[10045]10local ctrl = orxonox.ScriptController:getScriptController()
[10046]11if ctrl ~= nil then
12  ctrl:moveToPosition_beta(x, y, z)
13end
14
[10045]15--ctrl.moveToPosition(x,y,z)
[10046]16--
17if newctrlid ~= nil then
18  orxonox.execute("orxout message test " .. newctrlid)
19end
[10037]20
[10045]21local docks = orxonox.Dock:getNumberOfActiveDocks()
22local docklist = {}
23for i = 0, docks-1 do
24  table.insert(docklist, orxonox.Dock:getActiveDockAtIndex(i))
25end
26local dock = docklist[1]
27if dock ~= nil then
28    dock:dock()
29end
[10037]30
[10045]31--orxonox.execute("setPause 1")
[10037]32
[10045]33
Note: See TracBrowser for help on using the repository browser.