Hi.
I want to call some of WoWs luafunctions.
I don't really want to use Framescript__execute alias lua_doString as its a pain to retrieve values and its not very flexible as every value has to be converted to ASCII.
So I want to do it using luaengine-functions. This is how I attempted to call CastSpellById:
I am fetching the lua_State referenced in lua_doString.void WrappedLua::CastSpellById(float spellId, const char* spellTarget)
{
int argc = 0;
lua_getglobal(lua, "CastSpellByID");
lua_pushnumber(lua, spellId);
argc++;
if(spellTarget)
{
lua_pushstring(lua, spellTarget);
argc++;
}
lua_pcall(lua, argc, 0, 0);
}
But its failing, some functions produce access violations.
Its important to notice I don't call WoWs luafunctions, I inject my own luaengine and feed it with WoWs lua_State. (lua 5.14)
Obviously there seem to be incompatible things.
So my question is: Is anyone doing something similar? If yes, which version of lua do you use? Or maybe better said: What version of lua is WoW using?
I didn't play WoW when it was beta, was lua always a part of WoW ?