Fix finishing a level

Now that I’ve got my massive playtesting grid set up, something’s gone wrong with the game recognizing the last move in a level – it’s not accepting either answer, as if it doesn’t have the dictionary entry in there, or as if it doesn’t have a collider.

OHH it’s not just the last move, it’s the last dictionary entry in the .txt file. So this is just (lol just) a formatting problem.  Bane of my existence, formatting …

Alright, so the key isn’t being found in the dictionary.  Huh. When I do this, it finds the right value.

Debug.Log(Dictionary is  + dict.WordDict[zug]); 

I’m … kinda at a loss.  It’s clear that the moment things went wrong was when I went copy/paste crazy in the Google sheet (although I suppose there’s a chance that it happened earlier, with button-y stuff).  Gonna go restore my old version, bring that back into Unity, and see if it fixes it.  Then I’ll know a little more about when this problem started.

Ooookay.  So maybe the problem isn’t formatting.  The old version still doesn’t work for these last dictionary entries.  Something about button gridding messed it up.  How?  No clue.  Let’s go back and look …

Huh.  So “zug” (and all of the other dictionary values at the end of a row) are all clearly in the game dictionary.  And yet somehow the game keeps reporting that they’re not in there!  When I added another key,value entry into the row, zug started working.  Unclear how it knows it’s in the dictionary, returns the value for “zug” when I type it in manually, but can’t return the value for thisText.text (which is equal to “zug”).  Something weird about the formatting, or about how it’s reading it in?  Can’t for the life of me see any differences, because when I have it Debug.Log(thisText.text), it returns “zug”.  Soooo.  Hmph.  Can’t see any differences between “zug” and “sug”, which works (because it’s earlier in the row).

I tried adding the character separator to the end of each row, but that went poorly (as it had the last time I’d done that).  So… the way to fix this appears to be adding a dummy to the end.  That isn’t much fun!

So I just added a new column to the right of the dictionary entries.  Now it’s recognizing them.  I guess it’s something about the ‘\t’ splits?  I’m confused because this wasn’t a problem before, but … ah well.  Now it works.  #todo – at some point figure out why/how and do something better than making a dummy column at the end to fix it.

Oh noooo I spoke too soon.  The other rows aren’t working.  Only the first row works.  Before, all rows worked except for the last dictionary entry.  Now, only the first row works.  This is fascinating / deeply annoying.  Walking away for now.

Trying again.  Using this thread to see what’s actually in the dictionary.

 foreach (string key in attachStats.Keys)
     float val = attachStats[key];
     Debug.Log(key + " = " + val);

I cannot for the life of me figure out what’s going wrong.  I moved these away from Start() and into the collider.   Got notebook entries working again, but feels stupid.  [Put these back in Start() and that’s working fine now, bc of solution tmrw]

if (other.tag == Notebook)

                notebookEntries = GameObject.Find(NotebookEntries); // these used to work in Start() but stopped



OMG HOLY COW the problem was the debugging I’d been doing about “zug” not working –

//        Debug.Log(Dictionary for zug is  + dict.WordDict[zug]); // okay so it has it in it here ... 
//        Debug.Log(Dictionary for sug is  + dict.WordDict[sug]); // okay so it has it in it here ... 

As soon as I took those out, everything worked again.  SIGHHHH.

Okay.  So now everything works, I was able to take out the dummy variable, I’m not even entirely sure what was wrong to begin with.  Welp ! Just relieved it works again.  Sometime maybe I’ll go back through these notes and figure it out (#todo).  I’m gonna risk it and try to add a whole bunch more levels and see if things still work.

NOOOO as soon as I add the other levels it stops working.  What is going on with this??

Something is going on w the formatting.  When I went into the editor and made a linebreak and deleted it again, it started working.  Sigh.

So apparently even the elaborate system from GoogleSheets to TextEdit to Unity is just *not* working.  Blargle. That being said, I also can’t type new rows straight into the Editor.  It doesn’t read in integers correctly.

So now I’m going from TextEdit to Unity, and then manually hitting “enter” and then “delete” after each line.  That works.  And sucks!  I guess I just do a template that I can edit from the editor?  Just did that, works well now.  I guess I could also try a different character for linebreak, like “$” (#todo).  I’d tried that before, but I think there were other problems going on with it.   At least I got it working again!

Leave a Reply

Your email address will not be published. Required fields are marked *