lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi All !
 
 
At least time i use Lua in my Project, i have see it first in the game WOW and have
happy write an AddOn.
 
Now in my C++ source i have all what i need to use debugs callbacks and so on.
but one problem i have, i like not the "this" statement in my luascript
in my c++ i must say late

lua_setglobal (m_pState, "this");

my lua script looks now so:

function this.test (this, x, y)
trace (this:Hello1())
return x + y
end

trace is print function in my c++ i call test from C++  and get the callback from Hello
an self defined function in my cpp.
in initpart of cpp  i can say

lua_setglobal (m_pState, "Dog");

and in Lua i must then use that

 function Dog.test (this, x, y)
trace (Dog:Hello1())
return x + y
end

i will not see this or other statements is that possible ?
thanks for help sorry for easy english here :-)
greetings to all