Variable For Player MP?

Discussion in 'RPG Maker VX Ace' started by HexMozart88, May 16, 2016.

  1. HexMozart88

    HexMozart88 The Master of Random Garbage Veteran

    Messages:
    1,614
    Likes Received:
    2,883
    Location:
    A small hut in the forest
    First Language:
    English
    Primarily Uses:
    RMVXA
    So, I've been working on an event battle system, which, for the most part is working smoothly, however, I am trying to make it possible to use magic. I want to use a conditional branch with a variable to check if the player can use magic, but I don't know how to assign MP to a variable for the player. I know how to assign an Actor's MP to a variable, but my game has a system to switch characters in game, and I was looking for a way to avoid assigning a variable to every individual actor in the party. Thank you in advance.
     
    #1
  2. Wavelength

    Wavelength Pre-Merge Boot Veteran

    Messages:
    3,822
    Likes Received:
    3,207
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    If I understand you correctly, you want to assign the variable based on which actor is currently the first member of the party rather than assigning based on a specific actor?


    The script line $game_variables[25] = $game_party.members[0].mp will assign the party leader's (that is, the current first member of the party) to Variable #25, for example.  members[1] would be the second member of the party instead.  You would use this in a "Script..." event command.  You could also just use the "Control Variables" event command and use the script option, typing in only the following: $game_party.members[0].mp
     
    Last edited by a moderator: May 16, 2016
    #2
  3. HexMozart88

    HexMozart88 The Master of Random Garbage Veteran

    Messages:
    1,614
    Likes Received:
    2,883
    Location:
    A small hut in the forest
    First Language:
    English
    Primarily Uses:
    RMVXA
    I thought it would be something like that! Thank you so much!  :) This thread can be closed. 
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,164
    Likes Received:
    11,027
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    You could also use Control Variables and put $game_party.leader.mp into the Script box.  Does the same thing.
     
    #4
  5. HexMozart88

    HexMozart88 The Master of Random Garbage Veteran

    Messages:
    1,614
    Likes Received:
    2,883
    Location:
    A small hut in the forest
    First Language:
    English
    Primarily Uses:
    RMVXA
    That's pretty much what I did because I know the script call for variables so I figured it'd do the same thing anyway.
     
    #5

Share This Page