Help!? Removing a status with conditional branches???

I've kind of literally never asked a forum for help on stuff ever in my life and I also don't know jack about programming. I've just been learning while I help friends with a fun short project but I'm running into an issue...

I've set up a conditional branch to add a specific state when the MP bar gets to certain percents. And this works! However, I need the stat to be *removed* when the MP bar is not at a specific state.

To explain better, its something like a vampire mechanic where you have to regularly consume blood, if you go under you start taking damage per turn (like poison) but if you go over you go into a blood lust and become uncontrollable.

to re-state. *adding* the new effects works just fine. They go on at exactly as they should. But then they won't come off. I've tried many ways to get this to happen and nothing works. Below is some screenshots of what I got to maybe help as well?

upload_2018-7-1_15-4-23.png


and here's what I have set up on the state itself if that would help too
upload_2018-7-1_15-5-10.png


I plan to do more with all this of course but first things first I need it to come on/off on time.

If you need more info or, if I'm not doing something right please let me know!
Putting the command to remove the state in the else section of the Branch should work.
Putting the command to remove the state in the else section of the Branch should work.

Unfortunatly I've already tried that...I'm not able to take more screenshots right now to show but it's one of the first things I did. I can show it in a bit tho.
-You set variable 4 to be the player's max MP.
-You divide variable 5 by 80, but you haven't set it to be anything yet. Is variable 5 initialized somewhere else?
- You set variable 5 to be Eric's MP - line 2 above doesn't matter now.

In your condition you compare variable 5 (Eric's MP) to variable 2 - but you haven't set variable 2 to anything in this event, is it set somewhere else? You've also never used variable 4 - maybe you meant to use that instead of 2?

Assuming you haven't initialized variable 2 anywhere then variable 2 will be 0. This means that the condition you've set up will always be true, since variable 5 (Eric's MP) will always be greater than or equal to 0.
-You set variable 4 to be the player's max MP.
-You divide variable 5 by 80, but you haven't set it to be anything yet. Is variable 5 initialized somewhere else?
- You set variable 5 to be Eric's MP - line 2 above doesn't matter now.

In your condition you compare variable 5 (Eric's MP) to variable 2 - but you haven't set variable 2 to anything in this event, is it set somewhere else? You've also never used variable 4 - maybe you meant to use that instead of 2?

Assuming you haven't initialized variable 2 anywhere then variable 2 will be 0. This means that the condition you've set up will always be true, since variable 5 (Eric's MP) will always be greater than or equal to 0.

OH crud you're right...I fixed it all up but unfortunately that did not resolve the issue. I apologize for that though, I have difficulty reading out numbers and letters sometimes (especially if they're close together like "MP" vs "MMP"). I hoped fixing this would resolve everything but like I said it's still going...here's another screenshot of the changes:

upload_2018-7-1_16-37-22.png


What I'm also confused about is the state itself is set to auto-remove after a single turn. If I take out all this event stuff and just give the state to the player directly this works fine. After getting the state and taking a number of steps it leaves just fine. So why does the program keep adding it on? Especially if the MP is too low to meet the condition?
I'm not familiar with VX Ace, so I don't know the specifics regarding Common Event processing. However, in other makers, the parallel common event would run (almost) always on basic maps whenever your condition switch is on, which means it'd constantly refresh the state if the condition is true. (Having too many parallel process events will slow your game down btw.)

Anyway, regarding the condition always being true.. Right now you're asking the condition if eric's MP >= eric's max MP/80 - That means that in order for this to be false (and the state to not be applied) Eric's MAX Mp has to be eighty times larger than his MP... that's quite a large difference. Variables also stay as integers so when you divide the max mp by 80, it'll do rounding. So if you have a max mp of say... 75, and it divides by 80... it'll set that variable to 0 again.
I think I got it? To be honest I got the idea off another forum and that's what they suggested, but now that you point that out I see the problem. But now...what should I do? Does anyone know how to get a variable to equal 80% of a players max MP? (this is a randomly chosen percent, any percent will do its just for example)
I GOT IT!!! I finally figured out how to just write the equation as a script and made that a variable.

upload_2018-7-1_20-12-1.png


This may be a bit clunky but it *works* for now. Thank you to everyone for helping!!! (and pointing out my dumb mistakes haaaa)

If you know a better way to accomplish the above tho let me know. But I'm just happy to have something that works.

Original thread: https://forums.rpgmakerweb.com/threads/help-removing-a-status-with-conditional-branches.97117/