The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Nekochan on September 22, 2013, 08:23:57 PM

Title: Mp/hp as a conditional branch for events?
Post by: Nekochan on September 22, 2013, 08:23:57 PM
So what I wanted to do was this:

There are certain objects that if interacted with, will ask if you want to use them at the cost of x amount of mp/hp.
There would be a conditional branch checking how much mp/hp the actor has before allowing/preventing the user from interacting with said object.

[Example]
An event over a book case would check to see if you had at least 10 mp.
If you did, you would get a window saying "Would you like to study?" with the appropriate choices and rewards following.
And if you did not have 10 mp, you would instead get a window saying "Sorry, you don't have the stamina for this."


Does anybody know how I can make a conditional branch dealing with mp/hp for events?
Title: Re: Mp/hp as a conditional branch for events?
Post by: &&&&&&&&&&&&& on September 22, 2013, 08:55:27 PM
You posted this in the wrong area dude. Don't worry though, a mod will be along to move it to it's proper place.

Quote from: Board Support / Feedback
Complaints, Name change requests, suggestions, feedback or even just random questions related to RMRK itself.

This board is for questions about this site, not RPG maker. That board is over here (http://rmrk.net/index.php/board,124.0.html).


As for your question. What I find easiest is,
 1. Turn the player's MP into a variable
 2. Use conditional branch to check variable

Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F9Bt8dQf.png&hash=683da322f665c60964e347b581221962e14a919d)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fdk3mmX9.png&hash=c54c0d1a6ee5b690197c9fb3b3721de2112717ff)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FrjERyiJ.png&hash=e5ab06bcc593815532e251a24b84e5dde5784eb1)
Title: Re: Mp/hp as a conditional branch for events?
Post by: Zylos on September 22, 2013, 09:03:42 PM
First thing that comes to mind is a simple one. Simply set a variable before the conditional branch to equal the player's health, and base the conditional branch on that variable.

There is another way too. In the script section of the conditions in the conditional branch pop up, use "$game_actors[x].hp" and either > or < the amount you need, with the x being the actor's number that you want to check. Obviously you can substitute in mp instead of hp, and don't include the quotation marks.
Title: Re: Mp/hp as a conditional branch for events?
Post by: Nekochan on September 22, 2013, 09:25:29 PM
Oh, man I can't believe I missed that. Sorry about posting in the wrong section.
Also, I tested out both methods and they both worked like a charm~

Thanks a bunch for the help, guys!