lua-users home
lua-l archive

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


Excuse the noobishness, but, I didn't know you could do that... How do you do it? If I'd knew it would have been the first thing to try. xD

I looked at the manual and found 'lua_getstack', but how do you exactly use that?

Thanks again!

Wesley Smith wrote:
print out your stack to see what's going on.

wes

On 8/16/07, L-28C <kixdemp@gmail.com> wrote:
Okay, here's what I use:
------------
tolua_pushuserdata(Script, WalkLayer);
lua_setglobal(Script, "WalkLayer");
------------

It gives me this:
------------
PANIC: unprotected error in call to Lua API (./Maps/Legacy.map:19:
attempt to index global 'WalkLayer' (a nil value))
------------

And I don't even know why this is... WalkLayer is initialized. :-/

Help? Thanks!

Wesley Smith wrote:
lua_pushuserdata(L, class);

wes

On 8/16/07, L-28C <kixdemp@gmail.com> wrote:
Hello everyone!

Okay, how would I push an element of a custom type (it's a class object)
into the Lua stack? Said custom type has been binded (erm, bound?) with
toLua.

Hawlp? Thanks!