lua-users home
lua-l archive

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

Which version of Lua are you using? As one of Lua's authors recently informed the mailing list,
> src/lgc.c
 > C functions also may have stacks larger than current top
I wonder if your problem is related to that bug, which has been fixed in the latest Lua update (Lua 5.0.1) and is available here


-----Original Message-----
From: sohyl siddiqui []
Sent: Tuesday, October 07, 2003 10:17 PM
Subject: problem using LUA ....

i am working on a 3d fps engine and i am using LUA for engine initializtion, model/map loading, NPC scripting and fro cutscenes......
i am facing a problem with lua ....... and i'm not really sure wats the cause ......
the thing is that i created a  long cutscene in which various maps were being loaded as well as a large number of models ....... and many global variables were being created using :
lua_pushstring( L, value);

lua_setglobal( L, varName);

i have kept the scripting logic very simple and currenty i am using only ifelse checks to control the cutscene ....... (i know that's not good programming .... but ...) now the problem that i was facing was that i set up a global variable late in the script ...... and then check it in a if check:

if corpse4_state == "CHECK_DEMO_STATE" then

now even though the call to lua to setup the global variable with the specified value was being made ..... this check was never true ..... i just cudn't figure wat the problem was (i don't know much lua) ....... then i thought that maybe there was a problem with the size of the stack of LUA which is used to exchange variables with C++ ...... so i reset the stack using:

lua_settop(m_pLUAState, 0);

before setting this particular variable ....... but that didn't help either ...... then finally i removed code for adding some models ...... and then it worked correctly ...... i don't know wat why it did ...... ? is there some memory related problem or is there something that i am doing ...... need help with  this ...... hope that i have expressed myself clearly .....

Do you Yahoo!?
The New Yahoo! Shopping - with improved product search