Sign in to follow this  

Quick Lua noob question

This topic is 4592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

void KeyDown(unsigned char key) {
		lua_getglobal(pLuaState,"KeyDown");
		if(key==DIK_LEFT) {
			lua_pushstring(pLuaState,"left");
		}
		else if(key==DIK_RIGHT) {
			lua_pushstring(pLuaState,"right");
		}
		else
			lua_pushnil(pLuaState);

		if(lua_pcall(pLuaState,1,0,0)) {
			OutputDebugString(lua_tostring(pLuaState,-1));
			OutputDebugString("\n");
		}
		
	}

lua_pcall fails and the debug code prints out "attempt to call a nil value" How would I go about tracking down what causes this? Thanks

Share this post


Link to post
Share on other sites

This topic is 4592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this