.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,497
Reaction score
5,334
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

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top