Original Post
i want to add a global variable with userdata in it. i made a struct: and i wanted to add it by calling: but when i call:
struct somedata {
int a;
int b;
};
somedata *tdata = (somedata*)lua_newuserdata(L,sizeof(somedata));
tdata->a = 10;
lua_setglobal(L,"somedata");
print(somedata.a)
in the script. nothing happens.