Show Item, Weapon and Armor only.

Discussion in 'RPG Maker MV' started by NehpetsYar, Jul 4, 2018.

  1. NehpetsYar

    NehpetsYar Villager Member

    Messages:
    6
    Likes Received:
    4
    First Language:
    English
    I am using many of Yanfly's plugins, and I have a scene where you speak to a "blacksmith". In this scene I enable the use of Yanfly's Augment system, and Script Call "SceneManager.push(Scene_Item);" to bring up the Item menu. All of that works great so far; but I would like to only show Items, Weapons, Armor, and possibly a custom Item category called Accessory. I have some very basic understanding of editing the JS files, would this be possible for me to do? I apologize ahead of time if I've posted this in the wrong section.
     
    #1
    SoftCloud likes this.
  2. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    3,934
    Likes Received:
    9,942
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    The simplest, but definitely not the easiest, thing is to create a new plugin.
    Before you make it:
    1. Open your rpg maker mv folder, go to dlc. In one of the folders there's a plugin that allows you to display window names by holding the CTRL. Copy paste it into your project's plugin folder and activate it.
    2. Find the names of two windows: The one that ays "Items, weapons, armor, key item" and the one that draws the item list.
    Now create a new plugin and make Scene_BSItem, which is the prototype of Scene_Item.
    Then you need to create new windows as well. They'll be called Window_BS* and will be the prototype of Window_*, where * is the window names we found. For example if the upper window is called Window_ItemCategory, the new window will be called Window_BSItemCategory and will be the prototype of Window_ItemCategory.
    These are the changes you'll need to make:
    1. Rename Key item to Accessories in the category window
    2. Edit the function responsible for making item list (usually it's makeItemList) to display only accessories. For that you may need to do your own research on how accessories are handled, so for that I'd create an event that gives you an accessory, open dev console with f8 in game and display $gamePlayer._armors and $dataArmors and compare it to the database to understand what is what.
    3. Paste all functions of Scene_Item that contain creating new windows and edit the new windows appropriately. For example you don't want to create a new Window_ItemCategory when your scene wants to use Window_BSItemCategory.
    4. Maybe you'll also need to create a patch for Yanfly Attachable augments.
    This is an example code of how you create the new window, feel free to use that.
    Code:
    function Window_BSItemCategory() {
    this.initialize.apply(this, arguments);
    }
    
    Window_BSItemCategory.prototype = Object.create(Window_ItemCategory.prototype);
    Window_BSItemCategory.prototype.constructor = Windows_BSItemCategory;
    
    //here go the other functions
    I know it's rather advanced, but this is how I'd do that, because I don't want the default scene to be hit by my edits.
     
    #2
  3. NehpetsYar

    NehpetsYar Villager Member

    Messages:
    6
    Likes Received:
    4
    First Language:
    English
    Thank you for taking the time to type that all out. I will give it a try and see how it goes. Its advanced for me but I will definitely give this a try and let you know how. Ill probably leave accessories out and keep it basic to start. Thanks!
     
    #3
  4. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    3,934
    Likes Received:
    9,942
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    You're welcome. If you have a problem, feel free to give me a shout. I won't be able to help with anything practical, since I'm currently left with no computer, but I can still read and understand the code.
     
    #4

Share This Page