After getting the global_objects table, I need to push a string (effecttype), then do a lua_gettable(L, -2) in order to get the effecttype table.
lua_gettable(L, -2);
lua_pushstring(L, "water");
lua_gettable(L, -2);
One thing I have not yet clear is, what exactly are happening in the stack when calling the sequence above.
I know calling lua_getglobal give me a table which live in the lua global environment, but I wonder if the entire table STRUCTURE is push on the top of the stack, or any magic tag is being pushed so that the stack is able to give me the next table when do the pushstring and gettable.
Sorry for the newbie question, but I am fairly confused how the lua stack work. Any tips can help me to monitor the stack?
Thanks again!
Nelson
Ashwin Hirschi <deery@operamail.com> wrote: