Index: code/branches/presentationFS15/data/gui/scripts/presentation.lua
===================================================================
--- code/branches/presentationFS15/data/gui/scripts/presentation.lua	(revision 10499)
+++ code/branches/presentationFS15/data/gui/scripts/presentation.lua	(revision 10499)
@@ -0,0 +1,40 @@
+-- Set some test variables
+xm = 1000 
+ym = 0
+zm = 0
+
+xl = -1000 
+yl = 3000 
+zl = -1000
+
+xr = 2000
+yr = 500
+zr = 2000
+
+d = 5
+Tabs = 0
+
+pi = 3.1415
+
+-- Get a local pointer to a scriptcontroller
+local ctrl = orxonox.ScriptController:getScriptController()
+
+-- If it worked, call its "movetoposition" function
+if ctrl ~= nil then
+
+  ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 2)
+  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("ral", xl, yl, zl, 3, 0, 0, math.pi)
+  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3)
+  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2)
+  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4)
+  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3)
+  ctrl:eventScheduler("idle", 1)
+  ctrl:eventScheduler("spi", xm,ym,zm, 0,0,0, 4)
+  ctrl:eventScheduler("idle", 1)
+
+end
Index: code/branches/presentationFS15/data/gui/scripts/testscript.lua
===================================================================
--- code/branches/presentationFS15/data/gui/scripts/testscript.lua	(revision 10498)
+++ code/branches/presentationFS15/data/gui/scripts/testscript.lua	(revision 10499)
@@ -39,9 +39,2 @@
 
 end
-
--- Output the newctrlid variable we set from the C++ code
-if newctrlid ~= nil then
-  orxonox.execute("orxout message test " .. newctrlid)
-end
-
---orxonox.execute("setPause 1")
Index: code/branches/presentationFS15/data/levels/scriptController.oxw
===================================================================
--- code/branches/presentationFS15/data/levels/scriptController.oxw	(revision 10498)
+++ code/branches/presentationFS15/data/levels/scriptController.oxw	(revision 10499)
@@ -1,6 +1,6 @@
 <!-- First levelFile of mkronig and samuezu. It was copied from dockingToASpaceStation.oxw and modified a little bit -->
 <LevelInfo
- name = "Fancy orxout tests"
- description = "Docking into a spacestation."
+ name = "Scriptable Controller"
+ description = "Showcase for Scriptable Controller"
  tags = "showcase"
  screenshot = "emptylevel.png"
@@ -11,15 +11,8 @@
   include("HUDTemplates3.oxo")
   include("templates/lodInformation.oxt")
-  include("templates/pickupRepresentationTemplates.oxt")
 ?>
 
 <?lua
-  include("templates/spaceshipAssff.oxt")
-  include("templates/spaceshipPirate.oxt")
   include("templates/spaceshipEscort.oxt")
-  include("templates/bigship.oxt")
-  include("templates/spaceshipTurret.oxt")
-  include("templates/spaceshipCollateralDamage.oxt")
-  include("templates/FPS.oxt")
 ?>
 
@@ -40,159 +33,35 @@
   >
 
-    <?lua
-      include("includes/pickups.oxi")
-    ?>
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0,1.0,1.0,0.5" specular="1.0, 0.9, 0.9, 1.0"/>
 
-    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0,1.0,1.0,0.5" specular="1.0, 0.9, 0.9, 1.0"/>
     <SpawnPoint team=0 position="3200,0,0" lookat="2800,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
 
-    <StaticEntity position  = "2800,0,0" mass=10000 collisionType=static >
+    <Billboard position="2500,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=10 />
+    <DistanceTrigger position="2500,0,0" distance="200" target="Pawn"
+      beaconMode="exclude" targetname="bcnDestroyer" name="takeControl"
+    />
+
+    <StaticEntity position  = "2000,500,2000" mass=10000 collisionType=static >
       <attached>
-        <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=50 />
+        <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=10 />
       </attached>
-      <collisionShapes>
-        <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
-        <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
-        <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
-        <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
-        <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
-        <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
-        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
-        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
-        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
-        <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
-        <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
-        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
-        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
-        <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
-        <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
-        <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
-      </collisionShapes>
     </StaticEntity>
 
-<!-- Docking  -->
-    <Dock position="2830,20,50" roll=0 yaw=0 >
-        <animations>
-            <MoveToDockingTarget target="destroyer" />
-        </animations>
-        <effects>
-            <DockToShip target="spaceShip" />
-        </effects>
+    <StaticEntity position  = "-1000,3000,-1000" mass=10000 collisionType=static >
+      <attached>
+        <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=80 />
+      </attached>
+    </StaticEntity>
+
+<!-- ControllerDirector waits for the event takeControl to attach a new Controller -->
+    <ControllerDirector position="0,0,0" scriptname="presentation">
         <events>
-            <execute>
-                <EventListener event="dockMe" />
-            </execute>
-
-	    <undocking>
-		<EventListener event="undockMe" />
-	    </undocking>
-	
-            <activity>
-                <EventListener event=notGameEnd />
-            </activity>
+            <takeControl>
+                <EventListener event="takeControl" />
+            </takeControl>
         </events>
