How do I set a Variable to be equal to an Actor's Stat using a Script?

Discussion in 'RPG Maker MV' started by Pixii, Feb 10, 2016.

  1. Pixii

    Pixii Villager Member

    Messages:
    20
    Likes Received:
    2
    First Language:
    English
    Basically, I have a Common Event that needs to Perform a Skill Check and I'm trying to get the Ability Modifier for the Actor (which is a simple formula based on the Actor's requested Stat)





    This Color Text means that I do not need help with this, and it's already accomplished
    This Color Text means I need help with this.

    - If the Actor has the Required Skill, that Actor's ID Is stored in a Variable.
    - The appropriate Common Event is then called
    - Each Common Event requires a Specific Stat's Ability Modifier

    - Using the Actor's ID, I would like to store the Specific Stat into another Variable in order to use the formula for the Ability Modifier
     



    WHAT I'M NOT LOOKING FOR:
    I know how to assign a Stat for a SPECIFIC Actor inside a Variable, but this would require that I repeat this process for EVERY Party Member and EVERY Stat.

    So I would like to set the Variable to a SCRIPT instead of a Game Operand.

    WHAT I'M LOOKING FOR
    I need the Script Command that brings up the requested Stat. It should be something like:

     

    • $gameActors.actor($gameVariables.value(X)).HP;
    • $gameActors.actor($gameVariables.value(x)).ATK;



    But, apparently, that isn't it, because the value always returns as ZERO.

    Thanks in advance,
    Pixii
     
    #1
    Moxy likes this.
  2. King Gerar

    King Gerar Sword of the Morning Veteran

    Messages:
    163
    Likes Received:
    204
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Something like this?


    $gameActors.actor($gameVariables.value(x)).param(n);


    Where x is the variable ID you want use, and n the parameter ID (0 = Hp, 1 = Mp, ...)
     
    #2
    Moxy likes this.
  3. Pixii

    Pixii Villager Member

    Messages:
    20
    Likes Received:
    2
    First Language:
    English
    That's exactly what I was looking for, thank you!
     
    #3

Share This Page