• 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!

TFS 1.X+ How to github? Watch fix?

btw if you getting error on compiling latest tfs its most likely because you are missing the recently required new library called "fmt" , depending on which system you are compiling your server at, just look for the tutorial in the wiki as we have updated most of them to include the fmt installation

 
Any idea why I'm getting this error when compiling with this fix?

C++:
In file included from /home/otsmanager/custom/src/luascript.cpp:24:
/home/otsmanager/custom/src/luascript.cpp: In static member function ‘static int LuaScriptInterface::luaAddEvent(lua_State*)’:
/home/otsmanager/custom/src/luascript.cpp:3590:19: error: ‘fmt’ has not been declared
3590 |   reportErrorFunc(fmt::format("Not enough parameters: {:d}.", parameters));
      |                   ^~~
/home/otsmanager/custom/src/luascript.h:180:55: note: in definition of macro ‘reportErrorFunc’
  180 | #define reportErrorFunc(a)  reportError(__FUNCTION__, a, true)
      |                                                       ^
make[2]: *** [CMakeFiles/tfs.dir/build.make:604: CMakeFiles/tfs.dir/src/luascript.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Post automatically merged:

btw if you getting error on compiling latest tfs its most likely because you are missing the recently required new library called "fmt" , depending on which system you are compiling your server at, just look for the tutorial in the wiki as we have updated most of them to include the fmt installation

I did download the new library. But still getting huge and weird errors I cant even read anything logical from.
 
Now the function: reportErrorFunc requires that its first passed parameter be a L lua state, so if you have a new custom function in your sources that makes use of this function, you must pass it the L lua state yourself
 
change:

reportErrorFunc(fmt::format("Not enough parameters: {:d}.", parameters));

to:

reportErrorFunc(L, fmt::format("Not enough parameters: {:d}.", parameters));
Is this in the library or where am i supposed to change this line?

Or am i supposed to just add the L to the 'reportErrorFunc' like this one i found when i downloaded the src fresh from git:

C++:
bool ScriptEnvironment::setCallbackId(int32_t callbackId, LuaScriptInterface* scriptInterface)
{
    if (this->callbackId != 0) {
        //nested callbacks are not allowed
        if (interface) {
            reportErrorFunc(interface->getLuaState(), "Nested callbacks!");
        }
        return false;
    }

Am i supposed to change this one to:
C++:
 reportErrorFunc(L, interface->getLuaState(), "Nested callbacks!");

The error I get comes when trying to link the cxx executeable, it runs through all scripts before without issues.



Edit: I successfully added the addevent fix now to my old sourcecode, by changing this line:
C++:
reportErrorFunc(fmt::format("Not enough parameters: {:d}.", parameters));
to this:
C++:
reportErrorFunc("Not enough parameters: {:d}.");

I have really no clue what I'm doing but it seems to at least compile now, if anyone could help me to use the fresh/new tfs source I'd rather do so.
 
Last edited:
Back
Top