lua-users home
lua-l archive

[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( )


script 2:
function CObject:OnLogic( )
	-- do nothing

function CObject:some_function( )
	io.write("Hi there!\n")

I'm getting the error message "attempt to call method `some_function' (a
nil value)"?

Thank you in advance!
Greetings Mario