The problem I'm having is that under the "Grow" option for item effects, only lets you increase stats but not give exp. Under 'special effects' the only option is escape. I tried making a common event but the only options are to give exp to the whole party or a pre-selected actor. But I want the exp to go to whoever the item was used on. Is this possible? I included a couple screenshots.
Item that grants EXP to character it's used on?
RPG Maker MV SupportI think that if you used the Formula Box to restore HP instead of the Effects Box, you could save the target's Actor ID to a variable, and then choose the 'Variable' option for Actor in the Gain EXP event command. I forget the exact syntax (it's something like $gameVariables.setValue(x, b.id); 100 but part of that might be a bit off; someone correct me if it is, please!), but since the Common Event runs after the formula, this approach should give you exactly what you need.
You can reach the effect you want using common event in a very simple way. Use the script command and write this code:
This way, the actor who used the item will gain the exp itself 😀
Code:
var actor = $gameActors.actor($gameParty._targetActorId)
actor.changeExp(100);
This way, the actor who used the item will gain the exp itself 😀
Thank you so much! I tried it out, and it works, but I think what's it's doing is changing the total amount of exp to 100, instead of increasing by that amount. How would I change the code for that?
@silversteampunk
Oh! I'm sorry, I missed a thing in the code 🙂
// The true statement means that if the actor gain a new level, that level will be displayed (as the editor command)
Now, should works properly 😀
Oh! I'm sorry, I missed a thing in the code 🙂
Code:
var actor = $gameActors.actor($gameParty._targetActorId)
actor.changeExp(actor.currentExp() + 100, true);
// The true statement means that if the actor gain a new level, that level will be displayed (as the editor command)
Now, should works properly 😀
Wouldn't it be easier just to do b.gainExp(100);0 in the damage formula box.
Yes, when I wrote the reply I forgot about that method 😅
If I were to put this in the formula box, what type of damage would I put it under? I tried putting it under HP Damage and HP Recover. For Recover none of the characters are missing HP the game doesn't let the item be used on that character. I also tried it under HP Damage, but I get the "buzzer" noise that I can't do that action.
Original thread: https://forums.rpgmakerweb.com/threads/item-that-grants-exp-to-character-its-used-on.79975/

