Request: Removes status based on note tag

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
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!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
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.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,317
Reaction score
537
First Language
indonesian
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.
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
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?
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
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.
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
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!
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
You're welcome!
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
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
 
Last edited by a moderator:

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
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!
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
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).
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
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.
 
Last edited by a moderator:

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
With that update, and a bit of cleaning up, it works perfectly. Thanks for all the explaining and help!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

On my journey of character rework: I had this character, she was meant to be just a princess that joins your party. And at long term she was just uninteresting... So I tweaked her to be a rebel agaisn't the royalty before meeting up with the party.

Quick tip for any other ametuer pixel artists! When trying to create a colour palette, enabling Antialiasing can speed up the process of creating different shades! Just place your lightest colour and your darkest colour next to each other, select both pixels, and stretch it out!
Revolutionizing the JRPG Industry: Knocking on Doors.

Take that, murderhobos.
Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.

Forum statistics

Threads
106,054
Messages
1,018,580
Members
137,843
Latest member
Betwixt000
Top