RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Hp/Mp Value as a conditional branch/ variable? RMVX

0 Members and 2 Guests are viewing this topic.

**
Rep: +0/-0Level 56
One Swift Kick
Hello.I am using Rpg Maker VX. In My Game I Have common events that are linked with certain items/ armors.
For example, i have an invisibility cloak, that, when equipped will make you "Invisible" as long as you hold R button.
I have it set up to drain mp as it is being used, but when mp is zero i can still use it and it doesn't quit.

is there a way to make it so that when the mp is at zero it cannot be used/it will stop?
i've looked through conditional branches and there is no condition to do with these values.


this is how the common event is set up

@>Conditional Branch:[Dynen] is [Shadowcloak] Equipped
    @>Conditional Branch: The R Button is Being Pressed
         @>Control Switches [0010:Nodetect]=ON
         @>Set Move Route: Player (wait)
                                  :$>Change Opacity :100
                                  :$>Change Blending: Sub

         @> Change MP: [Dynen], -1
         @>
     :   Else
         @>Control Switches: [0010:Nodetect] =OFF
         @>Set Move Route: Player (wait)
                                  :$>Change Opacity :255
                                  :$>Change Blending: Normal

         @>
     :   Branch End
     @>
  :  Else
     @>
  :  Branch End
@>
   

I noticed YOu can have a conditional branch based on variables, but i am unfamiliar with variables and how they work, i have never used them, and i dont know if you can set hp/mp as variables.
« Last Edit: April 10, 2012, 06:38:19 PM by lenercopa »

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
Try using an autorun event to force it to stop

**
Rep: +0/-0Level 56
One Swift Kick
I realized i can most likely use a script condition for this, anybody know? If so, Do you know what the code may be?

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
You can try using a variable for this.


You'll have to tinker around with it though :)
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

****
Sperm Donor Extraordinaire
Rep:
Level 77
Bronze - GIAW 9
You can try using a variable for this.


You'll have to tinker around with it though :)

to expand on that, you could set a label at the top of the event, or the bottom, and you could then remove all the stuff that the cloak does from within the conditional and in it's place, set a conditional branch to check if the variable is less than or equal to zero and if so, go to a label at the top to escape all of the conditionals and in the else case, throw the stuff that the cloak does in there so that it's all there and it should do everything that you want.  What Chris said, though, you will have to tinker around with it.  People can tell you or show you EXACTLY how to do it all day long, but it takes you to research it personally so that you can commit it to memory ;)
I am out of fucks to give.  In fact, I think you owe ME some fucks.  I have insufficient fucks in the fucking account.

**
Rep: +0/-0Level 56
One Swift Kick
well that's pretty much exactly what i was looking for, however adding in the branch for the variable has proven to negate the effects.
This is how i have is set up now, Now it acts as though there is no effects(no mp drain, No SUB blending)

look right?

@>Conditional Branch:[Dynen] is [Shadowcloak] Equipped
    @>Control Variables: [Dynen's MP] = [Dynen]'s MP
    @>Conditional Branch: The R Button is Being Pressed
         @>Conditional Branch: Variable [0001] Dynen's MP] >= 2
         @>Control Switches [0010:Nodetect]=ON
         @>Set Move Route: Player (wait)
                                  :$>Change Opacity :100
                                  :$>Change Blending: Sub

         @> Change MP: [Dynen], -1
         @>
     :   Else
         @>Control Switches: [0010:Nodetect] =OFF
         @>Set Move Route: Player (wait)
                                  :$>Change Opacity :255
                                  :$>Change Blending: Normal

         @>
     :  Branch End
     @>
  :  Else
     @>
  :  Branch End
   @>
Else
   @>
Branch End

Ive played around with so many different setting, orders, etc. wont work, but it workds fine if set up as in first post.
I know you all said to do it myself to learn, but im all out of ideas. The worst Part being i can do just about anything with any rpg maker program as i have been using it for 8 or 9 years but i have never used variables before....
« Last Edit: April 10, 2012, 08:02:23 PM by lenercopa »

****
Sperm Donor Extraordinaire
Rep:
Level 77
Bronze - GIAW 9
Why is it >= 2?  how much mp does the guy have?
I am out of fucks to give.  In fact, I think you owe ME some fucks.  I have insufficient fucks in the fucking account.

**
Rep: +0/-0Level 56
One Swift Kick
is is >=2 Because i have it draining 2 mp per second, and i want is so if you have less than 2 mp, it cannot be used. only if he has greater than or equal to 2 mp it can be used. and i am only testing at level one, he has 70 MP

****
Sperm Donor Extraordinaire
Rep:
Level 77
Bronze - GIAW 9
try determining whether the character has enough mp before the button press conditional and see if that helps.
I am out of fucks to give.  In fact, I think you owe ME some fucks.  I have insufficient fucks in the fucking account.

**
Rep: +0/-0Level 56
One Swift Kick
Didn't work. Oh well, im sure i will figure it out. if anyone figures it out let me know. thanks for all the help.