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.
{RMXP} How do i... character health regeneration

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 76
RMRK Junior
I want to make a item, if equipped the hero will regain HP with step.
Now Your nightmare comes to life.

[RMXP] CRYSTaL KNigHTS: The First Dawn - 20%
[RMXP] White Ruins - 10 %

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Turn a switch on as soon as you get the item (or at the start of the game). Make a common event with a variable that tracks your step count. Check if there's a change. If there is, increase the characters HP.

***
Rep:
Level 76
RMRK Junior
im not good with the variable's yet.
Now Your nightmare comes to life.

[RMXP] CRYSTaL KNigHTS: The First Dawn - 20%
[RMXP] White Ruins - 10 %

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
variables are real easy... But I don't have XP anymore... So I can't help you through it...

I guess, though, it's easy in the way that math is easy.

That is, when you don't understand it, it seems so daunting, but when you learn how it works, you look back and say, "a DOY! How did I not understand that???"

The point is, just try looking through the variable options a few more times. I think that if you do, you will figure it out before too long.
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

***
Rep:
Level 83
Kidfox70. It happens.
Haha, this is what cozziekuns meant.

Quote
Turn a switch on as soon as you get the item (or at the start of the game). Make a common event with a variable that tracks your step count. Check if there's a change. If there is, increase the characters HP.

I hope...haha

So basicly what is going to happen is the Item will be given to the player. I don't know exactly how you want it happen, but the way I see it, the player goes to the menu, picks the item and applies it to the player like he would a Potion. BUT! The Item triggers a Common Event. Put what I gave you in the Common Event Set it to Parallel Process and then to a Switch that the Code uses (in the Example Switch 1). The player will then be asked if he wants to use it. When he clicks yes, it will then start running the Code for what you want. The game will check the Steps of the player, if it's greater than the Last#Steps Variable then it gives plus ten, then it sets the Last#Steps Variable equal to the number of Steps. This is very important. This Variable has to be put last, or it wouldn't work right. Every step the Player will get health. I put some notes in the spoiler and the code in another. Just so you know, in the Conditional Branch window you can edit it so you don't have an 'Else'. This is good for when you don't need it. Like in this case. It saves time, the Game doesn't need to check for an 'Else' because we wouldn't put anything in there anyway. To edit it, uncheck the box at the bottom of the window. The Set Handling bow.

Notes:
Spoiler for:
-If you do it the way I gave you. Then you could also put in a Conditional Branch checking the HP of the Player, when it reaches the MAX HP the Player has, you could have the Switch turn OFF, then remove the Item from the Player, and therefore ending the step checking Code and Item.

-You could have it where the Player can turn it ON, have the Step/HP Code run, then if he wanted, turn it OFF.

-Instead of having the Player go through the Menu, you could have a Common Event always running and Checking to see if the Item is in the Player Items, if so, it runs the Step/HP Code. Once the Health is full, it removes the Item.

-OR, you could have the Item give health every step, like you want. But after a certain amount of Steps, it is removed from the Player and stops giveing health.


Code:
Spoiler for:
Code: [Select]
Conditional Branch: Switch[0001] == ON
Control Variable: [0001: Steps] = Player's Steps
Contional Branch: Variable [0001: Steps] > Variable [0002: Last#Steps]
Change HP: +10 [Player]
End
Control Variable: [0002: Last#Steps] = Variable: [0001:Steps]

Else
Show Choices: Use item, Never mind
When [Use Item]
Control Switch: [0001] = ON

When [Never mind]

Brand End
End

I hope I helped! If you need anything just ask. I actually came up with this for someone else. Well not exactly, he wanted to control the Steps of NCP's. Meaning he wanted them to move ONLY when the Player moved. I've been working on my project for while. It's a collection of Tutorial all in a little Demo. The Step System is in the Demo. I also have a written guide for each Event System or Element I'm covering. It will only be a little while before I post the Demo. I'm telling you this so you check it out if you have any questions on this, Variables and other things. Again I hope it helps, good luck. ;D
I don't say bless you when people sneeze, cause i'm not God. Blessing people is his job. Lolo?

***
Rep:
Level 76
RMRK Junior
Im trying it out with alittle of my own. stuff, what exactly I am trying to do is an accessory, 'Chakra Band', when I character equips it, they gain 'x' amount of hp while walking.
Now Your nightmare comes to life.

[RMXP] CRYSTaL KNigHTS: The First Dawn - 20%
[RMXP] White Ruins - 10 %

***
Rep:
Level 83
Kidfox70. It happens.
Well to be honest it would make sense for it to be an Item, cause you're going to be on the map (it's the only time you'd be taking steps). But since you want it as an accessory, you have a few Options. But I think the easiest way would be doing what I suggested in the notes.

Quote
-Instead of having the Player go through the Menu, you could have a Common Event always running and Checking

Have the Conditional Branch check to see if the Player has it Equiped.
I don't say bless you when people sneeze, cause i'm not God. Blessing people is his job. Lolo?

***
Rep:
Level 76
RMRK Junior
I suck at this, I cant get it to work for crap :'(

What I got :/
Spoiler for:
@>Controle Variable: [0001:Steps] = 0
@>Conditional Branch: [xxxx] is [xxxxx] equipped
  @>Conditional Branch: Variable [0001: Steps] == 0
     @>Conditional Branch: Variable [0001: Steps] > Variable [0002: Steps2]
         @>Change HP [xxxx] +2
         @>
      :  Else
         @>
      : Branch End
      @>
    :  Else
      @>
    :  Branch End
   @>
 : Else
   @>
 : Branch End
@>

Hope someone can help me
« Last Edit: August 13, 2010, 10:34:22 PM by Cedricsawall2 »
Now Your nightmare comes to life.

[RMXP] CRYSTaL KNigHTS: The First Dawn - 20%
[RMXP] White Ruins - 10 %

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Code: [Select]
@>Control Variables: [0001:Steps] = Steps (You can find this in the "other" section of Control Variables).
@>Conditional Branch: [XXXX] is [XXXXX] Equipped
  @>Conditional Branch: [0001:Steps] != [0002:Steps2]
    @>Change HP [XXXX], + 2
    @>
  @>Branch End
  @>Control Variables: [0002:Steps2] = [0001:Steps]
  @>
@>Branch End

There ya go...

***
Rep:
Level 76
RMRK Junior
whats the "!" in there for?
« Last Edit: August 13, 2010, 11:39:39 PM by Cedricsawall2 »
Now Your nightmare comes to life.

[RMXP] CRYSTaL KNigHTS: The First Dawn - 20%
[RMXP] White Ruins - 10 %

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Not equal to.

***
Rep:
Level 76
RMRK Junior
got it! Thanks :)
Now Your nightmare comes to life.

[RMXP] CRYSTaL KNigHTS: The First Dawn - 20%
[RMXP] White Ruins - 10 %