Yanfly Equip Core: Percentages for Parameters.

Discussion in 'Javascript/Plugin Support' started by Scoodles, Oct 27, 2015.

  1. Scoodles

    Scoodles Veteran Veteran

    Messages:
    39
    Likes Received:
    2
    First Language:
    English
    Hey all.

    Curious if it's possible to use percentages as part of the stat boosts using the Lunatic stuff for the Equip Core. With the custom parameters, I've been trying to find a way to have the bonus get increased by a percentage (e.g. Base stat is 200, the Custom Parameter would give 20% of the base stat, meaning the actor would have 240 of that stat), to no avail.

    If someone could help me, it'd be very much appreciated. 
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,692
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Percentage boosts are the default boosts in the database (under traits/features), that's why they don't need to be added by plugins/scripts
     
    #2
  3. Scoodles

    Scoodles Veteran Veteran

    Messages:
    39
    Likes Received:
    2
    First Language:
    English
    I unfortunately can't use that. The problem being is that I wish to attach the percentages to variables. So if say $gameVariables.value(17) is 20, and it affects HP, the Actor would get that 20% bonus.

    EDIT:

    I apologize I wasn't thorough in my description in the opening post.
     
    Last edited by a moderator: Oct 27, 2015
    #3
  4. djDarkX

    djDarkX Retro & Remastered Music Guru Veteran

    Messages:
    2,699
    Likes Received:
    1,887
    Location:
    Currently unsure...
    First Language:
    Music
    Primarily Uses:
    RMMV
    Not sure if you can put float values into variables, but the best way to do that is with normal floats.  Basically, 1 = 100%.  0.2 = 20%.

    So for the stat, you would do stat = stat + (stat * 0.2).  This would make the stat get set to 200 and would add on the additional 20%, which is 40 and would equal 240.  Hope this helps at all.
     
    #4
  5. Scoodles

    Scoodles Veteran Veteran

    Messages:
    39
    Likes Received:
    2
    First Language:
    English
    That isn't what I'm looking for, unfortunately.

    The item I had in mind was to provide stat boosts based off of several variables which I would have used as the percentage. With Yanfly's Equipment Core, I noticed that using variables was possible for stat increases, but I had hoped to have had it not as a flat stat boost, but as a percentage. The character's trait was that she'd slowly build up 'affinities' to the elements which were tied to a variable and a stat (Fire adding attack, earth Defense and HP, etc). The variable itself can not go over 100, so I wanted to have it as a percentage boost.

    An example would have been that every time she uses a fire ability, the 'Fire Affinity' Variable would increase by 10. This in turn would have provided a 10% Stat bonus to her attack via Yanfly's Custom Parameters, up to a maximum of 100%, which would have effectively doubled her attack so long as the variable remained at 100.
     
    #5
  6. Scoodles

    Scoodles Veteran Veteran

    Messages:
    39
    Likes Received:
    2
    First Language:
    English
    Just a follow up to all of this.

    I tried this formula:

    stat = stat + stat * ($gameVariables.value(ID) * 0.01)

    Unfortunately, it seems Yanfly's Custom Parameters can not add the stat as part of the equation twice. So if the variable I was using was 17 and at 100, and I was trying to raise the MDF stat,

    mdf = mdf + mdf * ($gameVariables.value(17) * 0.01)

    would not work because mdf is part of the equation in two different places. 

    Not sure as to why that is. mdf = mdf + (mdf * $gameVariables.value(17) * 0.01) doesn't work either. It just seems I need to find another equation outright.
     
    #6
  7. kiriseo

    kiriseo Veteran Veteran

    Messages:
    229
    Likes Received:
    74
    First Language:
    German
    Then I guess

    mdf += mdf*$gameVariables.value(17)*0.01

    doesn't work either.

    Hmm... can you declare a new var in Lunatic mode?

    If that's possible, couldn't you store the value of your mdf in it and use that on the right side?
     
    #7
  8. Scoodles

    Scoodles Veteran Veteran

    Messages:
    39
    Likes Received:
    2
    First Language:
    English
    With the help on Yanfly, I managed to get what I needed for a formula.

    STAT = user.paramBase(ID) * ($gameVariables.value(ID) * 0.01)

    Strangely enough, if I did STAT = user.paramBase(ID) + user.paramBase(ID) * ($gameVariables.value(ID) * 0.01) , it doubles your base stat and then adds the percentage based on the gamevariable value, even though it should be the more correct formula. Either way, this is solved.

    Thank you.
     
    #8
  9. blackmorning84

    blackmorning84 Scripter Veteran

    Messages:
    99
    Likes Received:
    67
    a little late but what about


    stat = stat * ((100+$gameVariables.value(ID)) * 0.01)
     
    #9

Share This Page