Date: Thu, 01 Sep 2005 08:18:21 +0200
From: Mario <www.derfordfahrer@gmx.de>
Subject: calling fcuntion from other lua context
To: lua@bazar2.conectiva.com.br
Message-ID: <43169D2D.7000806@gmx.de>
Content-Type: text/plain; charset=us-ascii
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