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.
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!