MZ Help with Windows and Scenes

Hi, I'm new to javaScript. I've been taking cs50x so I'm mostly experienced with c and python.
the prototyping is really confusing me. can anyone help me with instructions on how to make a window to display my questlog that I made? I'm trying to look at the code for scenes.js but I just can't figure out where to start. Thank you
you havent shown what you did, so i cant remark about anything youve done

how to make a window to display my questlog that I made?
look into the windows file to see how the windows are structured, make your own windows in a separate plugin, and have them inherit from one of the existing ones based on what you need from them. once you have those all set up, set up your questlog scene (assuming you already made one) to create and display the windows
sorry, i keep starting and erasing it. im not sure where to really start. i started before by trying to follow along with TheunproPro's tutorial on mz scenes and class objects, i wasnt really getting it, i kept getting an error, and long story short, i ended up deleting it again. I can post my quest system that i want to display though, its not finished but i can start and finish a quest using plugin commands at least. idk if that would help.

/*:
*@plugindesc Quest Journal System
*@author undergrad chaos
*
*
*@help
*Plugin commands:
*- Add quest [id] [name] [description]
*- Complete quest [id]
*
*@command Add quest
*@arg id
*@type number
*
*@arg name
*@type text
*
*@arg description
*@type text
*
*@command Complete quest
*
*@arg id
*@type number
*/

var questJournal = questJournal || {};
questJournal.quests = [];

//This function creates a quest and adds the arguments to the quest list.
questJournal.addQuest = function(id, name, description) {
questJournal.quests.push({
id: id,
name: name,
description: description,
completed: false
});
};
questJournal.completeQuest = function(id) {
for (let x=0; x < questJournal.quests.length; x++) {
if (questJournal.quests[x].id === id) {
questJournal.quests[x].completed = true;
break;
}
};
};
PluginManager.registerCommand('questJournal', 'Add quest', args => {
console.log("Raw args:", args);
const id = parseInt(args.id, 10 );
console.log("Parsed ID:", id);
var name = args.name || "Untitled Quest";
var description = args.description || "No Description provided";
console.log(`Add quest command triggered with id: ${id}, name: ${name}, description: ${description}`);
questJournal.addQuest(id, name, description);
});
PluginManager.registerCommand('questJournal', 'Complete quest', args => {
var id = (Number(args.id));
questJournal.completeQuest(id);
});
Just out of curiosity, if you're new to JavaScript/RPG Maker, is there a reason you're not using one of the existing quest journal plugins? You don't have to make your own.

In my opinion, Scenes and Windows is one of the most complex parts of the engine to try to jump into. It doesn't really have anything to do with the prototype functionality of JavaScript, it's just a complex setup.

As a tip, when you post code, you should use the CODE tags (</> in the edit bar) to preserve indentations and brackets.

You need to decide which scene this is going to be a part of, or make your own and decide how you're getting to it - the scene is the object that contains and creates all of the windows and decides what code gets executed when you select items in the interface.

Then the individual windows are what graphically appear on the screen and determine what's displayed inside of them.

What @Robro33 said is probably the best approach - choose a window in the game that displays information in the way you want, and look at how its coded and the scene that contains it.

But this is definitely trying to jump into the deep end 😉
Thank you for the advice. Honestly, its more so I can get more practice with programming. I want to get into software development and I want to make a game. I'm not really artistic and I want to start with something instead of completely using other people's hard work. I know it's tough to get into software development so I'm just trying to learn and get practice in and try to make a portfolio that could help.

So I'm thinking of using a window selectable and I'm looking at the scene_status and i think I'm starting to understand the scene setup. based on what you're saying, my scene is the organization of the data and I create a window separately to display that scene. is that correct?

this is as far as I've gotten. I based the scene off the Scene_Status.
I cant call the scene in console yet. can anyone tell me if im off to an ok start or if im way off?
<

