Request: Removes status based on note tag

Hello,

What I am requesting today is a script that would be able to remove x amount of status based on notetag. So, for example, if a skill had <remove states: 1-100> all states 1 to 100 would be removed. <remove states: 1, 2,3, 4, etc> would also work.

Is this possible?

Thanks for your time!
A common event attached to the skill wouldn't work for this?


You could use a script call to avoid the need for 100 Remove State commands.
using common event...

there might be problem to set the target which will got the state removed.

in ACE it work that way...

maybe using damage formula to remove the state?

using 'for' loop and removing the b's state inside that loop.
Something like this?

class Game_Battler < Game_BattlerBase def states_remove(count = 1) while count > 0 ; remove_state(states[0].id) ; count -= 1 end endendIn your damage formula you could use a.states_remove(count) or b.states_remove(count) where count is a the number of states to remove.
Why do people think that complex?


Why don't you just use the effect "remove state" with a very high probability to ensure that it will always happen?
Well, the OP didn't make it clear what he/she really wants. Thus there comes 2 interpretations of "what he/she meant".

At 1st OP wrote about removing an X amount of states. But the later descriptions show that it's actually removing states based on IDs.

[1] estriole is correct about the common event, you will need a formula to put the target's id into a game variable for the common events to work.

eg. in your damage formula box. place in:

$game_variables[1] = b.id; 0then use that game variable as an id to remove the target's state in your common event.

the mention about removing the states in damage formula should work like this:

removing 1-100

(1...100).each do |s| b.remove_state(s+1) endremoving only certain ids

[1,4,6,20].each do |s| b.remove_state(s) end[2] If it's based on ID, Rinobi's way will not work since it's trying to remove X amount of states no matter what ID it is.

[3] Andar's way is fool proof and 100% working without a need of script. Just add the remove state in your skill effect should do the trick.
Hello everyone,

My apologizes if I wasn't clear, something tells me I should post when I'm half dead lol.

To clarfy I was looking for a script that would remove multiple status based on ID. The <remove states 1-100> was ment as that database id number, not number of status removed. So again, my apologizes there. Now with that being said, if it's simply easier to mass remove the first x in the database rather than based on id. Well that's ok to, it's just a simple edit to my states database and we are good to go.

Something like this?

class Game_Battler < Game_BattlerBase def states_remove(count = 1) while count > 0 ; remove_state(states[0].id) ; count -= 1 end endendIn your damage formula you could use a.states_remove(count) or b.states_remove(count) where count is a the number of states to remove.
If, for example, the (count) was 100, would the first 100 states in the database be removed? This could actually easily work as I have all the bad status effects listed first.

Why do people think that complex?

Why don't you just use the effect "remove state" with a very high probability to ensure that it will always happen?
I was looking for a shortcut for removing a large number of status effects at once, not a probability chance.

Well, the OP didn't make it clear what he/she really wants. Thus there comes 2 interpretations of "what he/she meant".

At 1st OP wrote about removing an X amount of states. But the later descriptions show that it's actually removing states based on IDs.

[1] estriole is correct about the common event, you will need a formula to put the target's id into a game variable for the common events to work.

eg. in your damage formula box. place in:

$game_variables[1] = b.id; 0then use that game variable as an id to remove the target's state in your common event.

the mention about removing the states in damage formula should work like this:

removing 1-100

(1...100).each do |s| b.remove_state(s+1) endremoving only certain ids

[1,4,6,20].each do |s| b.remove_state(s) end[2] If it's based on ID, Rinobi's way will not work since it's trying to remove X amount of states no matter what ID it is.

[3] Andar's way is fool proof and 100% working without a need of script. Just add the remove state in your skill effect should do the trick.
And finally thanks for clearning all that up!
You're welcome!
Something like this?

class Game_Battler < Game_BattlerBase def states_remove(count = 1) while count > 0 ; remove_state(states[0].id) ; count -= 1 end endendIn your damage formula you could use a.states_remove(count) or b.states_remove(count) where count is a the number of states to remove.
I'm sorry to bother you with this, but I seem to be having a bit of a problem with it. The script works normally with removing x amounts of states (weeeee), however anything that comes after the b.states_remove(count) just doesn't work. For example I have a healing spell that restores x amount of hp and removes the states. The states get removed but the healing part just doesn't work. In fact it comes up as 0 hp damage.

To clarfy:

b.states_remove(499); 200 + a.mat *2.5  will return all status removed but "hit" the target actor(s) for 0 hp damage

200 + a.mat *2.5 will return a normal heal.
Make sure you set the damage formula to heal hp and not damage hp.

Not sure about Rinobi's script but a quick formula try works on my end.

This remove states 1,4,6,20 and heal 200

Code:
[1,4,6,20].each do |s| b.remove_state(s) end; 200
I was using Rinobi's script there ^_^

And that is what confused me so, the skill is already set to healing hp. It only changed when I added the b.states_remove(count). So strange >_> I'm going to give yours a go and see how that goes. I'm pretty sure it's not a script conflict, but if it is, might be time for another pass. In any case, thanks again!
Nope, certainly not Rinobi's script, since that should work normally like a remove_state command.

If the example i gave above isn't working, then it's confirmed that there's another script tinkering with how the damage formula is read.

edit:

by the way, there's a small typo in that example. simply use (s) and not (s+1).
With my script, you're probably getting a null effect whenever there aren't any (or enough) states to remove, correct? It's likely not working because it's trying to remove something that isn't there. I didn't really take that into consideration at first. Try this instead:

class Game_Battler < Game_BattlerBase def states_remove(count = 1) while count > 0 return count = 0 unless !states.empty? remove_state(states[0].id) ; count -= 1 end end # states_removeend # Game_Battler < Game_BattlerBaseIt is just an update, so its called the same way.
With that update, and a bit of cleaning up, it works perfectly. Thanks for all the explaining and help!

Original thread: https://forums.rpgmakerweb.com/threads/request-removes-status-based-on-note-tag.52411/