If MP 0 State x is activated

MayoMan

Villager
Member
Joined
Jul 25, 2019
Messages
7
Reaction score
1
First Language
german
Primarily Uses
RMMV
I want to make it possible if a character/enemy use all their mp they become a state (Not able to do anything (like permanent sleep))
But it doesnt work with variables or I'm to dumb.

I found a working script, that let the actor die instead of getting a state:
https://github.com/MoogleX/MV_Plugins/blob/master/Moogle_X_DieAtZeroMp.js

Is there a way to change this little thing? Or does someone know a working script with getting a state instead of getting k.o.?
Thx!
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
As that plugin was written in 2015, it was for a much earlier version of MV, and almost certainly will not work with the current version. As it also doesn't do what you want it to do anyway, it would have to be completely re-written. I suggest, therefore, that you go for the option of a different plugin.

[move]JS Plugin Requests[/move]
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,118
Reaction score
1,526
First Language
EN
Primarily Uses
RMMZ
Could try Yanfly's Auto Passive States plugin: http://www.yanfly.moe/wiki/Auto_Passive_States_(YEP)

You can assign the "0 MP" state to all actors/enemies via the plugin parameters, or only specific actors/enemies via notetags:
Code:
<Passive State: x>
(Replace x with the state's ID.)

Then for the state itself, you can set it up however you like (e.g. Restriction: Cannot Move), and give it this notetag:
Code:
<Passive Condition: MP Below 1>
This will make the state only be active when the battler's MP is less than 1 (i.e. 0). :)
 

MayoMan

Villager
Member
Joined
Jul 25, 2019
Messages
7
Reaction score
1
First Language
german
Primarily Uses
RMMV
Thank you man! :smile:

Could you also say me, if there is a way to increase variable x when the state (Cannot Move) is activated? So if variable "x" become "y" I can end the battle with a common event because every fighter has the state now?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,118
Reaction score
1,526
First Language
EN
Primarily Uses
RMMZ
Oh, hm. Maybe check out Custom Death States plugin by Himeworks? It lets you add a <custom death state> notetag to a state's notebox, which makes it mark the affected battler as "dead". Hopefully it works with the passive states plugin, I haven't tested~ :kaothx:
 

MayoMan

Villager
Member
Joined
Jul 25, 2019
Messages
7
Reaction score
1
First Language
german
Primarily Uses
RMMV
The problem with himeworks plugin is it triggers when your party OR all enemies are getting the state and the battle ends.
But I need something which only triggers if your whole Party AND the enemies get the state.
(to clarify, 3 VS 3 battle, every actor/enemy has x attack points, when their ap become 0 they become the state "cannot move", thats working fine, but if every actor + enemy has this state i wanna end the battle (because nothing will happen at this point), thought it could work easy with a variable, but I dont know if its possible that a state gives +1 to variable x)
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,118
Reaction score
1,526
First Language
EN
Primarily Uses
RMMZ
I see... One solution may be to use a troop event, e.g. one with Condition: Turn End and Scope: Turn; this will run at the end of every turn of battle. Then in that event you can check if the state is on all battlers. In theory that's possible with only event commands, but I'm too lazy for that. :kaoslp: Instead, you can use this in Conditional Branch > Script:
Code:
$gameParty.aliveMembers().concat($gameTroop.aliveMembers()).every(function(m) { return m.isStateAffected(11); })
This will be true iff all living party members and all living enemies are affected by state 11 (change the number as needed). Then you can do a game over or whatever inside the branch, e.g.
Code:
◆If:Script:$gameParty.aliveMembers().concat($gameTroop.aliveMembers()).every(function(m) { return m.isStateAffected(11); });
  ◆Text:None, Window, Bottom
  :    :It's a draw! \.Nobody wins!
  ◆Abort Battle
  ◆
:End
If you need this on all troops, you may find Yanfly's Base Troop Events plugin helpful to avoid lots of copy+paste. :kaopride:

If you really need to count the number of battlers affected, you could try this sort of thing instead:
Code:
$gameParty.aliveMembers().concat($gameTroop.aliveMembers()).reduce(function(acc, cur) { return acc += cur.isStateAffected(11) ? 1 : 0; }, 0)
This will return the total number of living actors/enemies affected by state 11; you could use this in Control Variables > Script, then use that variable wherever you like~
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top