Superloading problems

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
Charidan
Higher
Posts: 64
Joined: Wed Jul 22, 2015 8:12 pm

Superloading problems

#1 Post by Charidan »

I have tried to superload the Player.lua file, and now I am receiving an error that Player.runCheck() is nil. I didn't touch runCheck() specifically, so by my understanding it should still exist in the base version of Player.

I *am* calling the function PlayerRest.initRest() which indirectly calls Player.restCheck().

How can I get ToME to use the original restCheck while using my superload of Player?
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.

Charidan
Higher
Posts: 64
Joined: Wed Jul 22, 2015 8:12 pm

Re: Superloading problems

#2 Post by Charidan »

Nevermind! It turns out that PlayerRest calls a function which returns the string error "player:restCheck() method not defined" without actually checking anything at all. The solution is just to overload that method with a call to player.restCheck().
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.

Post Reply