The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => Topic started by: lenercopa on April 10, 2012, 05:15:46 PM

Title: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: lenercopa on April 10, 2012, 05:15:46 PM
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.
Title: Re: Hp/Mp Value as a conditional branch/ variable?
Post by: IAMFORTE on April 10, 2012, 05:28:32 PM
Try using an autorun event to force it to stop
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: lenercopa on April 10, 2012, 06:43:59 PM
I realized i can most likely use a script condition for this, anybody know? If so, Do you know what the code may be?
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: D&P3 on April 10, 2012, 06:47:54 PM
You can try using a variable for this.
(http://img4host.net/upload/102046444f84801484251.JPG)

You'll have to tinker around with it though :)
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: Lethrface on April 10, 2012, 06:55:33 PM
You can try using a variable for this.
(http://img4host.net/upload/102046444f84801484251.JPG)

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 ;)
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: lenercopa on April 10, 2012, 07:48:57 PM
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....
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: Lethrface on April 10, 2012, 07:53:26 PM
Why is it >= 2?  how much mp does the guy have?
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: lenercopa on April 10, 2012, 08:05:27 PM
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
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: Lethrface on April 10, 2012, 08:08:26 PM
try determining whether the character has enough mp before the button press conditional and see if that helps.
Title: Re: Hp/Mp Value as a conditional branch/ variable? RMVX
Post by: lenercopa on April 10, 2012, 08:22:34 PM
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.