• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Global scope: callLuaField is undefined?

Source

Veteran OT User
Joined
May 31, 2020
Messages
226
Reaction score
311
Location
OpenTibia .dev
GitHub
source61
Hello. I'm trying to add some custom code to a new file custom.cpp with global scope and have it make calls to callLuaField.
I was able to make a new scope called g_custom and #include it in main.cpp, but even if after doing
Code:
#include <framework/luaengine/luaobject.h>
I still get this error:
Code:
Error (active)    E0020    identifier "callLuaField" is undefined    otclient    C:\Users\Adam\Documents\GitHub\otclient\src\custom.cpp    15
Error (active)    E0254    type name is not allowed    otclient    C:\Users\Adam\Documents\GitHub\otclient\src\custom.cpp    15   
Error    C3861    'callLuaField': identifier not found    otclient    C:\Users\Adam\Documents\GitHub\otclient\src\custom.cpp    15

Full code:
Code:
#include <custom.h>
#include <framework/luaengine/luaobject.h>

Custom g_custom;

Custom::Custom()
{
    
}

bool Custom::onMouseRelease(const Point& mousePos, Fw::MouseButton button)
{
    return callLuaField<bool>("onMouseRelease", mousePos, button);
}
 
Back
Top