Bypassing Item Info Window in Yanfly's Item Core

● ARCHIVED · READ-ONLY
Started by Crystal Flareon 8 posts View original ↗
  1. I'm using Yanfly's Item Core plugin for my project, and I am grateful for the slew of mechanics it introduces. I am making some aesthetic alterations to it to best suit my project and give it a more unique feel, which have been going smoothly until I hit this problem. One of the things about the script that bothers me is selecting any item, whether it can be used or not opens up this little command window where you need to select to use the item. I know that other options can be added there, but when "Use" is the only one present it looks weird and it feels tedious, especially if it's a key item or an item that can only be used in battle, making the menu entirely pointless, like this:

    f7p28RO.png

    The only time this window is relevant to me is for weapons and armor, as I am using Yanfly's attachable augments system to allow the player to customize equipment. What I would like is for the game to be able to differentiate between usable items, unusable items, and weapons, and respond accordingly:

    Item is usable - Go straight to the actor selection window
    Item is not usuable - item is grayed out and selecting it sounds the buzzer
    Item is a weapon or armor - open the command window.

    In the case of weapons and armor, I have figured out how to remove the "use" command from the command window, so no assistance is required there. I believe I have found the clause which opens up the command window.

    Code:
    Scene_Item.prototype.createActionWindow = function() {
        var wy = this._itemWindow.y;
        this._itemActionWindow = new Window_ItemActionCommand(0, wy);
        this._itemActionWindow.setHandler('use', this.onActionUse.bind(this));
        this._itemActionWindow.setHandler('cancel', this.onActionCancel.bind(this));
        this.addWindow(this._itemActionWindow);
    };

    I would guess the solution would involve creating an if clause somewhere around this. The game is certainly able to differentiate between usable items, unusable ones and equipment, so it's just a matter of phrasing it right. Any help on this would be much appreciated.
  2. Bump! :)
    This is exactly what I am looking for as well. Did you, by any chance, figure it out since then?
  3. This problem also bothers me, if you find a solution, I hope to share it. Thank you.
  4. still nothing??
  5. I might get smacked down for necro posting but I know this is an issue for more people than just me and I have to assume others will follow the same trail of google breadcrumbs to this very post because that's how search engines work. Here is your answer:

    To get rid of the "use item" scene go to this post and download the fellow's edit - https://forums.rpgmakerweb.com/inde...-item-info-window-in-yanflys-item-core.98052/

    If you run into problems where your game crashes due to a bad script call (like having an old script call or plugin command in an event for a plugin you don't use anymore) then edit the json further by scrolling all the way down to ==Utilities== at the end and replace what you see there with this:

    Yanfly.Util = Yanfly.Util || {};

    if (!Yanfly.Util.toGroup) {
    Yanfly.Util.toGroup = function(inVal) {
    return inVal;
    }
    };

    Yanfly.Util.displayError = function(e, code, message) {
    console.log(message);
    console.log(code || 'NON-EXISTENT');
    console.error(e);
    if (Utils.RPGMAKER_VERSION && Utils.RPGMAKER_VERSION >= "1.6.0") return;
    if (Utils.isNwjs() && Utils.isOptionValid('test')) {
    if (!require('nw.gui').Window.get().isDevToolsOpen()) {
    require('nw.gui').Window.get().showDevTools();
    }
    }
    };
  6. OgreLeg said:
    If you run into problems where your game crashes due to a bad script call...then edit the json further
    Your post reads weirdly. You suggest a solution but the link is to this thread.

    Then you talk about editing a JSON, which has nothing to do with this thread or the plugin mentioned in it.

    Lastly, the code you supply at the bottom has nothing to do with the issue being discussed in this thread. (and is generally not desirable...if one has code in their project that doesn't do something, they should know about it)

    As a formatting tip, you should always paste code inside of CODE tags (the </> in the edit bar). That preserves indentation and brackets.
  7. @OgreLeg , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.