Mp/hp as a conditional branch for events?

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 38
RMRK Junior
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?

*
i am satin die lol
Rep:
Level 96
welcom to hel
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
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.


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:




********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Randomizer - GIAW 11Gold - GIAW 11 (Hard)Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Mapping)2012 Best RPG Maker User (Programming)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Best Veteran2011 Kindest Member2010 Best RPG Maker User (Story)2010 Best RPG Maker User (Events)
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.




*
Rep: +0/-0Level 38
RMRK Junior
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!