- Joined
- Jan 15, 2017
- Messages
- 9
- Reaction score
- 1
- First Language
- English
- Primarily Uses
- RMMV
I'm slowly but surely learning my Javascript, but i'm having way too many issues with this code. I'm trying to modify this:
So that when you're on the Item Menu and select a consumable item, it won't open the window asking you to confirm that you would like to use an item and instead immediately open the character profiles


Before I found a snippet of code that removed the action window altogether, but the problem with that is that if you select a weapon the game will immediately crash. So I was hoping I could set up an if statement that would use "this.onActionUse();" when the object is an Item, and ActionWindow if it's a Weapon or Armor.
Unfortunately the code isn't recognizing if something is an item, and is opening the ActionWindow regardless of what I use. Best case scenario, using an item will go straight to ActionUse and pressing Okay on Armor/Weapons should just return an error sound effect and nothing else.
Some help would be greatly appreciated! Hope I was clear enough.
Thanks!
JavaScript:
Scene_Item.prototype.onItemOk = function() {
var item = this.item();
if (DataManager.isItem(this._item)) {
this.onActionUse();
} else {
this._itemActionWindow.setItem(item);
};
};
So that when you're on the Item Menu and select a consumable item, it won't open the window asking you to confirm that you would like to use an item and instead immediately open the character profiles


Before I found a snippet of code that removed the action window altogether, but the problem with that is that if you select a weapon the game will immediately crash. So I was hoping I could set up an if statement that would use "this.onActionUse();" when the object is an Item, and ActionWindow if it's a Weapon or Armor.
Unfortunately the code isn't recognizing if something is an item, and is opening the ActionWindow regardless of what I use. Best case scenario, using an item will go straight to ActionUse and pressing Okay on Armor/Weapons should just return an error sound effect and nothing else.
Some help would be greatly appreciated! Hope I was clear enough.
Thanks!