YanFly Battle Engine/Action Sequence - Skills increasing variable

Discussion in 'RPG Maker MV' started by artoni, Jan 4, 2019.

  1. artoni

    artoni Writer, Editor Veteran

    Messages:
    115
    Likes Received:
    161
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi all-

    The way my skill system is going to work is that each time you use a skill, a variable related to it increases; if the variable increases enough, you learn the next skill. This way, the learning tree is based on actual usage as opposed to level or JP. Using Yanfly's Action Sequence Pack 1, the variable isn't too hard to adjust- let's say I have it set as 3, so I have in the notes;

    change variable 3+=1
    My question is how, then, to have it check to see the variable has reached the number yet. From what I can tell that uses Battle Engine Core, but I'm confused about the syntax. How can I adapt variable to the following?

    if $gameSwitches.value(1)
    action effect​
    else if $gameSwitches.value(2)
    action effect
    action effect​
    else
    action effect
    action effect
    action effect​

    This will also be checking overusage of a skill class in one character's usage, which will trigger a common event; that shouldn't be too difficult, but it just makes figuring out the variables even more important.

    Thanks in advance!

    EDIT; Ended up figuring this out, at least for the common event. For reference, here's my variable-will-inflict-common-event code, which also prevents the common event from reoccurring (there's a later trigger to turn the switch off)-

    <finish action>
    //Adds to Common Event variable
    change variable 3 += 1
    //Adds to skill learn variable
    change variable 61 += 1
    //Checks to see if CE variable has reached level, and if CE switch is already on
    if $gameVariables.value(3) >= $gameVariables.value(4) & $gameSwitches.value(5)
    perform finish​
    //If only CE variable has reached level, turn CE switch on and activate
    else if $gameVariables.value(3) >= $gameVariables.value(4)
    change switch 5: on
    perform finish
    common event: 9​
    else
    perform finish​
    end
    </finish action>

    Just need to add the second branch regarding skill learning. I'm pretty sure it'll use
    user.learnSkill(y); , I just need to figure out how.
     
    Last edited: Jan 4, 2019
    #1
  2. Isabella Ava

    Isabella Ava Veteran Veteran

    Messages:
    636
    Likes Received:
    751
    First Language:
    English
    I think there is a plugin to do this already (learn skill if you mastered a weapon). Maybe do some more google search?
    Much better than check variable per weapon
     
    #2
  3. artoni

    artoni Writer, Editor Veteran

    Messages:
    115
    Likes Received:
    161
    First Language:
    English
    Primarily Uses:
    RMMV
    This has nothing to do with weapons; it's straight up skills and their usage.

    Characters can have different weapons all they wait, but if they don't practice/train/etc, they're not gonna improve.
     
    #3

Share This Page