MP in conditional branch

Hi guys. I would like to check in conditional branch amount of MP.   By default it doesn't have such option. Do you have any ideas how it can be implemented. Maybe some script or plugin?
Set a variable to the MP of the character you want to check first.  Then use that for the conditional branch.
You can set a variable to store the actor's MP and then check the value.

First insert the command "Control Variables..." in your event.

Nr3nywq.png



Then, in the "Variable" box select "Single", choose one variable, set a name and confirm. On the "Operand" section, select "Game Data" and click on the selection box.


HocW8Y0.png



In the "Game Data" section, select "Actor", choose the desired actor and in the next drop-down menu select "MP".


mFkSPp3.png


This will set the current MP value of the actor "Hero" to the variable "0001 Actor_MP" and you will be able to use the said variable in the "Condition Branch..." command.
Set a variable to the MP of the character you want to check first.  Then use that for the conditional branch.



I was thinking to that. But I don't see that option. Could you give me some quick guide how to do it?


Thanks.
I was thinking to that. But I don't see that option. Could you give me some quick guide how to do it?


See my post above. I posted some screens with the commands you'll have to use.
However, there is one problem with that approach. It seems that variable doesn't reflect dynamic change in MP.  So I need constantly to correct it as well.
Some more details on what exactly you're trying to do would be helpful, then. Is this in battle? Out of Battle? skill related? Adding a state? If we know exactly what you're attempting, we can help you out a bit more.
You can use the "Script" condition in Conditional Branch to check a character's current MP directly, without using variables.  I think the condition to check whether the first member of the Party has more than 50 MP would be:


Game_Party.members()[0]._mp > 50


If you want to check a specific Actor no matter where they are in the party, you cancertainly do that too, but offhand I don't know what MV's syntax is for referencing them.
You must re-set the variable value every time you need to check it. It's only a single command, but depending on what you want to achieve it can reflect on additional work, of course.

If you can explain in details what you want to do with that, perhaps we can think in a more practical solution.
The entire difference is using two commands instead of one - you'll need to use the control variable command before you use the conditional branch, exactly in the same event on the line before the conditional branch. it doesn't need to be constantly updated, it just needs to be updated before you check it.
I have created a skill called stealth mode.  it is from yanfly plugin.   This skill is on button press which in its turn trigger common event.  But I want it to be mana cost. Therefore I need to add something which could check amount of mana before entering this stealth mode.   That is what I want to achieve.


It seems the solution is found.
@Natali That description still doesn't add up or explain why you can't use the control variable command.


If you want to make the skill cost something for a time, simply make that the skill cost and set the correct time for the effect in the common event.


If you want to make the effect dynamic based on remaining mana, then you have to add the conditional branch checking for mana into a parallel process anyway, and there is no difference to adding the control variable command before the conditional branch command.

Original thread: https://forums.rpgmakerweb.com/threads/mp-in-conditional-branch.60814/