-        <attached>
-	<!-- Trigger for docking with billboard -->
-
-		<!-- removed -->
-
-	<!-- Trigger for undocking with billboard -->
-	    <!-- <Billboard position="-2630,-19970,150" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 /> -->
-	    <DistanceTrigger position="-2630,-19970,150" distance="50" target="Pawn"
-                beaconMode="identify" targetname="bcnDestroyer" name="undockMe"
-            />
-        </attached>
-    </Dock>
-
-    <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=100 />
-    <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
-      beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
-    />
-
-
-<!-- Object, which orxouts the message "hello Universe!". EVENT NOT WORKING  -->
-    <ScriptController position="0,0,0">
-        <events>
-            <party>
-                <EventListener event="dockMe" />
-            </party>
-
-        </events>
-
-    </ScriptController>
-
-
-<!-- FPS Player as destination of the dock -->
-<FpsPlayer template = "fps" radarname = "First Person Player" position = "0,-19900,0" >
-      <attached>
-        <DockingTarget name="spaceShip" />
-        <DistanceTriggerBeacon name="bcnDestroyer" />
-        <DockingTarget name="destroyer" />
-      </attached>
-</FpsPlayer>
-
-
-<!-- Cube as test SpaceStation
-
-The station can either be hidden outside of the skybox, within the hull of the space station if it is big enough or within a planet.
-Complex spacestations can be placed very far away from the spaceship so it is rendered at low resolution while the player uses the space ship.
-
--->
-  <StaticEntity position="0,-20000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
-      <attached>
-        <Model position="0,0,0" mesh="crate.mesh" scale3D="80,80,5" />
-      </attached>
-      <collisionShapes>
-        <BoxCollisionShape position="0,0,0" halfExtents="400,400,25" />
-      </collisionShapes>
-  </StaticEntity>
-
-<!-- Homogenous gravitationfield to simulate local gravity (activating the normal gravity will affect the spaceship terribly) -->
-<ForceField position="0,-20000,0" mode="homogen" diameter="2000" forcedirection = "0,-500,0" />
-
-
-<!-- Some more stuff -->
-
-    <!-- triple large belt around the planet  -->
-    <?lua
-        dofile("includes/asteroidField.lua")
-        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
-    ?>
-    <?lua
-        dofile("includes/asteroidField.lua")
-        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
-    ?>
-    <?lua
-        dofile("includes/asteroidField.lua")
-        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
-    ?>
-
-    <Planet
-      position="15000,0,-1000"
-      scale="5000"
-      collisionType="dynamic"
-      linearDamping="0.8"
-      angularDamping="0"
-      mass="10000000"
-      pitch="0"
-      mesh="planets/ganymede.mesh"
-      atmosphere="atmosphere1"
-      rotationaxis="1,0,0"
-      rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
-      collisiondamage = 2
-      enablecollisiondamage = true
-    >
-      <attached>
-        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
-      </attached>
-      <collisionShapes>
-        <SphereCollisionShape radius="5000" position="0,0,0" />
-      </collisionShapes>
-    </Planet>
+    </ControllerDirector>
 
   </Scene>
-
 </Level>
 
Index: code/branches/presentationFS15/data/levels/templates/spaceshipRing.oxt
===================================================================
--- code/branches/presentationFS15/data/levels/templates/spaceshipRing.oxt	(revision 10498)
+++ code/branches/presentationFS15/data/levels/templates/spaceshipRing.oxt	(revision 10499)
@@ -46,8 +46,4 @@
       <Model position="11,1,-9" yaw=-90 pitch=0 roll=90 scale=0.15 mesh="ringWeapon.mesh" />
       <Model position="-11,1,-9" yaw=-90 pitch=0 roll=90 scale=0.15 mesh="ringWeapon.mesh" />
-<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
-<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
-<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
-<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
     </attached>
     <collisionShapes>
Index: code/branches/presentationFS15/src/orxonox/controllers/ControllerDirector.cc
===================================================================
--- code/branches/presentationFS15/src/orxonox/controllers/ControllerDirector.cc	(revision 10498)
+++ code/branches/presentationFS15/src/orxonox/controllers/ControllerDirector.cc	(revision 10499)
@@ -41,4 +41,5 @@
     {
         SUPER(ControllerDirector, XMLPort, xmlelement, mode);
+        XMLPortParam(ControllerDirector, "scriptname", setScriptName, getScriptName, xmlelement, mode).defaultValues("testscript");
 
         orxout(verbose)<< "ControllerDirector::XMLPort " 
@@ -83,5 +84,5 @@
        else
          return;
-       
+
        /* Set up a luastate to use for running the scripts */
        LuaState * ls = new LuaState();
@@ -98,6 +99,6 @@
         * variable "newctrlid" defined, which means it can make use of it.
         */
-
-       ls->doFile("testscript.lua");
+       std::string scr = this->scriptname_ + ".lua";
+       ls->doFile(scr);
 
        /* Increase the controller ID so we have a different one for
Index: code/branches/presentationFS15/src/orxonox/controllers/ControllerDirector.h
===================================================================
--- code/branches/presentationFS15/src/orxonox/controllers/ControllerDirector.h	(revision 10498)
+++ code/branches/presentationFS15/src/orxonox/controllers/ControllerDirector.h	(revision 10499)
@@ -47,4 +47,7 @@
             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
+            inline void setScriptName(const std::string& name) { this->scriptname_ = name; }
+            inline const std::string& getScriptName() const { return this->scriptname_; }
+
 
             /* Take over control of a given object */
@@ -55,5 +58,6 @@
             //void setNewController(Controller * controller);
 
-        private:
+        protected:
+            std::string scriptname_;   
             PlayerInfo* player_;
             ControllableEntity* entity_; 
