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.
Heart system

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 85
The Guiding Light
I'm doing a zelda style heart container thing to show hp. The only problem is how to add another heart to the present ones. If anyone knows how, i'd appreciate it.
Here's the set up. This is not my work and i take no credit for any of it.

Common Event:HEART
   Event Start:PP(Paraelle Proccess)
   Event Starts On:The very first event in the game

                                               
Fork Option:Varbl(0001:LinkHP)-3Above
         Show Picture 1, heart1 (30,10)
         Show Picture 2, heart2 (50,10)
         Show Picture 3, heart3 (70,10)
         Wait 2.0S
      End Case

      Fork Option:Varbl(0001:LinkHP)-3
         Show Picture 1, heart1 (30,10)
         Show Picture 2, heart2 (50,10)
         Show Picture 3, heart3 (70,10)
         Wait 1.0S
      End Case

      Fork Option:Varbl(0001:LinkHP)-2
         Show Picture 1, heart1 (30,10)
         Show Picture 2, heart2 (50,10)
         Wait 2.0S
         Earse Picture 3
      End Case

      Fork Option:Varbl(0001:LinkHP)-1
         Show Picture 1, heart1 (30,10)
         Wait 2.0S
         Earse Picture 2
      End Case

      Fork Option:Varbl(0001:LinkHP)-2
         Earse Picture 1
         GameOver 
         Event 00001 off
      End Case

