|
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 .....