State effects on walking.

Hey there, I've been trying to make a game mechanic where after being inflicted by a 'state', your MP slowly decreases by how far you walk (on map). And then, once you MP reaches 0 another state is applied.  

I already know I can set my state, so its feature reads Ex Parameter MRG -10%, so I'm currently losing 10 MP per 16 steps.
 

Although I can't seem to figure out how to make a new state inflict the character once my MP is at 0  (which is not during a battle) I'm a lil lost.

I can't say there is much that I've tried doing, because the options I'm aware of would not work. Is there something I'm missing, or can't see?

Also, what constitutes how far you can walk before MP is actually visibly decreased. For instance, I have tried changing it to MRG -1% but it seems like I need to walk forever before it actually starts going down, alternatively I tried setting it to 100% but it still took 17 steps until I lost all my MP. :/

Any advice on any of the above? Thank you! 😀
For something simple, I would have a parallel process event (a common event, if this can happen on any map) that's triggered by a switch. When the first state is inflicted, turn the switch on. Then have it put the player's MP into a variable and check if the variable is 0 or less. If it is, remove the first state, add the second state, and turn the switch off.


Make sure to add a Wait 5 Frames or something like that so it's coming up for air and not causing lag.
Ah, I knew it would be something like this. Thanks for the help Shaz.

Now time to go back to Solitary until my next barricade brings me back.

 
Make sure to add a Wait 5 Frames or something like that so it's coming up for air and not causing lag.
Is adding a wait command for a few frames going to help reducing lag when use a parallel common event on a map?EDITED: Some typos.
Is adding a wait command for a few frames going to help reducing lag when use a parrarel common event on a map?
Always - parallel processes are usually called sixty times per second, and the wait command makes the process skip several of those calls. With a wait(5) for example the process will only be called twelve times per second instead of sixty times.
Always - parallel processes are usually called sixty times per second, and the wait command makes the process skip several of those calls. With a wait(5) for example the process will only be called twelve times per second instead of sixty times.
OMG!! 60 times per second!!? That's really insane!! I must try adding a wait command and see the difference!! Thanks Andar!
Best way to see the difference is to have a number of events set to parallel process all with some command(s) and not having any wait. Then try walking around. Then do it again with a wait as part of each parallel process.


Just make sure it's going to be executed every iteration - not inside a conditional branch or something that may not be run.
Best way to see the difference is to have a number of events set to parallel process all with some command(s) and not having any wait. Then try walking around. Then do it again with a wait as part of each parallel process.

Just make sure it's going to be executed every iteration - not inside a conditional branch or something that may not be run.
I once created a common event running on parallel process on a map to check if the player is in specific region ids, then something would happen. Surely I didn't add wait command and when I tested the event, it was laggy like hell.
Also, what constitutes how far you can walk before MP is actually visibly decreased. For instance, I have tried changing it to MRG -1% but it seems like I need to walk forever before it actually starts going down, alternatively I tried setting it to 100% but it still took 17 steps until I lost all my MP. :/
 
MRG, HRG and TRG doesn't effect per step, it takes a few steps before they are even checked which is why  

alternatively I tried setting it to 100% but it still took 17 steps until I lost all my MP.

Original thread: https://forums.rpgmakerweb.com/threads/state-effects-on-walking.36935/