[Solved]A way to set an enemy Stat as a variable?

Discussion in 'Javascript/Plugin Support' started by DRG, Jul 20, 2019.

Thread Status:
Not open for further replies.
  1. DRG

    DRG Orange juice lover Veteran

    Messages:
    67
    Likes Received:
    27
    Location:
    place
    First Language:
    english
    Primarily Uses:
    RMMV
    Hello! so i'm making a skill similar to Tattle/check from paper mario/undertale and i'm using Yanfly enemy levels. So i'm trying to
    make it so that when I use the attack it will get the enemy's stats, and apply them to different variables and then text codes will
    be used to show the stats. however, whenever I try out the skill i get an error. If anyone could tell me the correct javascript code it would be great! thanks!

    Skill (action sequence and javascript code)
    Code:
    <Before Eval>
    $gameVariables.setValue(6, b.enemyId());
    $gameVariables.setValue(12, b.enemyMaxHp());
    $gameVariables.setValue(13, b.enemyMmp());
    $gameVariables.setValue(14, b.enemyAtk());
    $gameVariables.setValue(15, b.enemyDef());
    $gameVariables.setValue(16, b.enemyMat());
    $gameVariables.setValue(17, b.enemyMdf());
    $gameVariables.setValue(18, b.enemyAgi());
    $gameVariables.setValue(19, b.enemyLuk());
    $gameTemp.reserveCommonEvent(11);
    </Before Eval>
    
    <target action>
    camera focus: target
    zoom: 150%,20
    action animation
    wait: 60
    zoom: 110%, 10
    wait: 10
    action effect
    </target action>

    Error
    [​IMG]

    Plugin list
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,046
    Likes Received:
    654
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Try simply mhp, mmp, atk, def, etc~
    Code:
    <Before Eval>
    $gameVariables.setValue(6, b.enemyId());
    $gameVariables.setValue(12, b.mhp);
    $gameVariables.setValue(13, b.mmp);
    $gameVariables.setValue(14, b.atk);
    $gameVariables.setValue(15, b.def);
    $gameVariables.setValue(16, b.mat);
    $gameVariables.setValue(17, b.mdf);
    $gameVariables.setValue(18, b.agi);
    $gameVariables.setValue(19, b.luk);
    $gameTemp.reserveCommonEvent(11);
    </Before Eval>
     
    #2
  3. DRG

    DRG Orange juice lover Veteran

    Messages:
    67
    Likes Received:
    27
    Location:
    place
    First Language:
    english
    Primarily Uses:
    RMMV
    #3
    caethyril likes this.
  4. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,320
    Likes Received:
    3,958
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #4
Thread Status:
Not open for further replies.

Share This Page