.isStateAffected(N)

Status
Not open for further replies.

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
how do i check for multiple states without flooding note space of a state?
With my frozen state i'm checking if the battler have one of my other states, then removing it
this is a template i made:
<Custom Apply Effect>
if (target.isStateAffected(2) === true){
target.removeState(2);
}
if (target.isStateAffected(4) === true){
target.removeState(4);
}
if (target.isStateAffected(5) === true){
target.removeState(5);
}
if (target.isStateAffected(6) === true){
target.removeState(6);
}
if (target.isStateAffected(7) === true){
target.removeState(7);
}
if (target.isStateAffected(8) === true){
target.removeState(8);
}
if (target.isStateAffected(9) === true){
target.removeState(9);
}
if (target.isStateAffected(10) === true){
target.removeState(10);
}
if (target.isStateAffected(12) === true){
target.removeState(12);
}
... and so on.

since no all states from 1 to max are noted, i need a compacted version that allow me to custom select the ids.
</Custom Apply Effect>it's so ugly and long, i need something better than this and I'm still learning javascript.

Any help is appreciated.
 
Last edited:

Randor01

Veteran
Veteran
Joined
Dec 24, 2018
Messages
88
Reaction score
15
First Language
Italian
Primarily Uses
RMMV
You could use the "Status Resistance" trait for the Frozen Status.
This way you can set all the Statuses that you want to be removed when Frozen is applied.

Or, if you want to use JavaScript, use this in <Custom Apply Effect>:
Code:
var status;

for(status = 1; status <= "the number of statuses in your database"; status++)
{
   if (target.isStateAffected(status))
   {
     target.removeState(status);
   }
}
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
yeah i forgot the state resist erasing, thanks anyway xD
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,496
Reaction score
5,330
First Language
english
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:
Microsoft: Hey, let's waste money advertising the Xbox Series X when nobody has any in stock, we don't seem to be making more, we aren't taking preorders and you can't get on a waiting list. BEST. IDEA. EVER.
So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.

Forum statistics

Threads
105,635
Messages
1,015,171
Members
137,307
Latest member
MrKaito
Top