Plugin won't execute

● ARCHIVED · READ-ONLY
Started by Quamcy 3 posts View original ↗
  1. I'm writing a simple(?) plugin to change the number of followers on the map but can't understand why my plugin won't execute. The code I wrote is as follows:

    Code:
    *    @param Follower Count
    *    @desc Determines the number of followers
    *    @default 4
    
    (function() {
    
        //var parameters = PlugInManager.parameters('MaxFollowers');
        //var followerCount = Number(parameters['Follower Count']);
        var _Game_Followers_initialize = Game_Followers.prototype.initialize;
    
        Game_Followers.prototype.initialize = function() {
    
            _Game_Followers_initialize.call(this);
    
            for (var i = 4; i > 2; i--) {
                this._data.pop();
            }
        };
    
    })();
    I'm not done yet but my question is: as is, the code will work as intended. However, if I un-comment the lines it won't work. Could someone explain why that is? Also, I know there are plugins out there that can do this but I'm trying to learn how to code.
  2. what happens when you try to run it?
    are there any other plugins that might cause incompatibilities?
    how do you install that plugin?
  3. That code can't possibly work the way you're trying to get it to work. In this case, you're going to need to override the function rather than alias it and call it. You need to replace $gameParty.maxBattleMembers() with followerCount.

    The only reason I can see that it would not execute with those lines uncommented is if you called it something other than MaxFollowers.js when you saved the script.