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

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 54
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 54
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 63
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 :)

****
Sperm Donor Extraordinaire
Rep:
Level 76
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 54
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 76
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 54
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 76
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 54
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.