I separate the states into various categories using YEP_X_StateCategories, with the objetive of making an ability that when it hits the enemy removes a random state from a category "x" from the enemy, but the truth is that I don't know how to do that. Somebody could help me
MV Help with a new skill
Javascript/Plugin Supportyou would give all the states in question the notetag
<Category: text>
then the skill would have the notetag
<Remove X State Category: text>
change text to whatever you want the grouping to be.
change X to the number of states from that grouping it would remove.
note that this plugin doesn't remove "random" state
it will remove the state with the highest priority number in the database.
if multiple states have the same priority number it will remove the 1 with the lowest state ID
if you want it to actually be random it would have to be done another way.
such as making the skill applying a "target" state and then run a common event
event :
variable set: random number between 1-X (X being the number of possible states it could remove)
if enemy 1 has "target" state
> if variable = 1
>> remove state A
> if variable = 2
>> remove state B
....
if enemy 2 has state "target"
> if variable = 1
>> remove state A
...
...
at the very end of the event remove state "target" from everyone
edit: this method isnt by any means perfect. if A is poison but target isnt poisoned the skill wont remove anything. you could make the event MUCH bigger by adding loops in the event that redo the random number if target didnt have the state.
a script method "might" work better but i dont know script
or could just stick to the plugin method but change the skill description so it doesnt say "random" but instead says "remove the most dangerous ailment" assuming use the term ailment for the state category
<Category: text>
then the skill would have the notetag
<Remove X State Category: text>
change text to whatever you want the grouping to be.
change X to the number of states from that grouping it would remove.
note that this plugin doesn't remove "random" state
it will remove the state with the highest priority number in the database.
if multiple states have the same priority number it will remove the 1 with the lowest state ID
if you want it to actually be random it would have to be done another way.
such as making the skill applying a "target" state and then run a common event
event :
variable set: random number between 1-X (X being the number of possible states it could remove)
if enemy 1 has "target" state
> if variable = 1
>> remove state A
> if variable = 2
>> remove state B
....
if enemy 2 has state "target"
> if variable = 1
>> remove state A
...
...
at the very end of the event remove state "target" from everyone
edit: this method isnt by any means perfect. if A is poison but target isnt poisoned the skill wont remove anything. you could make the event MUCH bigger by adding loops in the event that redo the random number if target didnt have the state.
a script method "might" work better but i dont know script
or could just stick to the plugin method but change the skill description so it doesnt say "random" but instead says "remove the most dangerous ailment" assuming use the term ailment for the state category
Deleting a state by its priority also works, Thanks
Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-new-skill.128194/