Main Menu
  • Welcome to The RPG Maker Resource Kit.

Hp/Mp Value as a conditional branch/ variable? RMVX

Started by lenercopa, April 10, 2012, 05:15:46 PM

0 Members and 1 Guest are viewing this topic.

lenercopa

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.

IAMFORTE

Try using an autorun event to force it to stop

lenercopa

I realized i can most likely use a script condition for this, anybody know? If so, Do you know what the code may be?

D&P3

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

Lethrface

Quote from: Chris 3 on April 10, 2012, 06:47:54 PM
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.

lenercopa

#5
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....

Lethrface

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.

lenercopa

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

Lethrface

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.

lenercopa

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.