If you don't know what I mean, it's like how in the zelda series when link(or whatever he's name)gets a heart from a boss and it's added to the others at the top of the screen.
« Last Edit: August 22, 2008, 07:10:34 PM by guyvers bane »
Like our page and show your support below!

https://www.facebook.com/Helvetios.2015



"Oh yonder years of man…where legends live and magic waits.
Take in these words, a story unfolds for all to hear."

**
Rep: +0/-0Level 85
A dying ember still burns
First, you want to get rid of the very top Fork option (also, I believe the very bottom Fork option is supposed to check to see if your hit points equal 0, not 2). Then, in the HEART common event, for each possible number of hearts, you need a separate Fork option that checks to see if the variable LinkHP is equal to that value. For instance, if the maximum number of hearts that the player could ever obtain was 10, you would have to add a Fork option that checks to see if LinkHP equals 10 and then draws the appropriate number of hearts, a Fork option that checks to see if LinkHP equals 9 and then draws the appropriate number of hearts, and so on and so forth.
Warning: posts may contain traces of gaming. If you are allergic to gaming, you should avoid these posts, as the side effects of direct contact with gaming include but are not limited to drowsiness, upset stomach, headache, loss of memory, lack of self esteem, paralysis or other loss of bodily functions, loss of significant other, humiliation, unexplained death, or loss of hair. If you experience any of these symptoms, please contact your doctor immediately.

**
Rep: +0/-0Level 85
The Guiding Light
Okay I see what you're saying. I tried a set up very similar to this last night, and it slowed down my game badly. THis is it.

Fork Option:Varbl(0001:HP)-51Above
         Show Picture 1, heart1 (30,10)
         Show Picture 2, heart2 (50,10)
         Show Picture 3, heart3 (70,10)
 End Case

It's the same thing but, when all three pictures came up, the hero would skip through the walk animation.
Like our page and show your support below!

https://www.facebook.com/Helvetios.2015



"Oh yonder years of man…where legends live and magic waits.
Take in these words, a story unfolds for all to hear."

**
Rep: +0/-0Level 85
A dying ember still burns
Hmmm. The only thing I can think of that might reduce the lag is to change the event so that it's activated by a switch instead of running as a parallel process, turn the activating switch on whenever the player takes damage or receives healing, and then add a line to the bottom of the HEART event that turns the switch off. That way the event would only run once every time your health changed, instead of constantly running.
Warning: posts may contain traces of gaming. If you are allergic to gaming, you should avoid these posts, as the side effects of direct contact with gaming include but are not limited to drowsiness, upset stomach, headache, loss of memory, lack of self esteem, paralysis or other loss of bodily functions, loss of significant other, humiliation, unexplained death, or loss of hair. If you experience any of these symptoms, please contact your doctor immediately.

**
Rep: +0/-0Level 85
The Guiding Light
Thanks. I've gotten that bug fixed, now comes the part on how to add a fourth heart that will show an empty container when the correct damage is dealt. And with out being skipped for the third heart. This programing bit is a pain in the...well...you know.
Like our page and show your support below!

https://www.facebook.com/Helvetios.2015



"Oh yonder years of man…where legends live and magic waits.
Take in these words, a story unfolds for all to hear."

**
Rep: +0/-0Level 85
A dying ember still burns
Well, it's still more or less the same code, but now you have to stick it all inside another Fork that checks the player's maximum health and, if the current health is below the maximum health, draws the appropriate number of empty hearts before switching to filled hearts. Assuming the player starts with three hearts and can obtain a total possible of four hearts, the code would look like this:

Fork Option:Varbl(0001:MaxHP)-4
     Fork Option:Varbl(0001:CurrentHP)-4
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, FilledHeart2 (50,10)
          Show Picture 3, FilledHeart3 (70,10)
          Show Picture 4, FilledHeart4 (90, 10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-3
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, FilledHeart2 (50,10)
          Show Picture 3, FilledHeart3 (70,10)
          Show Picture 4, EmptyHeart4 (90, 10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-2
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, FilledHeart2 (50,10)
          Show Picture 3, EmptyHeart3 (70,10)
          Show Picture 4, EmptyHeart4 (90, 10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-1
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, EmptyHeart2 (50,10)
          Show Picture 3, EmptyHeart3 (70,10)
          Show Picture 4, EmptyHeart4 (90, 10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-0
          Erase Picture 1
          Erase Picture 2
          Erase Picture 3
          Erase Picture 4
          Game Over
     End Case
End Case

Fork Option:Varbl(0001:MaxHP)-3
     Fork Option:Varbl(0001:CurrentHP)-3
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, FilledHeart2 (50,10)
          Show Picture 3, FilledHeart3 (70,10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-2
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, FilledHeart2 (50,10)
          Show Picture 3, EmptyHeart3 (70,10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-1
          Show Picture 1, FilledHeart1 (30,10)
          Show Picture 2, EmptyHeart2 (50,10)
          Show Picture 3, EmptyHeart3 (70,10)
     End Case
     Fork Option:Varbl(0001:CurrentHP)-0
          Erase Picture 1
          Erase Picture 2
          Erase Picture 3
          Game Over
     End Case
End Case


It's a lot of code, but the good news is that once you set up the Fork for the maximum possible hearts, you can really just copy/paste it for all the others and change what value of MaxHP it's checking for.
Warning: posts may contain traces of gaming. If you are allergic to gaming, you should avoid these posts, as the side effects of direct contact with gaming include but are not limited to drowsiness, upset stomach, headache, loss of memory, lack of self esteem, paralysis or other loss of bodily functions, loss of significant other, humiliation, unexplained death, or loss of hair. If you experience any of these symptoms, please contact your doctor immediately.

**
Rep: +0/-0Level 85
The Guiding Light
Your a genius Draco. I was trying to do the fourth heart fork option, with out adding the others to it. Pure genius. 8)
Like our page and show your support below!

https://www.facebook.com/Helvetios.2015



"Oh yonder years of man…where legends live and magic waits.
Take in these words, a story unfolds for all to hear."

**
Rep: +0/-0Level 85
A dying ember still burns
Glad I could help. Good luck with your game :)
Warning: posts may contain traces of gaming. If you are allergic to gaming, you should avoid these posts, as the side effects of direct contact with gaming include but are not limited to drowsiness, upset stomach, headache, loss of memory, lack of self esteem, paralysis or other loss of bodily functions, loss of significant other, humiliation, unexplained death, or loss of hair. If you experience any of these symptoms, please contact your doctor immediately.