''Training Tokens'' - How can I make an item that gives EXP?

Hi guys,

I'm trying to make an item that would make class changing and permadeath less punishing, aka a ''training token''. The player would buy them in the arena or somewhere, then would use them to level up characters to replace the dead ones or make the newly lv 1 character from class change useful. Given that my game has a low level cap, it wouldn't be too much of an abuse problem I think, so no use limits or anything would be necessary.

Anyway, I figured out I can just make it a consumable item that would call a common event when used on an actor, but how do I determine which actor the item was used on? I don't want to make it ''entire party'',

Thanks in advance!
there are several ways to do this depending on what exactly you want to do and which info you need, but the simplest would be to have the item add an invisible target state in addition to the CE, and then check in the CE which actor has the state to target that.

For more complex data you'll need a script to create data values (there are two, one by Tsukihime and one by Enelvon if I remember correctly)
there are several ways to do this depending on what exactly you want to do and which info you need, but the simplest would be to have the item add an invisible target state in addition to the CE, and then check in the CE which actor has the state to target that.
Hmm all I really need is just a really basic function to help the players.

Can you explain it in a little bit more detail? Im not sure how to check who has the state... ^^' 

I don't really get combat / states too well to be honest, I always give up before I get to any of that... not this time. 😉
An alternative way to do this is to add the line "$game_variables[n] = b.id" into your item damage formula, and then run the common event, in which [n] is the variable checked for in your "Change Level" function.
Can you explain it in a little bit more detail? Im not sure how to check who has the state... ^^' 
For each actor, you'll need one conditional branch.  Select the correct condition from the second tab (actor has state "target" inflicted), and if the answer is yes add the XP to that actor and remove the target state.
Wouldn't it simply work by setting

$game_actors[b.id].change_exp(b.exp + n, true)to the damage formula?(with n amount of exp to give)
Ouu, clever. I was wondering if there was a script function for that.

I'd think you would still have to fetch the value for remaining exp until the next level though, unless there's a function for changing level independently from exp.
Ouu, clever. I was wondering if there was a script function for that.

I'd think you would still have to fetch the value for remaining exp until the next level though, unless there's a function for changing level independently from exp.
Yes I tried it and it changes level too, does not display a level up message though, strangely.
Wouldn't it simply work by setting

$game_actors[b.id].change_exp(b.exp + n, true)to the damage formula?(with n amount of exp to give)
Hmm this is much cleaner and it teaches me a little bit more about how the script works over here 🙂

Thanks! I also wouldn't want the level up message anyway, so thats not a problem.

Original thread: https://forums.rpgmakerweb.com/threads/training-tokens-how-can-i-make-an-item-that-gives-exp.37977/