modify variable for x turns for each actor

Discussion in 'RPG Maker MV' started by Dcraft, Oct 20, 2018.

  1. Dcraft

    Dcraft Villager Member

    Messages:
    27
    Likes Received:
    0
    First Language:
    Spanish
    Let me put you in context:
    Im using variables specific for each actor like variable 1 = actor 1, variable 2 = actor 2, and so.
    Now I want to make an item/skill that modify this variables in depenment of each actor, so for example if actor one use "increase variable potion +5" then the variable 1 will be now +5, but if actor 2 use it then variable 2 will be + 5. Ok now the effect of this item/skill has a limited time in battle, lest say 3 turns and after that the variable becomes its original value, also if the battle ends before the effect ends.
    What I was thinking its an state that modify this variables or something like that but it has to be specific for each actor.
    If someone know how to do this or an alternative way I will be really grateful, hope for the best
     
    #1
  2. robhav

    robhav Veteran Veteran

    Messages:
    48
    Likes Received:
    16
    First Language:
    English
    Primarily Uses:
    RMMV
    You should be able to use Yanfly's Buffs and States Core to do this. It allows you to run code when a state is applied and when it is removed. If you were using the same variable number as the actor id and wanted to add 5 to the variable for actor 1, the note tag would be something like this:

    <Custom Apply Effect>
    id = user.actorId();
    var = $gameVariables.value(id);
    total = var + 5;
    $gameVariables.setValue(id, total);
    </Custom Apply Effect>

    Then you simply subtract 5 in the <Custom Remove Effect> tag.

    I haven't tried this exact thing but Yanfly's plugins are usually pretty good for stuff like this.

    The plugin is here: http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
     
    #2
    Dcraft likes this.
  3. Dcraft

    Dcraft Villager Member

    Messages:
    27
    Likes Received:
    0
    First Language:
    Spanish
    Hey man thanks for your response, I will definitely try it when I can cuz I kinda busy right now, but thanks for it
     
    #3

Share This Page