ID:121076
 
I know that it has been a while since I last made a post! It's really hard to be active in BYOND when you have a research paper due on MOND vs. Dark Matter due in a month and you need to dig up a bunch of resources and you still don't know what you want your thesis to be! End of the semester is going to be hectic. I can't promise any work until Winter Break (due in about a month ^_^ ). So until then, chill. Also, I have a new topic to rant about, after I draft it this weekend, you might see it, so you have something to look forward to (I guess?). Anyway, on to the real meaning to this post.

Most of you reading this should be well aware of my game, Law of the Board and with how buggy it was in release. Well, I was trying to show off how awesome I'm not at coding to my Calculus Lab Professor (we have a separate professor for lab and lecture due to special time constraints on lecture porfessor) and she pointed out the most obvious thing in the world and I am ashamed to say that I made the mistake in the first place.

The problem was always the switching of turns. The first turn worked beautifully, the second turn, you would always get trackers (objects that tell you where you can move to in the game) created for both people, and it was always white's turn. Well, here is the issue.

proc
TurnSwitch()
NTurn ++ // Add 1 to turns passed
if(Safety == 1) // If safety is on
Safety = 0 // It isn't anymore
if(Turn == White)
Turn = null
var/mob/B = Black
Turn = B
TurnT = "Black"
CreateTrackers(B)
if(Turn == Black) // This should be an else (Automatically resets turn to white)
Turn = null
var/mob/W = White
Turn = W
TurnT = "White"
CreateTrackers(W)
else
if(Turn == White)
Turn = null
var/mob/B = Black
Turn = B
TurnT = "Black"
CreateTrackers(B)
if(Turn == Black)
Turn = null
var/mob/W = White
Turn = W
TurnT = "White"
CreateTrackers(W)
var/mob/T = Turn
world << output("It is now [T.name]'s turn","Chat")
return

* The comment about the else was just put in today to remind me to fix it.

Looks good at a glance, and if you're not paying particularly close attention to what's going on (like me) you'd think it works. BUT IT DOESN'T. What is actually going on, is the if(Turn == White) works fine, I change the turn (which by the way, don't do it like this. There are a few debugging statements that I have yet to remove to make it "clean") then I do another if statement. if(Turn == Black). Thing is, THAT WILL ALWAYS RETURN TRUE DUE TO HOW I HAVE IT TABBED!

So how is this relevant? Well, I am going to update LotB in about 3 minutes with the fix, and I'm hoping some of you would be generous enough to find a partner and test it. (I have a class in 15 minutes, which is why this is so rushed!) I'm crossing my fingers!

Law of the Board

* As always, I have underlined links so you know they're clickable.
Cool b-b-beans bro!
That code... so much awful, awful redundancy. I don't even.
Popisfizzy wrote:
That code... so much awful, awful redundancy. I don't even.

Ya, I know right? I got really frustrated so I made redundancies up the wazoo.
NTurn ++
Safety = !Safety

Turn = (Turn == Black) ? White : Black
TurnT = (Turn == Black) ? "Black" : "White"
CreateTrackers(Turn)

var/mob/T = Turn
world << output("It is now [T.name]'\s turn.", "Chat")


Far better, though I wouldn't doubt you still have design issues.