Object decrease TP

Discussion in 'RPG Maker MV' started by LeeAceSan, Jan 18, 2018.

  1. LeeAceSan

    LeeAceSan Veteran Veteran

    Messages:
    52
    Likes Received:
    30
    First Language:
    French
    Primarily Uses:
    RMMV
    Hi guys :)

    I will be glad if one of you know how to use object who decrease the TP outside of a battle.

    I tried to create one object with "MP or HP heal" and put this formula : b.gainTp(-20); 0 but I cannot use it in my inventory :blink:

    Someone have an idea ? :popcorn:

    Thanks.
     
    #1
  2. Zarsla

    Zarsla Veteran Veteran

    Messages:
    686
    Likes Received:
    201
    First Language:
    English
    Try Yanfly Skill Core with this notetag:

    <After Eval>
    user.gainTp(-x);
    </After Eval>
    Where x is the amount you want to loose.
     
    #2
    LeeAceSan likes this.
  3. XIIIthHarbinger

    XIIIthHarbinger Part Time Super Villain Veteran

    Messages:
    676
    Likes Received:
    795
    First Language:
    English
    Primarily Uses:
    RMMV
    Try creating a common event that reduces TP to the desired amount, on the actor effected by a state.

    Then creating an item to apply that state as a certain hit to the user, & then also causes that common event to occur.
     
    #3
    LeeAceSan likes this.
  4. LeeAceSan

    LeeAceSan Veteran Veteran

    Messages:
    52
    Likes Received:
    30
    First Language:
    French
    Primarily Uses:
    RMMV
    @ Zarsla : Doesn't work for an object, thanks anyway :)

    @XIIIthHarbinger : Works perfectly ! Oh my gash :popcorn: Thanks man !
     
    #4
  5. XIIIthHarbinger

    XIIIthHarbinger Part Time Super Villain Veteran

    Messages:
    676
    Likes Received:
    795
    First Language:
    English
    Primarily Uses:
    RMMV
    No worries.
     
    #5
  6. Zarsla

    Zarsla Veteran Veteran

    Messages:
    686
    Likes Received:
    201
    First Language:
    English
    @LeeAceSan Did you have Yanfly Core Engine?
    Also it has worked in multiple projects for me. Wait the code was wrong should have been target.gainTp(-x);
     
    #6
  7. LeeAceSan

    LeeAceSan Veteran Veteran

    Messages:
    52
    Likes Received:
    30
    First Language:
    French
    Primarily Uses:
    RMMV
    Yes I have, it doesn't work for me, even with target.gainTp(-x);

    It's working for you ? When you put this on the notetag of the object :

    I'm curious now :D
     
    #7
  8. Zarsla

    Zarsla Veteran Veteran

    Messages:
    686
    Likes Received:
    201
    First Language:
    English
    @LeeAceSan
    It doesn't work in the menu but it will battle.

    However you can use a state instead, the problem with using a state is making sure it hits the target all the time(ie it's not affected by luk or state resist/rate). I recommend if you go with this method to make sure the state gets added with 1000% to be super sure of it affecting the affected person. Now if a state is used you do not need to use a common event, you will need Buff States Core by Yanfly. Also just set the item to add the state.

    And put this code in the state that will be applied:
    <Custom Apply Effect>
    target.gainTp(-y);
    target.removeState(x);
    </Custom Apply Effect>

    Where x is the id of the state that was added and the y is the amount of tp you want to lose.

    So in my test run I had the item add state 13 and then in state 13 I had this code:
    <Custom Apply Effect>
    target.gainTp(-20);
    target.removeState(13);
    </Custom Apply Effect>

    Now of course you can use a common event, but the problem with that comes in when you decide to have a large cast of characters or have a a lot of people that could be affected by an item, and you have to run a conditional check for each of them.
     
    #8

Share This Page