lua-users home
lua-l archive

calling fcuntion from other lua context

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


Hi all!
I have some c++ objects, all with their own lua context. How is it
possible to call a lua function from one lua context to an another one?
For example:
script 1:
function CObject:OnLogic( )
 local a = wmanager:getEntityByName( "NewObject" );
 a:some_function( )
end
script 2:
function CObject:OnLogic( )
	-- do nothing
end
function CObject:some_function( )
	io.write("Hi there!\n")
end
I'm getting the error message "attempt to call method `some_function' (a
nil value)"?
Thank you in advance!
Greetings Mario

AltStyle によって変換されたページ (->オリジナル) /