scene_questLog.prototype = Object.create(Scene_MenuBase.prototype);
scene_questLog.prototype.constructor = scene_questLog;
scene_questLog.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
scene_questLog.prototype.create = function() {
Scene_MenuBase.prototype.call(this);
this.createNameWindow();
this.createDescWindow();
this.createCompletionWindow();
};
scene_questLog.prototype.helpAreaHeight = function() {
return 0;
};
scene_questLog.prototype.createNameWindow = function() {
const rect = this.nameWidnowRect();
this._nameWindow = new Window_Help(rect);
this.addWindow(this._nameWindow);
};
scene_questLog.prototype.nameWidnowRect = function() {
const ww = Graphics.boxWidth;
const wh = this.nameHeight();
const wx = 0;
const wy = this.mainAreaLeft() - wh;
return new Rectangle(wx, wy, ww, wh);
};
scene_questLog.prototype.descWindowRect = function() {
const rect = this.descWindowRect();
this._descWindow = new Window_Desc(rect);
this._descWindow.setHandler("cancel", this.popScene.bind(this));
};
scene_questLog.prototype.descWindowRect = function() {
const wx = 0;
const wy = this.mainAreaTop();
const ww = Graphics.boxWidth;
const wh = this._descWindowRect().y - wy;
return new Rectangle(wx, wy, ww, wh);
};
Scene_Status.prototype.createDescWindow = function() {
const rect = this.descWindowRect();
this._descWindow = new Window_Desc(rect);
this.addWindow(this._descWindow);
};
Scene_Status.prototype.descParamsWindowRect = function() {
const ww = this.descWidth();
const wh = this.descHeight();
const wx = 0;
const wy = this.mainAreaBottom() - this.profileHeight() - wh;
return new Rectangle(wx, wy, ww, wh);
};
scene_questLog.prototype.createCompletionWindow = function() {
const rect = this.completionWindowRect();
this.completionWindow = new Window_Completion(rect);
this.addWindow(this._statusEquipWindow);
};
scene_questLog.prototype.completionWindowRect = function() {
const ww = Graphics.boxWidth - this.completionWidth();
const wh = this.completionHeight();
const wx = this.completionWidth();
const wy = this.mainAreaBottom() - this.profileHeight() - wh;
return new Rectangle(wx, wy, ww, wh);
};
scene_questLog.prototype.completionWidth = function() {
return 300;
};
scene_questLog.prototype.completionHeight = function() {
return this.calcWindowHeight(2, false);
};
scene_questLog.prototype.nameHeight = function() {
return this.calcWindowHeight(2, false);
};



/>
As a tip, when you post code, you should use the CODE tags (</> in the edit bar) to preserve indentations and brackets.
1734733847061.png


Code:
And then you'll have
    formatted code
    [people can read]
JavaScript:
scene_questLog.prototype = Object.create(Scene_MenuBase.prototype);
scene_questLog.prototype.constructor = scene_questLog;

scene_questLog.prototype.initialize = function() {
    Scene_MenuBase.prototype.initialize.call(this);
};

scene_questLog.prototype.create = function() {
    Scene_MenuBase.prototype.call(this);
    this.createNameWindow();
    this.createDescWindow();
    this.createCompletionWindow();
};

scene_questLog.prototype.helpAreaHeight = function() {
    return 0;
};

scene_questLog.prototype.createNameWindow = function() {
    const rect = this.nameWidnowRect();
    this._nameWindow = new Window_Help(rect);
    this.addWindow(this._nameWindow);
};

scene_questLog.prototype.nameWidnowRect = function() {
    const ww = Graphics.boxWidth;
    const wh = this.nameHeight();
    const wx = 0;
    const wy = this.mainAreaLeft() - wh;
    return new Rectangle(wx, wy, ww, wh);
};

scene_questLog.prototype.descWindowRect = function() {
    const rect = this.descWindowRect();
    this._descWindow = new Window_Desc(rect);
    this._descWindow.setHandler("cancel", this.popScene.bind(this));

};

