Store Enemy Stat in Variable

Discussion in 'RPG Maker MV' started by Vis_Mage, Feb 26, 2019.

  1. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    382
    Likes Received:
    138
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    A (hopefully) quick question, is there a script call that can store an enemy's stat as a variable.

    To clarify, I'm not looking to set an enemy's stat with the variable, just for it to check the ATK stat of enemy 5, and store that value in a variable.
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,431
    Likes Received:
    6,485
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    depends on where you want to do this.
    Inside a troop event there is no need for a script call, you can access all enemy stats inside that troop with the control variable command (game data section)
    Outside of a troop event, enemies don't exist as entities - only the database template exists there, and then you need a script call to access those templates.
     
    #2
    Vis_Mage likes this.
  3. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    382
    Likes Received:
    138
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Thanks for the quick response.:kaohi: I'm hoping to use this out of battle.
     
    #3
  4. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,544
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    Hmmm we just need to find the MV equivalent of the Ace script call you asked for in the script call thread xD

    Which seems to be

    $dataEnemies[ID].params[param_id]

    So just use it on the script option of the Change Variable event command or in a script call

    Code:
    $gameVariables.set(variableId,enemy stat here);
    
     
    Last edited: Feb 26, 2019
    #4
    Vis_Mage likes this.
  5. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    382
    Likes Received:
    138
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Pretty much :p Ended up really liking the mechanic, and wanted to use it in another project too.

    I'm at class atm, but I'll report back only i get the chance to try it out.

    EDIT: Works like a charm! Thanks again! :kaothx:
     
    Last edited: Feb 27, 2019
    #5

Share This Page