I was wondering if there was a way to have an item work for more than one battle. My idea was to have an item that, when used, worked for 4-5 battles before causing an actor to go into a particular state. Is this even possible?
Item Usage for More than one battle
RPG Maker VXAce SupportYou might be able to increment a variable as part of your damage formula, but then you'd have to have something to check its value and change the actor's state, and I don't know that the formula box would handle all of that.
Maybe have the item call up a common event which has the variable in it?
Would there be a way to tell the common event when a battle's taken place (run or win, random and evented)?
So if I understand correctly you are not asking for a charge on items but more of an enhancer type item that once used will last for 5 battles whether you continue to use the item or not, so the timer is by battle and not by times used?
If so that isn't that hard, just create a troop event(in every troop) that activates by a switch being on and has a span of battle. Underneath it use a conditional branch that variable ==5 and if true add your state and remove the item or anything else you want to happen when 5 battles have been fought.(be sure to rest variable to 0) On the else branch just make your variable += 1 and if it isn't valid it will just add one battle to your counter.
Then of course it's just a matter of hooking up your item to a common event that turns on said switch, not sure about checking for escape though, if your battles are touch encounter you could cover it on there event pages, random not so much control though.
If so that isn't that hard, just create a troop event(in every troop) that activates by a switch being on and has a span of battle. Underneath it use a conditional branch that variable ==5 and if true add your state and remove the item or anything else you want to happen when 5 battles have been fought.(be sure to rest variable to 0) On the else branch just make your variable += 1 and if it isn't valid it will just add one battle to your counter.
Then of course it's just a matter of hooking up your item to a common event that turns on said switch, not sure about checking for escape though, if your battles are touch encounter you could cover it on there event pages, random not so much control though.
Ok, that sounds not hard at all, thanks! If I can't find a way to increase the variable for escaped battles, it's not a big deal, as if I think about it, there would be no point in doing that for a battle they didn't finish.
By default it will increase it as it should run at the start of battle whenever the switch is on. I thought you wanted to do something different during an escape.
Oh no, not at all. I just wanted any battle to count toward the 5 battle total, and in the 6th battle, or at the end of the 5th battle, or after it, the state would pop up.
But if it's a battle count, what happens if the item is not used in a particular battle? I had assumed from the way the op and topic title were worded that the focus was on using the item 5 times and then the state kicks in. If it's a battle count then the item is irrelevant. Could you clarify?
I want to have an item, which when used, either in or out of battle, whose effects will last 5 battles, and when 5 battles are fought or absconded from, it causes a particular state. I definitely phrased it wrong, but using an item and having it last for a set number of fights is what I was looking to accomplish.
Oh so you don't want USE of the item to last for that long. You want the item to apply an effect when used the first time, and the EFFECT is what lasts for 5 battles? In that case I'd be looking at making the item apply a state (and then maybe make itself unavailable - easy if it's consumable), then figuring some way to count how many battles, and remove the state after that many battles and adding the new state. I've got something like that going myself, but it's not based on number of battles, which is the awkward part.
Oh I see. Well that shouldn't be hard then. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/item-usage-for-more-than-one-battle.21717/