Index: /branches/script_engine/src/lib/script_engine/Makefile.am
===================================================================
--- /branches/script_engine/src/lib/script_engine/Makefile.am	(revision 8100)
+++ /branches/script_engine/src/lib/script_engine/Makefile.am	(revision 8101)
@@ -1,4 +1,10 @@
 MAINSRCDIR=../..
 include $(MAINSRCDIR)/defs/include_paths.am
+
+
+LIB_PREFIX=$(MAINSRCDIR)/lib
+include $(MAINSRCDIR)/lib/BuildLibs.am
+
+
 
 INCLUDES= -I../../../extern_libs
@@ -13,15 +19,6 @@
 
 bin_PROGRAMS = example
-example_SOURCES = \
-		example.cc \
-		\
-		../util/executor/executor_lua.cc
 
 
-
-
-example_LDADD = libORXscript.a -L../../../extern_libs @LUA_LIBS@
-
-#main_LDFLAGS =
 
 
@@ -31,2 +28,22 @@
                 script.h\
                 script_manager.h
+
+
+
+example_DEPENDENCIES = \
+		$(MAINSRCDIR)/world_entities/libORXwe.a \
+		$(libORXlibs_a_LIBRARIES_) \
+		$(MAINSRCDIR)/util/libORXutils.a
+
+example_LDADD = \
+		$(MAINSRCDIR)/util/libORXutils.a \
+		$(libORXlibs_a_LIBRARIES_) \
+		libORXscript.a -L../../../extern_libs @LUA_LIBS@ \
+		$(MAINSRCDIR)/world_entities/libORXwe.a \
+		$(libORXlibs_a_LIBRARIES_) \
+		$(MAINSRCDIR)/util/libORXutils.a
+
+example_SOURCES= \
+		example.cc \
+		\
+		../util/executor/executor_lua.cc
Index: /branches/script_engine/src/lib/script_engine/example.cc
===================================================================
--- /branches/script_engine/src/lib/script_engine/example.cc	(revision 8100)
+++ /branches/script_engine/src/lib/script_engine/example.cc	(revision 8101)
@@ -6,5 +6,6 @@
 #include "script.h"
 
-    class Account {
+
+    class Account : public BaseObject {
       lua_Number m_balance;
     public:
@@ -14,4 +15,9 @@
       Account(lua_State *L)      { m_balance = luaL_checknumber(L, 1); }
       Account(double balance=0)    : m_balance(balance) { }
+
+      void deposit (float value) { m_balance += value; };
+      void withdraw(float value) { m_balance -= value; };
+      float balance() { return m_balance; };;;;;;;;;;;;;;
+
       int deposit (lua_State *L) { m_balance += luaL_checknumber(L, 1); return 0; }
       int withdraw(lua_State *L) { m_balance -= luaL_checknumber(L, 1); return 0; }
@@ -26,12 +32,12 @@
 
     Lunar<Account>::RegType Account::methods[] = {
-      method(Account, deposit),
-      method(Account, withdraw),
-      method(Account, balance),
-      {0,0}
+      {"deposit", new ExecutorLua1<Account, float>(&Account::deposit)},
+      {"withdraw", new ExecutorLua1<Account, float>(&Account::withdraw)},
+      {"balance", new ExecutorLua0ret<Account, float>(&Account::balance)},
+      {0,NULL}
     };
 
 
-    class Object {
+    class Object : public BaseObject {
       public:
         static const char className[];
@@ -47,5 +53,5 @@
         {
          int calls = getCallCount();
-         lua_pushnumber(L,(lua_Number)calls); 
+         lua_pushnumber(L,(lua_Number)calls);
          return 1; // return number of values that the function wants to return to lua
         }
@@ -53,8 +59,8 @@
          //function that takes an argument from lua
          int takeParam(lua_State* L)
-         { 
+         {
           int param = (int)lua_tonumber(L,-1);
           takeParam(param);
-          return 0; 
+          return 0;
          }
 
@@ -67,10 +73,15 @@
         int printName(lua_State* L)
         {
-          callCount ++;
-          printf("Hi i'm object %p ! This is the %i. call.\n",this,callCount);
+          this->printName();
           return 0;
         }
 
-        int getCallCount(){return callCount;}
+        void printName()
+        {
+          callCount ++;
+          printf("Hi i'm object %p ! This is the %i. call.\n",this,callCount);
+        }
+
+        int getCallCount(){ return callCount; }
 
       private:
@@ -82,7 +93,7 @@
 
     Lunar<Object>::RegType Object::methods[] = {
-      method(Object, printName),
-      method(Object, getCallCount),
-      method(Object, takeParam),
+      {"printName", new ExecutorLua0<Object>(&Object::printName)},
+      {"getCallCount", new ExecutorLua0ret<Object, int>(&Object::getCallCount)},
+      {"takeParam", new ExecutorLua1<Object, int>(&Object::takeParam)},
       {0,0}
     };
@@ -123,5 +134,5 @@
       float retf = script.getReturnedFloat();
       printf("main returned %f\n",retf);
-      
+
 
       if(script.getReturnedBool())
@@ -142,5 +153,5 @@
       script.executeFunction();
 
-      
+
       //if(argc>1) lua_dofile(script.getLuaState(), argv[1]);
       printf("-------------------------- top of the stack:%i\n",lua_gettop(script.getLuaState()));
Index: /branches/script_engine/src/lib/script_engine/lunar.h
===================================================================
--- /branches/script_engine/src/lib/script_engine/lunar.h	(revision 8100)
+++ /branches/script_engine/src/lib/script_engine/lunar.h	(revision 8101)
@@ -13,5 +13,5 @@
       typedef struct { T *pT; } userdataType;
     public:
-      typedef int (T::*mfp)(lua_State *L);
+      typedef Executor* mfp;
       typedef struct { const char *name; mfp mfunc; } RegType;
 
@@ -164,5 +164,7 @@
         // get member function from upvalue
         RegType *l = static_cast<RegType*>(lua_touserdata(L, lua_upvalueindex(1)));
-        return (obj->*(l->mfunc))(L);  // call member function
+        int value;
+        (*l->mfunc)(obj, value, L);  // call member function
+        return value;
       }
 
Index: /branches/script_engine/src/lib/util/executor/executor_lua.h
===================================================================
--- /branches/script_engine/src/lib/util/executor/executor_lua.h	(revision 8100)
+++ /branches/script_engine/src/lib/util/executor/executor_lua.h	(revision 8101)
@@ -75,4 +75,6 @@
       return new ExecutorLua0<T>(ExecutorLua0<T>(this->functionPointer));
     }
+  private:
+    void          (T::*functionPointer)();
 };
 
@@ -122,4 +124,6 @@
       return new ExecutorLua1<T, type0>((this->functionPointer));
     }
+  private:
+    void          (T::*functionPointer)(type0);
 };
 
@@ -171,4 +175,6 @@
       return new ExecutorLua2<T, type0, type1>(this->functionPointer);
     }
+  private:
+    void          (T::*functionPointer)(type0, type1);
 };
 
@@ -227,4 +233,6 @@
       return new ExecutorLua0ret<T, ret>(this->functionPointer);
     }
+  private:
+    ret           (T::*functionPointer)();
 };
 
@@ -275,4 +283,6 @@
       return new ExecutorLua1ret<T, ret, type0>(this->functionPointer);
     }
+  private:
+    ret           (T::*functionPointer)(type0);
 };
 
@@ -322,4 +332,6 @@
       return new ExecutorLua2ret<T, ret, type0, type1>(this->functionPointer);
     }
+  private:
+    ret           (T::*functionPointer)(type0, type1);
 };
 
