- Joined
- Jul 1, 2020
- Messages
- 4
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- RMMV
I am attempting to debug a script using the console, and it isn't being very helpful. When I playtest my game and call console.log from my script (by typing
Line number 36 is the problem, according to the traceback. The Uncaught TypeError points to that line and tells me "Cannot read property 'X' of null" -- X is a random number, generated correctly in line 32. If I type
-------------------------
I have a related question that may be better suited for separate thread. Is it possible for RMMV code that works perfectly one day to stop working at a later point in time? This exact code functioned last week, but now I'm trying to debug the console so that I can debug the script.
QuizManager.setupQuestion()), I get an "Uncaught TypeError".
JavaScript:
//=============================================================================
// QuizManager.js
//=============================================================================
/*:
* @plugindesc Manages a quiz
*
* @author Me
*
* @help
*
* Anything users might need to know about using your plugin.
*
* TERMS OF USE
* What people who use your plugin are allowed to do with it.
*
* COMPATIBILITY
* Any compatibility issues you know of ...
*/
var QuizManager = QuizManager || {};
(function() {
var $Flashcards = null;
var $FlashcardFaces = null;
DataManager._databaseFiles.push({name: '$Flashcards', src: 'Flashcards.json'});
DataManager._databaseFiles.push({name: '$FlashcardFaces', src: 'FlashcardFaces.json'});
QuizManager.questionSetup = function() {
// Randomly generate the question number
var questionNum = 1 + Math.floor(10 * Math.random());
// Entry 0: the prompt
console.log(questionNum);
console.log($Flashcards[questionNum]);
};
})();
$Flashcards[X] (or even console.log($Flashcards[X])) in to the console, though, I get what I expect: a list of keywords and values associated with that flashcard.-------------------------
I have a related question that may be better suited for separate thread. Is it possible for RMMV code that works perfectly one day to stop working at a later point in time? This exact code functioned last week, but now I'm trying to debug the console so that I can debug the script.

