Changing Death requisites. (MP death)

So i'm doing something a little interesting here, and i've sort of hit a snag. In this game i'm working on, there is permadeath for characters. But that permadeath is based on what i've turned the MP into, which is LP (Lifepoints). When people get hit by normal attacks, they take hp dmg as normal, and slight amounts of LP damage. When they hit 0 hp, they get "knocked out" (death state) but can be revived through treatments and healing. But LP is different. It can only be increased through special means. The thing is, if that LP ever reaches zero, it's real death. You can't bring the characters back. But as things are, you can reach 0 LP before reaching 0 hp, depending on how you take damage, and how you manage your HP and LP. 


I am looking for a way to make that happen. I have figured out how I can do this by using variables that are tied to a specific actors gamedata MP number, and have a conditional branch always running a parralel process to see if that variable reaches zero, and to run an event when it equals 0 or less, but the thing is, there are way too many characters. At this moment in time there are 27 characters, and there are going to be many many more.. (It's sort of a fortification defense game). 


Just with 27 characters alone, i would need 27 unique variables, being checked by 27 unique parralel common events for each of those 27 characters..


There must be a simpler way to accomplish this? I mean.. It -could- be done.. but ... that's a lot of processing... And a lot of work..


----


Well... I can actually stuff all those 27 variable-updates-and-checks into a single parralel running common event, instead of 27 seperate ones. That makes it 27 times easier.. But i'm still wondering if there's even an easier way to make this work.. That's still 27+ unique variables.


That puts me down to the following usage:


1 switch


1 common event


27 variables..


Actually that's not really that bad..
There's no function in RPG Maker to make this easier, since this is an obscure kind of mechanic that most RPGs don't use.  So you either need to event it (like you described), or make/request a Plugin that can do what you're asking for.


(There's also a middle ground where you can simply use some JavaScript in your event body to, for example, loop through each member of the party and remove them or apply some state if they have 0MP.  That would save you a lot of effort and would also reduce processing load considerably.)


By the way, Common Events can't run during battle.  You say your game is a Tower Defense type of thing, so maybe all of your "battle" is actually taking place on the map, in which case you're fine.
You could do it with just 1 variable, using a loop and a simple script call.


$gameActors.actor(actorId).mp // will return the mp of actor [actorId]
$gameVariables.value(variableId) //will return the value inside variable [variableId]


Here have a screenshot to show how it can be done:


iD2FBe5.png



Detailed breakdown of what happens:

  • Variable 6 is set to 0
  • The loop begins
  • We increase variable 6 by one
  • We check if the mp of the actor of actor Id inside variable 6 is <= 0
  • If it is we do stuff
  • We check if variable 6 is >= to the maximum number of actors (change 27 accordingly)..
  • If it is we break the loop
  • If it isn't we continue the loop.

You can change the variable number as you see fit.


By adding conditionnals to check the value of variable 6 you can even do special things for some actors determined by their id.


Edit: some things are not innately possible to do via actor Id, such as adding/removing party members. To do this, as Wavelength said, you'll need some script calls (or a lot of conditionnals, but that kinda defeats the point). You can see a list of those in this thread.





You could even do it without any game variables but it will be done only with javascript then.
You need this.

http://himeworks.com/2015/11/custom-death-states/
By the way, Common Events can't run during battle.  You say your game is a Tower Defense type of thing, so maybe all of your "battle" is actually taking place on the map, in which case you're fine.



My battles are in battlescreens, but I don't need it to check during battle. After the battle, it can run checks on all the actors and event anyone who died.

You could do it with just 1 variable, using a loop and a simple script call.



$gameActors.actor(actorId).mp // will return the mp of actor [actorId]
$gameVariables.value(variableId) //will return the value inside variable [variableId]


Here have a screenshot to show how it can be done:


iD2FBe5.png



Detailed breakdown of what happens:

  • Variable 6 is set to 0
  • The loop begins
  • We increase variable 6 by one
  • We check if the mp of the actor of actor Id inside variable 6 is <= 0
  • If it is we do stuff
  • We check if variable 6 is >= to the maximum number of actors (change 27 accordingly)..
  • If it is we break the loop
  • If it isn't we continue the loop.

You can change the variable number as you see fit.


By adding conditionnals to check the value of variable 6 you can even do special things for some actors determined by their id.


Edit: some things are not innately possible to do via actor Id, such as adding/removing party members. To do this, as Wavelength said, you'll need some script calls (or a lot of conditionnals, but that kinda defeats the point). You can see a list of those in this thread.





You could even do it without any game variables but it will be done only with javascript then.



Ah hah! Brilliant! So this script assigns a single variable to an actor, then runs the rounds of both a check aswell as event if it's applicable to whatever actor that variable is currently assigned to. Once it's done, it moves to the next actor ID and assigns the same variable to THAT actor, then checks and events to that actor, then so on..


That should work! Thanks a ton!




I actually need a simple plugin that allows me to just apply the deathstate (slot 1) to someone when their mp reaches 0. The rest can be finalized with the above posts. This is a neat plugin, but it doesn't seem to allow a deathstate to occur at 0 mp...


I'm currently looking around for a simple plugin to do that, as the rest seems to be figured out, but I can only find things for vxace... has no one made one for mv yet?


Yanfly's auto passive states does this!

Original thread: https://forums.rpgmakerweb.com/threads/changing-death-requisites-mp-death.64333/