Small change in Galv's Magic Shards

Discussion in 'JS Plugin Requests' started by Zack Phoenix, Mar 30, 2017.

  1. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    First Language:
    German
    Primarily Uses:
    RMMV
    Hey fellow makers, I need your help with a small code change!

    In Galv's Magic Shards plugins, in the menu where you equip the shards, you see all the shards you can equip but also the ones you CAN'T equip - these are greyed out. I, however, need only the equippable ones to be visible and the others to not show up in the first place.

    (The reason is that I want to use this menu for setting up the actor's skills but since every actor in my game has a unique skillset, I want to create shards that are specific to them. When you open their magic shard menu then, you only see THEIR skill shards.)

    I would be very thankful for your help.

    You can get the plugin here:
    https://galvs-scripts.com/2015/11/18/mv-magic-shards/
     
    #1
  2. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    577
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    I don't really know when people come online or not, but @ Tag him. He might come around.

    I think if you add this line to line 960.
    PHP:
    if(enabled)
    So it looks like this.
    PHP:
    /*line*/
    /*944*/    
    Window_MenuCommand.prototype.addMShardsCommand = function() {
    /*945*/       if (this.needsCommand('mshards')) {
    /*946*/           switch ($gameSystem.shardMenu) {
    /*947*/               case 'enabled':
    /*948*/               case 'enable':
    /*949*/                   var enabled true;
    /*950*/                   break;
    /*951*/               case 'disabled':
    /*952*/               case 'disable':
    /*953*/                   var enabled false;
    /*954*/                   break;
    /*955*/               case 'hidden':
    /*956*/               default:
    /*957*/                   // Don't add the command
    /*958*/                   
    return;
    /*959*/           };
    /*960********=> */if(enabledthis.addCommand(Galv.MS.mCommand'mshards'enabled);
    /*961*/       }
    /*962*/   };
    hmmm..... I see command, but I don't see setHandler... It must be handled by another one of his things. I didn't try this out, because I honestly don't know what a shard is.
     
    #2
  3. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    First Language:
    German
    Primarily Uses:
    RMMV
    I contacted Galv beforehand and sadly, he doesn't have the time to look into it himself.

    Shards are items, weapon or armors that you define as such via notetags. They can then be equipped into the slots in the magic shards scene.
    Since they can teach skills upon equipping (or upon placing certain shards next to each other) I would use them as the main means of learning / equipping skills.

    I have seen you helping alot of other people in the requests board lately and I really appreciate your help. If you could guide me through how to implement that change, I'd be very grateful mogwai.
     
    #3
  4. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    First Language:
    German
    Primarily Uses:
    RMMV
    So unfortunately adding the term in line 960 didn't change anything.
    Any other ideas? I would be thankful for anyone's help.
     
    #4
  5. mogwai

    mogwai 1984 Veteran

    Messages:
    876
    Likes Received:
    577
    Location:
    Bassett Nebraska
    First Language:
    English
    Primarily Uses:
    RMMV
    Oops. It appears that line is for adding the whole shardMenu. It's also redundant because it will return in an earlier line if disabled anyway. Take that edit out.

    How do I get shards in the menu to test this? I'll try it out. Is it like an item?
     
    #5
  6. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    First Language:
    German
    Primarily Uses:
    RMMV
    Maybe it's best to try out the demo that Galv provided. There you can see how they work - they're notetagged armors and weapons. So yeah, they're items that you equip into certain slots.
     
    #6
  7. Galv

    Galv Veteran Veteran

    Messages:
    1,172
    Likes Received:
    1,105
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    N/A
    Try searching for and changing:
    Code:
    Window_ShardItem.prototype.includes = function(item) {
        return item && item.isShard;
    };
    to:

    Code:
    Window_ShardItem.prototype.includes = function(item) {
        return item && item.isShard && (this._actor && this._actor.canShardEquip(item));
    };

    EDIT: I also updated my plugin to version 2.2 to include this with a plugin setting.
     
    Last edited: Apr 13, 2017
    #7
  8. Zack Phoenix

    Zack Phoenix Artist Veteran

    Messages:
    185
    Likes Received:
    22
    First Language:
    German
    Primarily Uses:
    RMMV
    You looking into this even though you're quite busy means a lot, thank you very much Galv. This thread can be closed now
     
    #8

Share This Page