scene_questLog.prototype.descWindowRect = function() {
    const wx = 0;
    const wy = this.mainAreaTop();
    const ww = Graphics.boxWidth;
    const wh = this._descWindowRect().y - wy;
    return new Rectangle(wx, wy, ww, wh);
};

Scene_Status.prototype.createDescWindow = function() {
    const rect = this.descWindowRect();
    this._descWindow = new Window_Desc(rect);
    this.addWindow(this._descWindow);
};

Scene_Status.prototype.descParamsWindowRect = function() {
    const ww = this.descWidth();
    const wh = this.descHeight();
    const wx = 0;
    const wy = this.mainAreaBottom() - this.profileHeight() - wh;
    return new Rectangle(wx, wy, ww, wh);
};

scene_questLog.prototype.createCompletionWindow = function() {
    const rect = this.completionWindowRect();
    this.completionWindow = new Window_Completion(rect);
    this.addWindow(this._statusEquipWindow);
};

scene_questLog.prototype.completionWindowRect = function() {
    const ww = Graphics.boxWidth - this.completionWidth();
    const wh = this.completionHeight();
    const wx = this.completionWidth();
    const wy = this.mainAreaBottom() - this.profileHeight() - wh;
    return new Rectangle(wx, wy, ww, wh);
};

scene_questLog.prototype.completionWidth = function() {
    return 300;
};

scene_questLog.prototype.completionHeight = function() {
    return this.calcWindowHeight(2, false);
};

scene_questLog.prototype.nameHeight = function() {
    return this.calcWindowHeight(2, false);
};

sorry about that. i didnt see that buton and assumed it worked like html tags
can anyone tell me if im off to an ok start or if im way off?
It would be easier to ask for help after calling the scene and seeing what it does. by trying it, youll have a better idea of what works/doesnt work and can get assistance for the known issues instead of trying to figure out unknown ones
That makes sense. I'm away from my pc now so I can't test anything for a few hours. Before I left, I tried using SceneManager.goto(Scene_questjournal). It told me Scene_questjournal not defined. Sorry again I'm completely new to plugin coding and mostly new to javascript. I understand basic ideas with it but I'm still a newbie. As I've said in prior posts, my practice is more in c and python.
It told me Scene_questjournal not defined
it is in this case. You defined it as scene_questjournal, and then called Scene_questjournal.
i suggest following the conventions used within the existing code when writing plugins for it. in this case, itll be Scene_QuestJournal
Oh, I didn't realize I didn't capitalize the s in Scene_questJournal. I'll try that later. Sorry if I'm wasting anyone's time, I tries to call it right before I left and didn't have time to debug.
it still didnt work. I did however get a different error, I user SceneManager.push(scene_questLog) instead and got "rmmz_managers.js:2036 TypeError: Scene_MenuBase.prototype.call is not a function". I need to find the time to actually sit down and study the code more.
when asking for help with errors, always show the full trace. the line mentioned has nothing to do with what caused the error. the trace would have shown the line in your plugin that led to the error

TypeError: Scene_MenuBase.prototype.call is not a function
Code:
scene_questLog.prototype.create = function() {
  Scene_MenuBase.prototype.call(this);
  this.createNameWindow();
  this.createDescWindow();
  this.createCompletionWindow();
};
Scene_MenuBase.prototype.create.call
I need to find the time to actually sit down and study the code more.
I think this is the right idea.

Trying to learn your way around a new codebase (in a new language) doesn't work well if you're spending 5 minutes at a time throwing semi-random stuff at it 😛

I think it makes more sense to just wait until you have contiguous minutes to spend on reading what you're doing (questJournal vs. questLog), making sure you've copied and pasted your template correctly (prototype.create.call), etc.

Then you don't have to worry about whether you're leaving a forum post on your way out the door to get help with something you would've seen with two minutes of troubleshooting 🤣
Lol I get it. I'm gonna try to understand the code more and just try again. Thanks for the help, everyone. I do appreciate it and I'm sorry if I wasted any time.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-windows-and-scenes.174050/