Index: code/branches/script/cmake/FindLua.cmake
===================================================================
--- code/branches/script/cmake/FindLua.cmake	(revision 998)
+++ code/branches/script/cmake/FindLua.cmake	(revision 999)
@@ -32,10 +32,10 @@
 
 IF (NOT Lua_LIBRARIES)
-FIND_LIBRARY(Lua_LIBRARIES lua50 liblua
+FIND_LIBRARY(Lua_LIBRARIES lua50 lua
 	/usr/lib
 	/usr/local/lib
 	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
 
-FIND_LIBRARY(Lua_LIBRARY lualib50 liblualib
+FIND_LIBRARY(Lua_LIBRARY lualib50 lualib
 	/usr/lib
 	/usr/local/lib
Index: code/branches/script/cmake/FindToLua.cmake
===================================================================
--- code/branches/script/cmake/FindToLua.cmake	(revision 998)
+++ 	(revision )
@@ -1,31 +1,0 @@
-# Find Lua includes and library
-#
-# This module defines
-#  ToLua_INCLUDE_DIR
-#  ToLua_LIBRARIES, the libraries to link against to use Lua.
-#  ToLua_LIB_DIR, the location of the libraries
-#  ToLua_FOUND, If false, do not try to use Lua
-#
-# Copyright © 2007, Matt Williams
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-
-IF (ToLua_LIBRARIES)
-    SET(ToLua_FIND_QUIETLY TRUE) # Already in cache, be silent
-ENDIF (ToLua_LIBRARIES)
-
-FIND_LIBRARY(ToLua_LIBRARIES tolua++5.1
-	/usr/lib
-	/usr/local/lib)
-
-IF (ToLua_LIBRARIES)
-    SET(ToLua_FOUND TRUE)
-ENDIF (ToLua_LIBRARIES)
-
-IF (ToLua_FOUND)
-    MESSAGE(STATUS "Found ToLua: ${ToLua_LIBRARIES}")
-ELSE (ToLua_FOUND)
-    IF (ToLua_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "Could not find ToLua")
-    ENDIF (ToLua_FIND_REQUIRED)
-ENDIF (ToLua_FOUND)
Index: code/branches/script/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/script/src/orxonox/CMakeLists.txt	(revision 998)
+++ code/branches/script/src/orxonox/CMakeLists.txt	(revision 999)
@@ -32,6 +32,4 @@
   objects/weapon/BulletManager.cc
   objects/weapon/WeaponStation.cc
-  script/Script.cc
-  script/tolua_script.cc
 )
 
@@ -43,6 +41,4 @@
   ${OGRE_LIBRARIES}
   ${OIS_LIBRARIES}
-  ${Lua_LIBRARIES}
-  ${ToLua_LIBRARIES}
   util
   core
Index: code/branches/script/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/branches/script/src/orxonox/core/CMakeLists.txt	(revision 998)
+++ code/branches/script/src/orxonox/core/CMakeLists.txt	(revision 999)
@@ -18,4 +18,5 @@
   XMLPort.cc
   Tickable.cc
+  Script.cc
 )
 
@@ -25,3 +26,4 @@
 TARGET_LINK_LIBRARIES( core
   util
+  ${Lua_LIBRARIES}
 )
Index: code/branches/script/src/orxonox/core/Loader.cc
===================================================================
--- code/branches/script/src/orxonox/core/Loader.cc	(revision 998)
+++ code/branches/script/src/orxonox/core/Loader.cc	(revision 999)
@@ -33,5 +33,5 @@
 #include "Debug.h"
 #include "CoreIncludes.h"
-#include "../script/Script.h"
+#include "Script.h"
 
 #include "util/tinyxml/ticpp.h"
@@ -110,7 +110,8 @@
         // let Lua work this out:
         //Script* lua;
-        Script::loadFile(level->getFile(), true);
+        /*Script::loadFile(level->getFile(), true);
         Script::init(Script::getLuaState());
-        Script::run();
+        Script::run();*/
+        Script* lua = Script::getInstance();
 
         try
@@ -124,5 +125,5 @@
             ticpp::Document xmlfile;
             //xmlfile.ToDocument();
-            xmlfile.Parse(*Script::getFileString(), true);
+            xmlfile.Parse(lua->getLuaOutput(), true);
 
             for ( ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++ )
Index: code/branches/script/src/orxonox/core/Script.cc
===================================================================
--- code/branches/script/src/orxonox/core/Script.cc	(revision 999)
+++ code/branches/script/src/orxonox/core/Script.cc	(revision 999)
@@ -0,0 +1,252 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Script.h"
+
+#include <fstream>
+#include <map>
+
+#include "../core/CoreIncludes.h"
+
+extern "C" {
+#include "lualib.h"
+#include "lauxlib.h"
+}
+
+#include "tolua++.h"
+#include "toluabind.h"
+
+namespace orxonox
+{
+
+  Script::Script()
+  {
+    luaState_ = lua_open();
+    luaSource_ = "";
+    tolua_something_open(luaState_);
+  }
+
+  void Script::luaPrint(std::string str)
+  {
+    output_ = str;
+  }
+
+  /**
+      @brief Loads the specified file line by line
+      @param filename The filename of the file
+      @param luaTags if true, the loaded file gets stripped off luaTags
+  */
+  void Script::loadFile(std::string filename, bool luaTags)
+  {
+    std::ifstream file;
+    file.open(filename.c_str(), std::fstream::in);
+
+    if (!file.is_open())
+    {
+      // some error msg
+    }
+
+    char line[1024];
+    std::string levelString = "";
+
+    while (file.good() && !file.eof())
+    {
+      file.getline(line, 1024);
+      levelString += line;
+    }
+
+    file.close();
+    //std::string output;
+
+    if (luaTags) luaSource_ = replaceLuaTags(levelString);
+  }
+
+  void Script::run()
+  {
+    int error = 0;
+    std::string init = "local scr = orxonox.Script:new()\n";
+    init += luaSource_;
+    error = luaL_loadstring(luaState_, init.c_str());
+    if (error == 0)
+      error = lua_pcall(luaState_, 0, 0, 0);
+    if (error != 0) COUT(0) << "Error in Lua-script: " << lua_tostring(luaState_, -1) << std::endl;
+  }
+
+
+  unsigned int Script::getNextQuote(const std::string& text, unsigned int start)
+  {
+    unsigned int quote = start - 1;
+
+    while ((quote = text.find('\"', quote + 1)) != std::string::npos)
+    {
+      unsigned int backslash = quote;
+      unsigned int numbackslashes = 0;
+      for (; backslash > 0; backslash--, numbackslashes++)
+        if (text[backslash - 1] != '\\')
+          break;
+
+      if (numbackslashes % 2 == 0)
+        break;
+    }
+
+    return quote;
+  }
+
+  std::string Script::replaceLuaTags(const std::string& text)
+  {
+    // chreate map with all Lua tags
+    std::map<unsigned int, bool> luaTags;
+    {
+      unsigned int pos = 0;
+      while ((pos = text.find("<?lua", pos)) != std::string::npos)
+        luaTags[pos++] = true;
+    }
+    {
+      unsigned int pos = 0;
+      while ((pos = text.find("?>", pos)) != std::string::npos)
+        luaTags[pos++] = false;
+    }
+
+    // erase all tags from the map that are between two quotes
+    {
+      std::map<unsigned int, bool>::iterator it = luaTags.begin();
+      bool bBetweenQuotes = false;
+      unsigned int pos = 0;
+      while ((pos = getNextQuote(text, pos)) != std::string::npos)
+      {
+        while ((it != luaTags.end()) && ((*it).first < pos))
+        {
+          if (bBetweenQuotes)
+            luaTags.erase(it++);
+          else
+            ++it;
+        }
+        bBetweenQuotes = !bBetweenQuotes;
+        pos++;
+      }
+    }
+
+    // check whether on every opening <?lua tag a closing ?> tag follows
+    {
+      bool expectedValue = true;
+      for (std::map<unsigned int, bool>::iterator it = luaTags.begin(); it != luaTags.end(); ++it)
+      {
+        if ((*it).second == expectedValue)
+          expectedValue = !expectedValue;
+        else
+        {
+          expectedValue = false;
+          break;
+        }
+      }
+      if (!expectedValue) {
+        // todo: errorhandling
+        return "";
+      }
+    }
+
+    // cut the original string into pieces and put them together with print() instead of lua tags
+    std::string output;
+    {
+      std::map<unsigned int, bool>::iterator it = luaTags.begin();
+      bool bInPrintFunction = true;
+      unsigned int start = 0;
+      unsigned int end = 0;
+
+      do
+      {
+        if (it != luaTags.end())
+          end = (*(it++)).first;
+        else
+          end = std::string::npos;
+
+        unsigned int equalSignCounter = 0;
+
+        if (bInPrintFunction)
+        {
+          // count ['='[ and ]'='] and replace tags with print([[ and ]])
+          std::string temp = text.substr(start, end - start);
+          {
+            unsigned int pos = 0;
+            while ((pos = temp.find('[', pos)) != std::string::npos)
+            {
+              unsigned int tempCounter = 1;
+              unsigned int tempPos = pos++;
+              while(temp[++tempPos] == '=') {
+                tempCounter++;
+              }
+              if(temp[tempPos] != '[') {
+                tempCounter = 0;
+              }
+              else if(tempCounter == 0) {
+                tempCounter = 1;
+              }
+              if (tempCounter > equalSignCounter)
+                equalSignCounter = tempCounter;
+            }
+          }
+          {
+            unsigned int pos = 0;
+            while ((pos = temp.find(']', pos)) != std::string::npos)
+            {
+              unsigned int tempCounter = 1;
+              unsigned int tempPos = pos++;
+              while(temp[++tempPos] == '=') {
+                tempCounter++;
+              }
+              if(temp[tempPos] != ']') {
+                tempCounter = 0;
+              }
+              else if(tempCounter == 0) {
+                tempCounter = 1;
+              }
+              if (tempCounter > equalSignCounter)
+                equalSignCounter = tempCounter;
+            }
+          }
+          std::string equalSigns = "";
+          for(unsigned int i = 0; i < equalSignCounter; i++) {
+            equalSigns += "=";
+          }
+          output += "scr:luaPrint([" + equalSigns + "[" + temp + "]" + equalSigns +"])\n";
+          start = end + 5;
+        }
+        else
+        {
+          output += text.substr(start, end - start);
+          start = end + 2;
+        }
+
+        bInPrintFunction = !bInPrintFunction;
+      }
+      while (end != std::string::npos);
+    }
+
+    return output;
+  }
+
+}
Index: code/branches/script/src/orxonox/core/Script.h
===================================================================
--- code/branches/script/src/orxonox/core/Script.h	(revision 999)
+++ code/branches/script/src/orxonox/core/Script.h	(revision 999)
@@ -0,0 +1,49 @@
+/**
+ @file  script.h
+ @brief Representation of an interface to lua
+ @author Benjamin Knecht <beni_at_orxonox.net>
+ */
+
+#ifndef _Script_H__
+#define _Script_H__
+
+extern "C" {
+#include "lua.h"
+}
+
+#include <list>
+#include <string>
+
+namespace orxonox // tolua_export
+{ // tolua_export
+
+  class Script // tolua_export
+  { // tolua_export
+    public:
+      inline static Script* getInstance() { if (!Script::singletonRef) Script::singletonRef = new Script(); return Script::singletonRef; }
+      inline ~Script() { Script::singletonRef = NULL; };
+
+    void loadFile(std::string filename, bool luaTags);
+    //void init(lua_State *state_);
+    //void xmlToLua();
+    void run();
+    void luaPrint(std::string str); // tolua_export
+
+    inline lua_State* getLuaState() { return luaState_; };
+    inline std::string getLuaOutput() { return output_; };
+    //inline std::string* getFileString() { return &fileString_; };
+
+    unsigned int getNextQuote(const std::string& text, unsigned int start);
+    std::string replaceLuaTags(const std::string& text);
+
+    private:
+      Script();
+      static Script* singletonRef;
+
+      std::string luaSource_;
+      std::string output_;
+      lua_State* luaState_;
+
+  }; // tolua_export
+} // tolua_export
+#endif /* _Script_H__ */
Index: code/branches/script/src/orxonox/core/tolua.pkg
===================================================================
--- code/branches/script/src/orxonox/core/tolua.pkg	(revision 999)
+++ code/branches/script/src/orxonox/core/tolua.pkg	(revision 999)
@@ -0,0 +1,1 @@
+$cfile "Script.h"
Index: code/branches/script/src/orxonox/script/Script.cc
===================================================================
--- code/branches/script/src/orxonox/script/Script.cc	(revision 998)
+++ 	(revision )
@@ -1,279 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Benjamin Knecht
- *   Co-authors:
- *      ...
- *
- */
-
-#include "Script.h"
-
-#include <fstream>
-#include <map>
-
-#include "../core/CoreIncludes.h"
-
-extern "C" {
-#include "lualib.h"
-#include "lauxlib.h"
-}
-
-#include "tolua++.h"
-#include "tolua_script.h"
-
-namespace orxonox
-{
-
-  lua_State* Script::luaState_ = lua_open();
-  //lua_State* Script::luaState_ = NULL;
-  std::string Script::fileString_ = "";
-
-  Script::Script()
-  {
-  }
-
-  Script::~Script()
-  {
-
-  }
-
-  /**
-      @brief Initializes a lua state
-      @param state_ the pointer of the lua_state to initialise
-  */
-  void Script::init(lua_State *state_)
-  {
-    tolua_script_open(state_);
-
-    /*
-#if LUA_VERSION_NUM == 501
-    luaL_openlibs(state_);
-#else
-    luaopen_base(state_);
-    luaopen_table(state_);
-    luaopen_io(state_);
-    luaopen_string(state_);
-    luaopen_math(state_);
-    luaopen_debug(state_);
-#endif
-    */
-  }
-
-  void Script::luaPrint(std::string str)
-  {
-    fileString_ = str;
-  }
-
-  /**
-      @brief Loads the specified file line by line
-      @param filename The filename of the file
-      @param luaTags if true, the loaded file gets stripped off luaTags
-  */
-  void Script::loadFile(std::string filename, bool luaTags)
-  {
-    std::ifstream file;
-    file.open(filename.c_str(), std::fstream::in);
-
-    if (!file.is_open())
-    {
-      // some error msg
-    }
-
-    char line[1024];
-
-    while (file.good() && !file.eof())
-    {
-      file.getline(line, 1024);
-      fileString_ += line;
-    }
-
-    file.close();
-    //std::string output;
-
-    if (luaTags) fileString_ = replaceLuaTags(Script::fileString_);
-  }
-
-  void Script::run()
-  {
-    int error = 0;
-    std::string init = "local scr = orxonox.Script:new()\n";
-    init += fileString_;
-    error = luaL_loadstring(luaState_, init.c_str());
-    if (error == 0)
-      error = lua_pcall(luaState_, 0, 0, 0);
-    if (error != 0) COUT(0) << "Error in Lua-script: " << lua_tostring(luaState_, -1) << std::endl;
-  }
-
-
-  unsigned int Script::getNextQuote(const std::string& text, unsigned int start)
-  {
-    unsigned int quote = start - 1;
-
-    while ((quote = text.find('\"', quote + 1)) != std::string::npos)
-    {
-      unsigned int backslash = quote;
-      unsigned int numbackslashes = 0;
-      for (; backslash > 0; backslash--, numbackslashes++)
-        if (text[backslash - 1] != '\\')
-          break;
-
-      if (numbackslashes % 2 == 0)
-        break;
-    }
-
-    return quote;
-  }
-
-  std::string Script::replaceLuaTags(const std::string& text)
-  {
-    // chreate map with all Lua tags
-    std::map<unsigned int, bool> luaTags;
-    {
-      unsigned int pos = 0;
-      while ((pos = text.find("<?lua", pos)) != std::string::npos)
-        luaTags[pos++] = true;
-    }
-    {
-      unsigned int pos = 0;
-      while ((pos = text.find("?>", pos)) != std::string::npos)
-        luaTags[pos++] = false;
-    }
-
-    // erase all tags from the map that are between two quotes
-    {
-      std::map<unsigned int, bool>::iterator it = luaTags.begin();
-      bool bBetweenQuotes = false;
-      unsigned int pos = 0;
-      while ((pos = getNextQuote(text, pos)) != std::string::npos)
-      {
-        while ((it != luaTags.end()) && ((*it).first < pos))
-        {
-          if (bBetweenQuotes)
-            luaTags.erase(it++);
-          else
-            ++it;
-        }
-        bBetweenQuotes = !bBetweenQuotes;
-        pos++;
-      }
-    }
-
-    // check whether on every opening <?lua tag a closing ?> tag follows
-    {
-      bool expectedValue = true;
-      for (std::map<unsigned int, bool>::iterator it = luaTags.begin(); it != luaTags.end(); ++it)
-      {
-        if ((*it).second == expectedValue)
-          expectedValue = !expectedValue;
-        else
-        {
-          expectedValue = false;
-          break;
-        }
-      }
-      if (!expectedValue) {
-        // todo: errorhandling
-        return "";
-      }
-    }
-
-    // cut the original string into pieces and put them together with print() instead of lua tags
-    std::string output;
-    {
-      std::map<unsigned int, bool>::iterator it = luaTags.begin();
-      bool bInPrintFunction = true;
-      unsigned int start = 0;
-      unsigned int end = 0;
-
-      do
-      {
-        if (it != luaTags.end())
-          end = (*(it++)).first;
-        else
-          end = std::string::npos;
-
-        unsigned int equalSignCounter = 0;
-
-        if (bInPrintFunction)
-        {
-          // count ['='[ and ]'='] and replace tags with print([[ and ]])
-          std::string temp = text.substr(start, end - start);
-          {
-            unsigned int pos = 0;
-            while ((pos = temp.find('[', pos)) != std::string::npos)
-            {
-              unsigned int tempCounter = 1;
-              unsigned int tempPos = pos++;
-              while(temp[++tempPos] == '=') {
-                tempCounter++;
-              }
-              if(temp[tempPos] != '[') {
-                tempCounter = 0;
-              }
-              else if(tempCounter == 0) {
-                tempCounter = 1;
-              }
-              if (tempCounter > equalSignCounter)
-                equalSignCounter = tempCounter;
-            }
-          }
-          {
-            unsigned int pos = 0;
-            while ((pos = temp.find(']', pos)) != std::string::npos)
-            {
-              unsigned int tempCounter = 1;
-              unsigned int tempPos = pos++;
-              while(temp[++tempPos] == '=') {
-                tempCounter++;
-              }
-              if(temp[tempPos] != ']') {
-                tempCounter = 0;
-              }
-              else if(tempCounter == 0) {
-                tempCounter = 1;
-              }
-              if (tempCounter > equalSignCounter)
-                equalSignCounter = tempCounter;
-            }
-          }
-          std::string equalSigns = "";
-          for(unsigned int i = 0; i < equalSignCounter; i++) {
-            equalSigns += "=";
-          }
-          output += "scr:luaPrint([" + equalSigns + "[" + temp + "]" + equalSigns +"])\n";
-          start = end + 5;
-        }
-        else
-        {
-          output += text.substr(start, end - start);
-          start = end + 2;
-        }
-
-        bInPrintFunction = !bInPrintFunction;
-      }
-      while (end != std::string::npos);
-    }
-
-    return output;
-  }
-
-}
Index: code/branches/script/src/orxonox/script/Script.h
===================================================================
--- code/branches/script/src/orxonox/script/Script.h	(revision 998)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/**
- @file  script.h
- @brief Representation of an interface to lua
- @author Benjamin Knecht <beni_at_orxonox.net>
- */
-
-#ifndef _Script_H__
-#define _Script_H__
-
-extern "C" {
-#include "lua.h"
-}
-
-#include <list>
-#include <string>
-
-namespace orxonox // tolua_export
-{ // tolua_export
-
-  class Script // tolua_export
-  { // tolua_export
-    public:
-    Script(); // tolua_export
-    ~Script();
-
-    static void loadFile(std::string filename, bool luaTags);
-    static void init(lua_State *state_);
-    //void xmlToLua();
-    static void run();
-    void luaPrint(std::string str); // tolua_export
-
-    inline static lua_State* getLuaState() { return luaState_; };
-    inline static std::string* getFileString() { return &fileString_; };
-
-    static unsigned int getNextQuote(const std::string& text, unsigned int start);
-    static std::string replaceLuaTags(const std::string& text);
-
-    private:
-
-      //std::list<std::string>& getLevelFileLines();
-
-      static std::string fileString_;
-      static lua_State* luaState_;
-
-  }; // tolua_export
-} // tolua_export
-#endif /* _Script_H__ */
Index: code/branches/script/src/orxonox/script/tolua_script.cc
===================================================================
--- code/branches/script/src/orxonox/script/tolua_script.cc	(revision 998)
+++ 	(revision )
@@ -1,157 +1,0 @@
-/*
-** Lua binding: script
-** Generated automatically by tolua++-1.0.92 on Sat Apr  5 20:29:18 2008.
-*/
-
-#ifndef __cplusplus
-#include "stdlib.h"
-#endif
-#include "string.h"
-
-#include "tolua++.h"
-
-/* Exported function */
-TOLUA_API int  tolua_script_open (lua_State* tolua_S);
-
-#include "Script.h"
-
-/* function to release collected object via destructor */
-#ifdef __cplusplus
-
-static int tolua_collect_orxonox__Script (lua_State* tolua_S)
-{
- orxonox::Script* self = (orxonox::Script*) tolua_tousertype(tolua_S,1,0);
-	Mtolua_delete(self);
-	return 0;
-}
-#endif
-
-
-/* function to register type */
-static void tolua_reg_types (lua_State* tolua_S)
-{
- tolua_usertype(tolua_S,"orxonox::Script");
-}
-
-/* method: new of class  orxonox::Script */
-#ifndef TOLUA_DISABLE_tolua_script_orxonox_Script_new00
-static int tolua_script_orxonox_Script_new00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  {
-   orxonox::Script* tolua_ret = (orxonox::Script*)  Mtolua_new((orxonox::Script)());
-    tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
-  }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: new_local of class  orxonox::Script */
-#ifndef TOLUA_DISABLE_tolua_script_orxonox_Script_new00_local
-static int tolua_script_orxonox_Script_new00_local(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  {
-   orxonox::Script* tolua_ret = (orxonox::Script*)  Mtolua_new((orxonox::Script)());
-    tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
-    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-  }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: luaPrint of class  orxonox::Script */
-#ifndef TOLUA_DISABLE_tolua_script_orxonox_Script_luaPrint00
-static int tolua_script_orxonox_Script_luaPrint00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertype(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
-     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  orxonox::Script* self = (orxonox::Script*)  tolua_tousertype(tolua_S,1,0);
-  char* str = ((char*)  tolua_tostring(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'luaPrint'",NULL);
-#endif
-  {
-   self->luaPrint(str);
-  }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'luaPrint'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* Open function */
-TOLUA_API int tolua_script_open (lua_State* tolua_S)
-{
- tolua_open(tolua_S);
- tolua_reg_types(tolua_S);
- tolua_module(tolua_S,NULL,0);
- tolua_beginmodule(tolua_S,NULL);
-  tolua_module(tolua_S,"orxonox",0);
-  tolua_beginmodule(tolua_S,"orxonox");
-   #ifdef __cplusplus
-   tolua_cclass(tolua_S,"Script","orxonox::Script","",tolua_collect_orxonox__Script);
-   #else
-   tolua_cclass(tolua_S,"Script","orxonox::Script","",NULL);
-   #endif
-   tolua_beginmodule(tolua_S,"Script");
-    tolua_function(tolua_S,"new",tolua_script_orxonox_Script_new00);
-    tolua_function(tolua_S,"new_local",tolua_script_orxonox_Script_new00_local);
-    tolua_function(tolua_S,".call",tolua_script_orxonox_Script_new00_local);
-    tolua_function(tolua_S,"luaPrint",tolua_script_orxonox_Script_luaPrint00);
-   tolua_endmodule(tolua_S);
-  tolua_endmodule(tolua_S);
- tolua_endmodule(tolua_S);
- return 1;
-}
-
-
-#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
- TOLUA_API int luaopen_script (lua_State* tolua_S) {
- return tolua_script_open(tolua_S);
-};
-#endif
-
Index: code/branches/script/src/orxonox/script/tolua_script.h
===================================================================
--- code/branches/script/src/orxonox/script/tolua_script.h	(revision 998)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
-** Lua binding: script
-** Generated automatically by tolua++-1.0.92 on Sat Apr  5 20:29:18 2008.
-*/
-
-/* Exported function */
-TOLUA_API int  tolua_script_open (lua_State* tolua_S);
-
Index: code/branches/script/src/orxonox/script/tolua_script.pkg
===================================================================
--- code/branches/script/src/orxonox/script/tolua_script.pkg	(revision 998)
+++ 	(revision )
@@ -1,1 +1,0 @@
-$cfile "Script.h"
Index: code/branches/script/src/util/tolua_bind.cc
===================================================================
--- code/branches/script/src/util/tolua_bind.cc	(revision 999)
+++ code/branches/script/src/util/tolua_bind.cc	(revision 999)
@@ -0,0 +1,157 @@
+/*
+** Lua binding: script
+** Generated automatically by tolua++-1.0.92 on Sat Apr  5 20:29:18 2008.
+*/
+
+#ifndef __cplusplus
+#include "stdlib.h"
+#endif
+#include "string.h"
+
+#include "tolua++.h"
+
+/* Exported function */
+TOLUA_API int  tolua_script_open (lua_State* tolua_S);
+
+#include "Script.h"
+
+/* function to release collected object via destructor */
+#ifdef __cplusplus
+
+static int tolua_collect_orxonox__Script (lua_State* tolua_S)
+{
+ orxonox::Script* self = (orxonox::Script*) tolua_tousertype(tolua_S,1,0);
+	Mtolua_delete(self);
+	return 0;
+}
+#endif
+
+
+/* function to register type */
+static void tolua_reg_types (lua_State* tolua_S)
+{
+ tolua_usertype(tolua_S,"orxonox::Script");
+}
+
+/* method: new of class  orxonox::Script */
+#ifndef TOLUA_DISABLE_tolua_script_orxonox_Script_new00
+static int tolua_script_orxonox_Script_new00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   orxonox::Script* tolua_ret = (orxonox::Script*)  Mtolua_new((orxonox::Script)());
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: new_local of class  orxonox::Script */
+#ifndef TOLUA_DISABLE_tolua_script_orxonox_Script_new00_local
+static int tolua_script_orxonox_Script_new00_local(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   orxonox::Script* tolua_ret = (orxonox::Script*)  Mtolua_new((orxonox::Script)());
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: luaPrint of class  orxonox::Script */
+#ifndef TOLUA_DISABLE_tolua_script_orxonox_Script_luaPrint00
+static int tolua_script_orxonox_Script_luaPrint00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
+     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  orxonox::Script* self = (orxonox::Script*)  tolua_tousertype(tolua_S,1,0);
+  char* str = ((char*)  tolua_tostring(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'luaPrint'",NULL);
+#endif
+  {
+   self->luaPrint(str);
+  }
+ }
+ return 0;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'luaPrint'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* Open function */
+TOLUA_API int tolua_script_open (lua_State* tolua_S)
+{
+ tolua_open(tolua_S);
+ tolua_reg_types(tolua_S);
+ tolua_module(tolua_S,NULL,0);
+ tolua_beginmodule(tolua_S,NULL);
+  tolua_module(tolua_S,"orxonox",0);
+  tolua_beginmodule(tolua_S,"orxonox");
+   #ifdef __cplusplus
+   tolua_cclass(tolua_S,"Script","orxonox::Script","",tolua_collect_orxonox__Script);
+   #else
+   tolua_cclass(tolua_S,"Script","orxonox::Script","",NULL);
+   #endif
+   tolua_beginmodule(tolua_S,"Script");
+    tolua_function(tolua_S,"new",tolua_script_orxonox_Script_new00);
+    tolua_function(tolua_S,"new_local",tolua_script_orxonox_Script_new00_local);
+    tolua_function(tolua_S,".call",tolua_script_orxonox_Script_new00_local);
+    tolua_function(tolua_S,"luaPrint",tolua_script_orxonox_Script_luaPrint00);
+   tolua_endmodule(tolua_S);
+  tolua_endmodule(tolua_S);
+ tolua_endmodule(tolua_S);
+ return 1;
+}
+
+
+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
+ TOLUA_API int luaopen_script (lua_State* tolua_S) {
+ return tolua_script_open(tolua_S);
+};
+#endif
+
Index: code/branches/script/src/util/tolua_bind.h
===================================================================
--- code/branches/script/src/util/tolua_bind.h	(revision 999)
+++ code/branches/script/src/util/tolua_bind.h	(revision 999)
@@ -0,0 +1,8 @@
+/*
+** Lua binding: script
+** Generated automatically by tolua++-1.0.92 on Sat Apr  5 20:29:18 2008.
+*/
+
+/* Exported function */
+TOLUA_API int  tolua_script_open (lua_State* tolua_S);
+
