Hi!
Beforehand, thanks for coming by!
My main issue currently is a nil value. I know, if it's empty, just initialize it or give him some value. But i'm completly lost tbh...
Let me elaborate a little bit:
I have tried to create a copy of the pet system (the old one, not the new). By doing basically a copy of the existed code and changing the names of the same (PetSystem.cpp -> HorseSystem.cpp | class CPetSystem -> class cHorseSystem and etc etc )
I have searched everywhere in the code, where is initialized, where is destroyed, where is used (pet system) and did the same for the copied one.
Everything seemed fine, went well regarding the compilation and the rest. (I was truly happy to test it, like a kid.. just a childish thing tho)
But when trying to call a simple function from LUA, like: horsesystem.is_summon. It just throws an error: Attempt to index a global 'horsesystem' ( Nil value )
Like in the example below:
The line that throws the null pointer:
I have already checked everything ( I think, might be missing something tho ), my AddLuaFunctionTable is complete (with the funcs) and everything else. But still the same exception...
I even did a comparation by adding in a quest:
The pet line returns a value. The horsesystem just throws an exception
My mental war is:
Is the CHorseSystem even initialized ? (I copied everything from the PetSystem, soo.. it should be)
I created as well a new function in AddLuaFunctionTable called test (from LUA side -> horsesystem.test(2022)) and it should be returning just an int like 2022 (not even calling anything from HorseSystem.cpp, just returning automatically from questlua_horsesystem.cpp). But it still gives me an exception.
That's why I'm kinda confused if I need to search more in the LUA side or trying to fix where is in the source.
Already searched everywhere about this issue, most of the topics are just saying to check in questlib and etc. But for what I understood, that's not my case.
Already spent a lot of time by myself, and I don't mind actually, because it is fun (a lot) when you find the cause and you fix it. But in this case.. I'm having a mental breakdown.
Might be an easy thing to fix, but I'm completly destroyed
Thank you in advance!
Any help is precious! Even for discussing. I might get a clue regarding the issue
Kind regards