[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Help getting local variables from Lua
- From: Wim Couwenberg <w.couwenberg@...>
- Date: Sun, 19 Jun 2005 13:48:35 +0200
-- in lua script i have --------
local SELF = {}
function SELF.onDamage( )
-- do some stuff
end
Locals are not stored in a table. The SELF in your example will simply
get collected some time after the script has run since there are no
references to SELF left.
There are basically two approaches:
1) Drop the "local" to make SELF a global and you can access that
easily. Globals are stored in the script's environment.
2) Explicitly "return SELF" at the end of the script to obtain a
reference to it.
--
Wim