Object decrease TP

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.
Try Yanfly Skill Core with this notetag:

<After Eval>
user.gainTp(-x);
</After Eval>
Where x is the amount you want to loose.
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.
@ Zarsla : Doesn't work for an object, thanks anyway 🙂

@XIIIthHarbinger : Works perfectly ! Oh my gash :popcorn: Thanks man !
No worries.
@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);
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 :

<After Eval>
target.gainTp(-25);
</After Eval>

I'm curious now 😀
@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.

Original thread: https://forums.rpgmakerweb.com/threads/object-decrease-tp.90111/