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
Line 
1--k = 1.2
2
3--orxonox.execute("orxout message test " .. k)
4
5x = 1.1
6y = 2.2
7z = 3.3
8
9
10local ctrl = orxonox.ScriptController:getScriptController()
11if ctrl ~= nil then
12  ctrl:moveToPosition_beta(x, y, z)
13end
14
15--ctrl.moveToPosition(x,y,z)
16--
17if newctrlid ~= nil then
18  orxonox.execute("orxout message test " .. newctrlid)
19end
20
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
30
31--orxonox.execute("setPause 1")
32
33
Note: See TracBrowser for help on using the repository browser.