Undefined Method 'subject' when using recovery skill in menu

Discussion in 'RGSSx Script Support' started by orphen89, May 19, 2019.

  1. orphen89

    orphen89 Experimenter Member

    Messages:
    23
    Likes Received:
    4
    Location:
    Texas
    First Language:
    English
    Hello,

    I'm using the following script:
    https://alistairengine.wordpress.com/2015/07/18/critical-hit/

    Everything is working normally fine, except for when I use a recovery skill in the skill menu outside of battle. I receive the following message:
    upload_2019-5-19_4-18-14.png

    This happens when I use a recovery skill with a damage formula (i.e., see image)
    upload_2019-5-19_4-20-52.png

    However, if I set the skill to have the effect (not using damage formula, ie HP Recover 500) to heal an specific amount of HP, it appears to work fine, but not what I intend. Other skills, including this one, with a damage formula work fine in battle, just get this error outside of battle.

    I've tried using the script in a new project by itself and get the same error using a new game under the same circumstances.

    It is strange as I understand these NoMethodError/undefined method appear to be for skills that may be in an old save or something, but this isn't the case. Skill was there in new game.

    Any ideas or help?

    Thank you.
     

    Attached Files:

    #1
  2. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,211
    Likes Received:
    4,662
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    The script looks like was written with the skills are only used in battle in mind, and with YEA Battle Engine installed (probably wont work either if no battle engine, but idk).

    That said, this haven't been tested, but I probably could make a "workaround", so make the "subject" is not undefined.
    Put this somewhere in your script list, see if it does the job
    Code:
    class Scene_Skill
      alias :subject :user
    end
     
    #2
  3. orphen89

    orphen89 Experimenter Member

    Messages:
    23
    Likes Received:
    4
    Location:
    Texas
    First Language:
    English
    You are right, script appears to be an addon for YEA Ace Battle Engine and doesn't work stand-alone.

    But... your snippet is working and fixed the problem! Thank you so much for your help!
     
    #3

Share This Page