Variable Skill Cost

Discussion in 'RPG Maker MV' started by Ameer, Dec 26, 2018.

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

    Ameer Veteran Veteran

    Messages:
    85
    Likes Received:
    12
    First Language:
    English
    Primarily Uses:
    RMMV
    I am trying to make a skill requires PP more like Pokemon my game just have 20 skills so what I am doing is setting a variable for each skill so can someone help me with that to set custom requirement of variable in skill and show that variable but I know it can be done by Skill core but I don't know how

    Edit-:
    I have done almost everything but I don't know how to subtract variable in script this is last thing left please help me with it
     
    Last edited: Dec 26, 2018
    #1
  2. Fernyfer775

    Fernyfer775 Veteran Veteran

    Messages:
    1,293
    Likes Received:
    794
    First Language:
    English
    All of these codes require Yanfly Skill Core + the Core and battle engine I believe? You'll need to slap these codes into your skills and tweak as needed.

    This first code is the requirement itself:

    This one reduces the variable by X when this skill is used:

    This last one shows the "custom cost" of the skill. You can use all sorts of codes to show icons, change the text color, etc.
    Make sure you initialize the variable somewhere (beginning of battle or whatever) and set it to whatever amount of "pp" you wanted.
     
    #2
  3. Ameer

    Ameer Veteran Veteran

    Messages:
    85
    Likes Received:
    12
    First Language:
    English
    Primarily Uses:
    RMMV
    @Fernyfer775 Thanks for your code My code before this was

    Code:
    <Custom Show Eval>
    
    if ($gameVariables.value(12) < 1) {
    
    visible = false;
    
    } else {
    
    visible = true;
    
    }
    
    </Custom Show Eval>
    
    
    <Custom Cost Display>
    
    \c[4]\v[12]\c[0] SP
    
    </Custom Cost Display>
    and I was calling a common event for decreasing variable

    Now my code is this
    Code:
    <Custom Show Eval>
    if ($gameVariables.value(12) < 1) {
    visible = false;
    } else {
    visible = true;
    }
    </Custom Show Eval>
    
    <Custom Execution>
    $gameVariables.setValue(12, $gameVariables.value(12) - 1);
    </Custom Execution>
    
    <Custom Cost Display>
    \c[4]\v[12]\c[0] SP
    </Custom Cost Display>
    
    Again thanks now I don't have to use Common events for every skill in my game
     
    #3
    Fernyfer775 likes this.
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,113
    Likes Received:
    10,293
    First Language:
    English
    Primarily Uses:
    RMVXA

    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