I wanted to add an item that allows the player to choose which party member gets an EXP injection. Wondering if this is possible without plugins since the closest I've gotten to this is creating a common event that gives an EXP boost to all party members instead of just one. Any help would be much appreciated 🙂
Item that gives a single party member EXP of the player's choosing
RPG Maker MZ SupportSimple way: put in its damage formula
That will make the actor you use it on gain 69 experience, but will also display 0 damage dealt/healed.
To make it slicker with no fake damage, you would:
- In the Effects list of the Item, apply a blank dummy state
- In the Effects list of the Item, call a Common Event
- In that event, have conditional branches for every actor
- Those branches say "if the actor has the dummy state, give them EXP then remove the dummy state"
b.gainExp(69); 0That will make the actor you use it on gain 69 experience, but will also display 0 damage dealt/healed.
To make it slicker with no fake damage, you would:
- In the Effects list of the Item, apply a blank dummy state
- In the Effects list of the Item, call a Common Event
- In that event, have conditional branches for every actor
- Those branches say "if the actor has the dummy state, give them EXP then remove the dummy state"
For the common event approach, MZ has Control Variables -> Game Data -> Last Target Actor ID, so you don't have to go the long way around with a state.
@ATT_Turan @caethyril
These work beautifully, thanks! The only issue I'm having now is allowing the item to be continuously used without the player having to go into the item menu and reselect the item after each use. Here's how I have it set up now, but I'm not sure how to force an item from the player's inventory to be used. If there's a better way though, I'd love to hear it :,)
These work beautifully, thanks! The only issue I'm having now is allowing the item to be continuously used without the player having to go into the item menu and reselect the item after each use. Here's how I have it set up now, but I'm not sure how to force an item from the player's inventory to be used. If there's a better way though, I'd love to hear it :,)
I haven't tested - will that allow the item to be used? I thought an item used in the menu would give a cancel noise if it wouldn't change the condition of the target (like the "had no effect" message in battle).
@CapitalAkito I think it's kicking back to the menu because of the common event.
It seems to work for how I'm using it at least. It allows me to use the item, exits out of the menu and then a text pops up with "x party member is now lvl 5!". Is there a way around this btw? I'd imagine this would get super annoying for the player if they have quite a few of these.
...but you aren't actually doing what caethyril suggested. You have a common event that's setting a variable and then you're not doing anything with it.
And then it has a conditional branch that's unnecessary because the party has to have the tome if using the tome is what calls this common event.
The event is doing nothing.
You're able to target an actor with it because you have stuff in the damage formula from my original suggestion.
Having that variable line in the common event allows the item to be used. Without that, it won't let me use the item. As for the conditional branch, I was just testing to see if I could get around the menu closing by forcing the party to reuse the item if they had another one in their inventory. Not sure how I would do that though
Then you don't need anything in the damage formula and you can do it entirely as caethyril described, using the Change EXP event command. There's not really any point in having both things in there.
You could try to push the player back to the item scene with the tome selected in a script box, but I've seen people report janky results. Try searching for common event not closing menu.
If you don't want it to have a common event that throws you out of the menu, can't you just have it have a fake effect, like 'add state (empty state)' + 'remove state (empty state)'. That way you can use it in the menu.
It works! Thanks a ton 🙂
Cool! Do note however, that if you gain multiple levels while using that item in the menu, when you exit, you'll receive multiple messages, like "Actor A is now level 2", "Actor A is now level 3" etc. Or that's at least what seemed to happen to me when I tested it a while ago. If you want to change that, you'll need some additional changes (or handle the whole thing differently).
I was assuming a Common Event effect on the item, so yes. More precisely, the core action effect check (plugins might change this) goes through
testApply -> hasItemAnyValidEffects -> testItemEffect. That allows use of the item if it has at least one of the following:- Recover HP/MP with:
- Positive value (heal) when not at max; or
- Negative value in either field, i.e. flat and/or percentage damage.
- Add State when not already affected;
- Add (De)buff when not at max (de)buff level;
- Remove State/(De)buff when target is affected;
- Add Skill when target has not already learned that skill;
- Any other effect.
EDIT: Works in the effects
Hmmm, I tested it and it doesn't allow me to use items that would do damage to me (even 0)? And if I try a recover with negative value, that doesn't work either.
Also, you can't grow a value by 0 in the effects?
Also, you can't grow a value by 0 in the effects?
Oh, I overlooked that the editor doesn't allow Grow +0, sorry. 😴
Just tested and Recover HP -1, with no other effects and damage type None, allows me to consume a whole stack of the test items. Check your plugins?
Just tested and Recover HP -1, with no other effects and damage type None, allows me to consume a whole stack of the test items. Check your plugins?
Ok, I was stuck on the damage formula 😀 Didn't try the recover effect.
Original thread: https://forums.rpgmakerweb.com/threads/item-that-gives-a-single-party-member-exp-of-the-players-choosing.161596/