Is there an easy way to make a State that is removed after a certain amount of hits? My main idea behind it is to create a shield that fully absorbs N number of hits. I cannot really do it with turns or damage as the idea is for the damage itself to be nullified.
State removed after certain number of hits
RPG Maker MZ SupportHave all enemy skills inflict an invisible state.
Have a common event run during each action in combat, on every encounter that checks whether the actor has the shield state on, and if so, checks if they're inflicted with the invisible state from enemy attacks, and if yes, count the shield durability variable down by 1 (set up the shield durability in a common event linked to the shield skill (if it's meant to take 5 hits, set the variable to 5). Next, have it check if the variable is at 0, and if so, remove the shield state. At the end of the event, always remove the invisible state, so it can check for the next attack.
It'll be a pain to set up initially if you have to backtrack a lot of encounters, but I'd always recommend having common events run during turns and actions on all battle encounters to deal with these things.
Have a common event run during each action in combat, on every encounter that checks whether the actor has the shield state on, and if so, checks if they're inflicted with the invisible state from enemy attacks, and if yes, count the shield durability variable down by 1 (set up the shield durability in a common event linked to the shield skill (if it's meant to take 5 hits, set the variable to 5). Next, have it check if the variable is at 0, and if so, remove the shield state. At the end of the event, always remove the invisible state, so it can check for the next attack.
It'll be a pain to set up initially if you have to backtrack a lot of encounters, but I'd always recommend having common events run during turns and actions on all battle encounters to deal with these things.
This took some enginuity! GJ man!
Won't this really slow the game though? These are a lot of checks it seems.
Won't this really slow the game though? These are a lot of checks it seems.
Did what you said and it is working. It will be easy to do if all shields are able to contain only 1 charge since I do not need to keep track on those.
However, if I want to keep track of all possible party members and the shields they have I should have a separate variable for each character/shield combination. My initial variable is to have a formula like this:
v[1] = Character Order Number * 10 + Shield Type Number ; v[v[1]] = Shield Power
Is this expression functional? I am most concerned about the v[v[1]] part.
Making a few tries showed that it seemingly does. Yet, I prefer to have a reconfirmation.
However, if I want to keep track of all possible party members and the shields they have I should have a separate variable for each character/shield combination. My initial variable is to have a formula like this:
v[1] = Character Order Number * 10 + Shield Type Number ; v[v[1]] = Shield Power
Is this expression functional? I am most concerned about the v[v[1]] part.
Making a few tries showed that it seemingly does. Yet, I prefer to have a reconfirmation.
Original thread: https://forums.rpgmakerweb.com/threads/state-removed-after-certain-number-of-hits.126577/