Cannot read property of 'item' undefined, my itemwindow becomes undefined when the check happens

Mitchel

Villager
Member
Joined
Sep 24, 2016
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Im working on a menu for viewable documents, sort of like a collections/document menu. I've have the menu displaying and the category window working, but when I test the item window after selecting the Item I want to use, I keep getting a Cannot read property of 'item' undefined. I used the developer's tools to find out where it's crashing and it crashes in Scene_ItemBase.prototype.item(). The item window for some reason it undefined, but I have it defined in the Scene_Collectibles section of my code. I checked to see if the other plugins i'm using was casuing this issue and it's not. I put this in a seperate project with no other plugins and i still get the same results. Here's the code i've been working on and some screenshot of the crashes. If anyone can help, it will be much appreciated!

View attachment Collectible Menu.js

Location of Issue.png

Untitled.png
 

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
225
Reaction score
424
First Language
English
Primarily Uses
RMMV
The problem is "this._itemWindow" isn't created within the Scene_ItemBase.


You need to create "this._itemWindow" (an instance of the Window_ItemList) within the extended Scene. (in your case, within Scene_Collectible)


Actually, looking through your code again, you did create a Window_ItemList, but you called it "this._pageWindow"


So all you gotta do is overwrite the function for your new scene:

Code:
Scene_Collectible.prototype.item = function() {
    return this._pageWindow.item();
};
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
It would help if you gave us screenshots of the console output and of your plugin managers, but there are only three ways to cause such an error:


1) by loading an incompatible older savefile


About 80% of all plugins require you to start a new game and make all older savefiles incompatible on installing them


2) a plugin incompatibility caused either by plugins in the wrong order or by two plugins conflicting with each other


The console output would name the plugins involved, and the plugin manager screenshot would allow us to check the order of those plugins


3) by wrong configuration of the plugin


A lot of plugins need to be configured correctly before they can work - you simply can't activate them and expect them to work in any project without problems.
 

Mitchel

Villager
Member
Joined
Sep 24, 2016
Messages
10
Reaction score
1
First Language
English
Primarily Uses
This has helped so much! It fixed the issue, but now i'm running into another problem where if I pickup a different item with the same notetag, it's not added to the list. Here are some screenshots of the issue and the list of plugins im using.


EDIT AGAIN: Nevermind, I fixed the issue. Apparently the item in the chest got switch with a different one that doesn't have the proper tag. I don't know how it happen, but it's fixed and the menu works! Thank you guys so much for helping me out! I really appreciate it!
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top