Zelda Style Heart Bar- how to do?
Zelda Style Heart Bar- how to do?
Looking for a tutorial or somesuch for assistance on this- I can't figure out how to
accomplish a zelda style heart bar..
In other words- pick up vial/heart pieces to increase your characters total life
capacity (4 pieces = 1 increase), which would reflect on the players HUD,
in the form of ((base # of hearts/vials)+1 more per 4 pieces found)- in other
words a health bar that looks like a heart bar, but that increases by adding
a "heart" to your bar...
Any zelda fans out there that know how to pull this off? I'd love to use a
a gui like this for my project so that I can actually finish in a realistic time-frame
Please help
*hugs* Elussya
accomplish a zelda style heart bar..
In other words- pick up vial/heart pieces to increase your characters total life
capacity (4 pieces = 1 increase), which would reflect on the players HUD,
in the form of ((base # of hearts/vials)+1 more per 4 pieces found)- in other
words a health bar that looks like a heart bar, but that increases by adding
a "heart" to your bar...
Any zelda fans out there that know how to pull this off? I'd love to use a
a gui like this for my project so that I can actually finish in a realistic time-frame
Please help
*hugs* Elussya
Hello elussya, and welcome to Reality Factory. I'm not sure how to accomplish what you desire, but there is a good section on Heads Up Displays in your RF manual. Find it under Programs>Reality Factory>RF Manual On the left hand menu side, you will find a listing for Heads Up Display. Withing this, is what I believe you need. At the top you find 'Pictures'. That is what I think you may need to use. Let us know if this helps.
Good Luck!!
Good Luck!!
Steve Dilworth - Resisting change since 1965!
- Agentarrow
- Posts: 1346
- Joined: Thu Jun 28, 2007 4:34 pm
- Location: Kyiv, Ukraine
- Contact:
That'd be hard to do, the people of nintendo created their own zelda engine from scratch, it was pretty cool though, it could compile in Gamecube or Wii format. (for twilight princess) Anyway, speaking of Nintendo, My health Bar for Terra Trooper needs to be like in Metroid, with those little energy tanks that store a full health bar... Would that be something I could do from the manual?
AgentArrow Home
The greater good is but a point of view...
The greater good is but a point of view...
Allright, so let me get this straight. You want to have a row of hearts on the screen and every time you pick up 4 powerups one heart is added to the row?
You could use a healtbar-style HUD element that has large enough intervals in the attribute that it only shows full hearts. In other words, if you increase the attribute with 1, the health bar will become larger and reveal a full heart (instead of half a heart, or one pixel of the next heart).
First off you need to have two different attributes:
Then set up a simple script that will handle the 4 heart pieces becoming one heart:
Add a pawn with this script into the level. It will be invisible and doesn't collide with anything, so it shouldn't affect the game world in any way.
Next, you need to set up your HUD so that it shows the hearts. Now you should create a bitmap that has a row of hearts (either vertical or horizontal). I'll give an example of how to set up the HUD with a horizontal row of 8 hearts that are 32x32 pixels (So the image size for the HUD element is 256x32):
This should create the "health bar" in the top center of the screen.
I hope you get what I mean. I didn't test any of this so if you can't get it to work or get some weird errors feel free to ask questions.
***EDIT***
Oh, and welcome to the forums.
You could use a healtbar-style HUD element that has large enough intervals in the attribute that it only shows full hearts. In other words, if you increase the attribute with 1, the health bar will become larger and reveal a full heart (instead of half a heart, or one pixel of the next heart).
First off you need to have two different attributes:
Code: Select all
[heartpieces]
initial = 0
low = 0
high = 4
[hearts]
initial = 1
low = 0
high = 8
Code: Select all
{
Spawn[ ()
{
LowLevel("setup");
} ]
setup[ ()
{
PawnRender(false); //Don't render the pawn
SetNoCollision(); //Don't collide
self.think = "run";
} ]
run[ ()
{
self.ThinkTime = 0.1; //execute every 0.1 seconds
if(GetAttribute("heartpieces","Player") = 4) // if enough powerups have been collected
{
SetAttribute("heartpieces",0,"Player"); // reset the number of the powerups
ModifyAttribute("hearts",1,"Player"); // add one full heart
}
} ]
}
Next, you need to set up your HUD so that it shows the hearts. Now you should create a bitmap that has a row of hearts (either vertical or horizontal). I'll give an example of how to set up the HUD with a horizontal row of 8 hearts that are 32x32 pixels (So the image size for the HUD element is 256x32):
Code: Select all
[hearts]
type = horizontal
frame = XXX.bmp
framealpha = YYY.bmp
indicator = ZZZ.bmp
indicatoralpha = XYZ.bmp
framex = center
framey = 64
indicatoroffsetx = 0
indicatoroffsety = 0
indicatorwidth = 256
I hope you get what I mean. I didn't test any of this so if you can't get it to work or get some weird errors feel free to ask questions.
***EDIT***
Oh, and welcome to the forums.
Pain is only psychological.
It's actually not that hard to do. RF might not be able to do it right out of the box, but with a little creativity anything is possible. Here's how you can fake it. Create a HUD item with the maximum amount of heart containers that your player can have. Use script to hide the ones from the player that are not active or have been removed due to damage.
Many Bothans died to bring you this signature....
Awesome!! That looks like it'll work, I'll be able to test it tomorrow
once my computer's back from the shop
*hugs*
That's saved alot of head bashing from the last few days
Once it's tested and working with my level I'll be posting some screenshots
This is thus far, definitely the most friendly forum I've been part of
Cheers,
Elussya
once my computer's back from the shop
*hugs*
That's saved alot of head bashing from the last few days
Once it's tested and working with my level I'll be posting some screenshots
This is thus far, definitely the most friendly forum I've been part of
Cheers,
Elussya
- Agentarrow
- Posts: 1346
- Joined: Thu Jun 28, 2007 4:34 pm
- Location: Kyiv, Ukraine
- Contact:
welcome to the forums, I forgot to mention that '-.- anyway, So Juutis, you seem to be good at scripting, could I ask you a favor? a script for a Metroid style health bar? with Energy Tanks and stuff? You don't have to if you don't want to, but it never hurts to ask...
AgentArrow Home
The greater good is but a point of view...
The greater good is but a point of view...
That'll be excellent! We love screenshots!!elussya wrote:Awesome!! That looks like it'll work, I'll be able to test it tomorrow
once my computer's back from the shop
*hugs*
That's saved alot of head bashing from the last few days
Once it's tested and working with my level I'll be posting some screenshots
This is thus far, definitely the most friendly forum I've been part of
Cheers,
Elussya
AA - I've never seen that Metroid health bar. Post a screen, if you can. I did a google search, with no luck. No good shots where the HUD is clear.
Steve Dilworth - Resisting change since 1965!
Let's see, so every time the player's health reaches 0 you want to see if there's a full energy tank and if so, fill the health bar and empty one tank?Agentarrow wrote:So Juutis, you seem to be good at scripting, could I ask you a favor? a script for a Metroid style health bar? with Energy Tanks and stuff? You don't have to if you don't want to, but it never hurts to ask...
Shouldn't be too tricky. First you have to find a way to prevent the player from truly dying. RF's built-in player dies when its health reaches 0, so if you don't let it go that low, the player shouldn't die. So, in the attributes:
Code: Select all
[health]
initial = 100
low = 1
high = 100
[energytanks]
initial = 5
low = 0
high = 10
Code: Select all
{
Spawn[ ()
{
LowLevel("setup");
} ]
setup[ ()
{
PawnRender(false); //Don't render the pawn
SetNoCollision(); //Don't collide
self.think = "run";
} ]
run[ ()
{
self.ThinkTime = 0.1; //execute every 0.1 seconds
if(GetAttribute("health","Player") = 1) // if 'health' is 1
{
if(GetAttribute("energytanks","Player") > 0) //if there's at least 1 energy tank
{
SetAttribute("health",100,"Player"); // set player's health to 100
ModifyAttribute("energytanks",-1,"Player"); // remove one energy tank
}
else // if there are no energy tanks left
{
SetAttributeValueLimits("health",0,100,"Player"); //let health reach zero
SetAttribute("health",0,"Player"); //kill the player
}
}
} ]
}
Pain is only psychological.
- Agentarrow
- Posts: 1346
- Joined: Thu Jun 28, 2007 4:34 pm
- Location: Kyiv, Ukraine
- Contact:
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Zelda Style Heart Bar- how to do?
Hi, Juutis I was wondering if you could make me a script to?
I would like to have like a shield (like health) which when runs out starts affecting your health but if you wait awhile the shield recharges but your health stays the same?
Thanks, I'm relatively new to RF
I would like to have like a shield (like health) which when runs out starts affecting your health but if you wait awhile the shield recharges but your health stays the same?
Thanks, I'm relatively new to RF
Crator Games at http://atfreeforum.com/crator/index.php
- Agentarrow
- Posts: 1346
- Joined: Thu Jun 28, 2007 4:34 pm
- Location: Kyiv, Ukraine
- Contact:
Re: Zelda Style Heart Bar- how to do?
I don't know much about scripting, but you'd want a second health bar underneath the first that runs out before health does.
uhhh... something like:
Open the player.ini file and go under armor, Replace the Initial with probably about half, so about 50. Next put High as 100 and low as 0. Juutis will have to help with the regenerate thing. You might be better off having it set at something like 200 and replenishable by items
uhhh... something like:
Open the player.ini file and go under armor, Replace the Initial with probably about half, so about 50. Next put High as 100 and low as 0. Juutis will have to help with the regenerate thing. You might be better off having it set at something like 200 and replenishable by items
AgentArrow Home
The greater good is but a point of view...
The greater good is but a point of view...