Bug with yanfly passive states

Discussion in 'Javascript/Plugin Support' started by Nirwanda, May 29, 2018.

  1. Nirwanda

    Nirwanda Procrastimancer Veteran

    Messages:
    1,275
    Likes Received:
    594
    Location:
    Buenos Aires
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    This bug is only aesthetic but it's kind of annoying. So, I'm using yanfly passive states+base param control to create a character growth system: you learn rogue skill it comes with a passive that gives + 10 agi, you learn a warrior skill and get an extra +5 to attack and so on.
    The bug is that when you learn those skills the stats of the character on the status menu (and equip screen if you're not using yanfly equip core) won't update, it will still show the old stats. The thing is, this only happens if you checked your status beforehand; if you go straight to learn the skill the stats will update alright.
    Anyway this can be easily fixed by entering a battle or unequiping and requiping something, but I fear it might cause some players to think the growth system is bugged, I know it did to me at first. So I was wondering if someone could help me with this.
    You might be wondering why don't I go to yanfly with this problem. Turns out the only way to report bugs seems to be his patreon page and you can only post there if you are actively donating.
    In any case I hope someone can help me and thanks in advance!
     
    #1
  2. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    354
    Likes Received:
    135
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    The screen needs to be properly refreshed after learning the skill before it shows the updated stats. How exactly are the skills in question being learned? Level Up? Yanfly's Skill Learn plugin? Once I know that, I can tell how to fix this.
     
    #2
    Nirwanda likes this.
  3. Nirwanda

    Nirwanda Procrastimancer Veteran

    Messages:
    1,275
    Likes Received:
    594
    Location:
    Buenos Aires
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Thanks for answering!
    For the record, I tried learning the skills through an event and the same thing happened. But they're being learned through this plugin. (warning! japanese ahead!) I'm afraid it's probably gonna be more complex than I thought if you have to deal with that massive moonrunes code. Sorry! I hope you can still manage but I'll understand if you can't.
    EDIT: Sorry, forgot to add the link to the plugin!XD
    https://github.com/futokoro/RPGMaker/blob/master/FTKR_SkillTreeSystem.js
     
    Last edited: May 30, 2018
    #3
  4. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    354
    Likes Received:
    135
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm not certain where exactly you'll need this, but this is the code you'll need:

    $gameActors.actor(user.id).refresh();

    That's a script that you'll want to use right after the new skill is learned. user.id should be the ID of the actor learning the skill. Depending on the exact way you're learning the skill, user.refresh() may also work.
     
    #4
    Nirwanda likes this.
  5. Nirwanda

    Nirwanda Procrastimancer Veteran

    Messages:
    1,275
    Likes Received:
    594
    Location:
    Buenos Aires
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Well I found where the skill is learned (line 2212)but I don't know how I would be able to tell the code to target the specific actor who learned the skill. So what I did was manually refresh all the actors and it seems to have worked. It won't cause any complications, down the line, will it?
    Also, again a million thanks! :)
     
    #5
  6. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    354
    Likes Received:
    135
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    A manual refresh should be fine. Refreshing shouldn't cause any problems as long as the base code isn't significantly altered.
     
    #6
    Nirwanda likes this.
  7. Nirwanda

    Nirwanda Procrastimancer Veteran

    Messages:
    1,275
    Likes Received:
    594
    Location:
    Buenos Aires
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    OK thanks a lot :)
     
    #7

Share This Page