YanFly Stat Allocation and JP System issue

Discussion in 'Javascript/Plugin Support' started by Jenova, Aug 16, 2019.

  1. Jenova

    Jenova Because you are...a puppet! Veteran

    Messages:
    152
    Likes Received:
    105
    Location:
    Hawaii
    First Language:
    English
    Primarily Uses:
    RMMV
    So apparently, no matter what I do, there is always 2 JP taken out every time a character uses Stat Allocation.

    I tried:

    Cost = 1;
    Cost = times;
    Cost = 1 + times;

    I don't know what is going on.

    Help please.

    [​IMG]
     
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,052
    Likes Received:
    658
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Plugin links for convenience: http://www.yanfly.moe/wiki/Stat_Allocation_(YEP) http://www.yanfly.moe/wiki/Job_Points_(YEP)

    I'm not sure either: just tested and it works as expected for me. :kaoswt2:

    Are you certain it's spending 2 JP per click rather than just 1? Asking because you have the Allocation Bonus set to 0.02 (default 0.01). :kaoswt:

    Since you say your changes are apparently having no effect, maybe you've accidentally got multiple Stat Allocation entries active in your Plugin Manager?

    Otherwise, are you using the latest versions of those plugins? Maybe post a screenshot of your Plugin Manager. :)
     
    #2
  3. Jenova

    Jenova Because you are...a puppet! Veteran

    Messages:
    152
    Likes Received:
    105
    Location:
    Hawaii
    First Language:
    English
    Primarily Uses:
    RMMV
    Aren't allocation bonus's just how much it goes up by each allocation? I thought that JP Cost would be how much it actually costs per allocation. I will try though.

    I did check the versions and they are up to date (did that before posting but will check again just to be sure).

    [​IMG]
    [​IMG] [​IMG] [​IMG]

    Thanks Caeth. You have always been a life saver.
     
    #3
  4. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,052
    Likes Received:
    658
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Yup, the allocation bonus should only be how much it changes per "click", just wondered if maybe you'd confused yourself while bughunting and were seeing +0.02 as two points being spent. I've done stuff like that many times myself... :kaoslp:

    Is it only an issue with JP costs, or AP as well? Have you tried setting the cost to 2 JP to see if that makes any difference? :)

    I can't see anything suspicious in your Plugin Manager, but then I'm not personally familiar with quite a few of those (maybe someone else has some insight there). :kaoswt:
     
    #4
  5. Jenova

    Jenova Because you are...a puppet! Veteran

    Messages:
    152
    Likes Received:
    105
    Location:
    Hawaii
    First Language:
    English
    Primarily Uses:
    RMMV
    Using 2 JP cost makes it take 4 JP out every allocation. :/

    Edit: I know this because I had 8 and then 4 and then 0 and i only allocated twice.

    Do you want a video? I can try to record one...
     
    #5
  6. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,052
    Likes Received:
    658
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Not sure a video would help at this point, I think I understand what's happening, just not why... :kaoslp:

    If 1 becomes 2 and 2 becomes 4, that implies something's calling the "JP cost" routine twice at some point (maybe gainJp or processAllocationCostJp). If it's happening with AP as well, it might be one of the methods "higher up" the chain (e.g. processAllocationCost). Unfortunately I don't know which plugin or script call may be causing that; all I can think of at this point is turning off all non-Yanfly plugins, save, and test, to see if that helps...
    • If it works like that, you can start turning your other plugins back on in small batches (save and test each time) to try to isolate possible culprit(s). Tedious, but doable. :kaophew:
    • If the issue remains with only Yanfly plugins enabled, you may need to check through your game for references to gainJp or loseJp, either in script calls or plugin parameters. Let's hope it's not that. :kaoswt2:
     
    #6
  7. Jenova

    Jenova Because you are...a puppet! Veteran

    Messages:
    152
    Likes Received:
    105
    Location:
    Hawaii
    First Language:
    English
    Primarily Uses:
    RMMV
    Could it possibly be the Job Points plugin itself? I do have a JP rate % notetag (<JP Rate: 200%>) inside a state that is called during my beta to apply higher exp/drop/gold/jp rates as a passive buff from the beginning of the game.

    Just gonna see if that's the case BEFORE doing all my plugins. Because, like you said, tedious.

    Edit: that seems to be the case. Not sure why it does this....
     
    Last edited: Aug 23, 2019 at 7:03 AM
    #7
    caethyril likes this.
  8. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,052
    Likes Received:
    658
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh that makes much more sense! gainJp multiplies everything by that rate, so the cost will display as 1 but be processed (and recovered) as 2. :kaosigh:

    I wrote a small plugin to ignore the JP Rate on the Stat Allocation scene; quickly tested and it seems to work for me!
    Code:
    (function(alias) {
    
    'use strict';
    
    	// Don't use rate on stat allocation scene
    	Game_Actor.prototype.jpRate = function() {
    		if (SceneManager._scene instanceof Scene_StatAllocation) {
    			return 1;
    		}
    		return alias.call(this);
    	};
    
    })(Game_Actor.prototype.jpRate);
    Just save as a .js file (Save As > File Type: All Files, Filename: whateverYouLike.js) and import as a plugin, loading it after Yanfly's Job Points~ :kaojoy:
     
    #8
    Jenova likes this.
  9. Jenova

    Jenova Because you are...a puppet! Veteran

    Messages:
    152
    Likes Received:
    105
    Location:
    Hawaii
    First Language:
    English
    Primarily Uses:
    RMMV
    You should add that to your plugin list.

    Once again, you have saved my life. I WILL credit you. :)

    Thank you so much!
     
    #9
    caethyril likes this.

Share This Page