Page 3 of 3
Re: I cannot figure out zombieTurn
Posted: 27 September 2021, 11:29
by JonChambers
I solved it!!!
Perhaps the documentation should be updated to include this, but... I'm not sure where I'd even put it.
The bug was "getGameProgression" had "self::getCurrentPlayerId()" in it!
I had completely given up and was moving on to making the game possible to spectate without crashing and ran into exactly the same problem. Zombies and spectators were both killing my game in exactly the same way, even with zombieTurn and getAllDatas completely commented out.
Solving the next problem inadvertently solved this one also.
Normally I solve a bug and feel like a complete moron, but I'm actually feeling fairly smart for solving this one. (Yes I know, you're all much smarter, but this is my first game. Let me have this.)
Re: I cannot figure out zombieTurn
Posted: 27 September 2021, 11:34
by Tisaac
JonChambers wrote: ↑27 September 2021, 11:29
I solved it!!!
Perhaps the documentation should be updated to include this, but... I'm not sure where I'd even put it.
The bug was "getGameProgression" had "self::getCurrentPlayerId()" in it!
I had completely given up and was moving on to making the game possible to spectate without crashing and ran into exactly the same problem. Zombies and spectators were both killing my game in exactly the same way, even with zombieTurn and getAllDatas completely commented out.
Solving the next problem inadvertently solved this one also.
Normally I solve a bug and feel like a complete moron, but I'm actually feeling fairly smart for solving this one. (Yes I know, you're all much smarter, but this is my first game. Let me have this.)
Een answer was precisely about that. The issue is not with the zombie player but any code runned AFTER that.
It is indeed tedious to debug but as Een said, shouldnt happen if you never user getCurrent unless where you really need it.
Good catch finding it in getGameProgression

Re: I cannot figure out zombieTurn
Posted: 27 September 2021, 11:59
by JonChambers
Tisaac wrote: ↑27 September 2021, 11:34
JonChambers wrote: ↑27 September 2021, 11:29
I solved it!!!
Perhaps the documentation should be updated to include this, but... I'm not sure where I'd even put it.
The bug was "getGameProgression" had "self::getCurrentPlayerId()" in it!
I had completely given up and was moving on to making the game possible to spectate without crashing and ran into exactly the same problem. Zombies and spectators were both killing my game in exactly the same way, even with zombieTurn and getAllDatas completely commented out.
Solving the next problem inadvertently solved this one also.
Normally I solve a bug and feel like a complete moron, but I'm actually feeling fairly smart for solving this one. (Yes I know, you're all much smarter, but this is my first game. Let me have this.)
Een answer was precisely about that. The issue is not with the zombie player but any code runned AFTER that.
It is indeed tedious to debug but as Een said, shouldnt happen if you never user getCurrent unless where you really need it.
Good catch finding it in getGameProgression
I spoke to soon. I completely solved the spectator issue, but the zombie issue persists.
So, zombie triggers "zombieTurn" and "getGameProgression". What else does it trigger?
I wish I had access to a read-only version of the framework so I could just read all the things it triggers.
Re: I cannot figure out zombieTurn
Posted: 27 September 2021, 12:07
by JonChambers
Okay, one more update.
I commented out both functions and... I got a different error.
That's progress. There was nothing I could do to get any different errors before, and this seems like a pretty easy error to solve.
Okay, no more updates. Let's assume I've got this.
Re: I cannot figure out zombieTurn
Posted: 27 September 2021, 13:45
by Victoria_La
So what is the new error? And how exactly you are testing zombie mode? How do you made a player into a zombie? How many people in the game
and what is the game progression at the time you trying to make zombie?
Re: I cannot figure out zombieTurn
Posted: 28 September 2021, 02:55
by JonChambers
Victoria_La wrote: ↑27 September 2021, 13:45
So what is the new error? And how exactly you are testing zombie mode? How do you made a player into a zombie? How many people in the game
and what is the game progression at the time you trying to make zombie?
It's okay. I've got it from here. I'll start a new post if I get stuck again.