Item Core only negative Random Variance

Discussion in 'Javascript/Plugin Support' started by Tatsumaro, Nov 20, 2017.

  1. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    Hi, im using Yanfly Item Core in my game. I love it and who'd like to implement the Random Variance. But if the player should find a weapon in an enemy drop i believe that weapon should be degraded with lower stats than a brand new bought in the store.

    The plugin allow it to happen, but the Random Variance can be lower (PERFECT) or higher. how can a force only the negative alteration of stats?
     
    #1
  2. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    630
    Likes Received:
    238
    Location:
    New Jersey
    First Language:
    English
    Primarily Uses:
    N/A
    The easiest way I can think of is to make clones of the weapons in your database and lower the stats on those. Then make it so monster can only drop the clones. The players won't know the difference.
     
    #2
    Karlski and Tatsumaro like this.
  3. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    The plugin already do this, whit the new 1.5.1 plugins, maybe i can use a "code" in the Item Core to force only a negative value.
     
    #3
  4. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    630
    Likes Received:
    238
    Location:
    New Jersey
    First Language:
    English
    Primarily Uses:
    N/A
    I am using ItemCore ver 1.28 which is the version used for MV 1.5.1 and it DOES NOT have code which forces negative-only variance.
    I could write a plugin to force a negative, but you would STILL have to create a copy of the weapon in your database because you would need to add a notetag to that version of the weapon.
     
    #4
    Tatsumaro likes this.
  5. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    ?

    The plugin create a variation of the original weapon whit the Random Variance when you find that weapon.

    Item, Weapon, Armor Notetag
    <Random Variance: x>
    If this item is acquired through non-shop means, it will have random
    stats offset by x amount in either a positive or negative value

    I`m not entirely sure but, i think that you can use code instead of values, to force the number to became negative.

    PS: i`m probable rong because i just spend 1 hour searching for this piece of information and didn't find anything like this.
     
    #5
  6. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    630
    Likes Received:
    238
    Location:
    New Jersey
    First Language:
    English
    Primarily Uses:
    N/A
    I'm telling you thst you can't with the plugin as is. The method I described when I first posted is far easier to do anyway.
     
    #6
    Tatsumaro likes this.
  7. Zarsla

    Zarsla Veteran Veteran

    Messages:
    685
    Likes Received:
    198
    First Language:
    English
    Or you can use this:
    <On Creation Eval>
    if($gameParty.inBattle()){
    var leo = x + Math.randomInt(y);
    item.params[z] -= leo;
    }
    <On Creation Eval>
    Where z is the id of the parameter you want to change. (0-7 for base parameters, ie Max HP, Max MP etc. There might be code for things like hit rate or target rate but idk them)
    While x is the minimum number you want.
    And y is the maximum number - the minimum number + 1.
    So lets say you want you're varaince to be between -5 & -15. Then x is equal to 5. While y is (15-5) + 1 which is 11.

    As to how it's negative varaince, well where the code does item.param[x] -= leo;
    It's subtracting the random number, and thus negative.

    Now if you want to alter the code for multiple parameters:
    <On Creation Eval>
    if($gameParty.inBattle()){
    var leo = x + Math.randomInt(y);
    item.params[z] -= leo;
    leo = x + Math.randomInt(y);
    item.params[z] -= leo;
    leo = x + Math.randomInt(y);
    item.params[z] -= leo;
    }
    <On Creation Eval>

    The only cavets is this works for independent items only.
    And to make regular variance null.
     
    Last edited: Nov 23, 2017
    #7
    Maliki79 and Tatsumaro like this.
  8. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    Thanks for you input Zarsla. Its PERFECT :D
     
    #8

Share This Page