In ETA’s itemPicker.js file, I have a variable that is assigned a variable from another .js file: ruler.js. The variable in question is boolean, and, as far as I can tell, has no reason to be undefined at any point.
To illustrate, here is my console log. When clicking on the ruler button upon startup, I get the following false/true log reports. After clicking on a tile, instead of defining a point for the ruler, as I have tried writing the script to do, it simply highlights the tile as if the ruler button had never been selected to begin with.
I then click the ruler button again, and see the problem: rulerActive somehow became undefined because I clicked on the tile.
If someone has any idea as to why this might be happening, or can even push me in the right direction, I would be very grateful. In fact, if at all possible, I will be more than happy to share my newfound knowledge with other confused game designers.
You don’t show the whole script, so that makes it kinda tough - especially for a newb like me. But I notice that your .findByName statement is on line 86 and not in the initialize portion of the script. Is it possible that your “undefined” results is coming from a portion of the script before we get to the .findByName statement on line 86.
Thank you both very much for your help. I’m now just trying to figure out how to replace the “Sample Text” with the number generated by line 148 on itemPicker.js.