Author Topic: HUD: ZL Hearts  (Read 3925 times)

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
HUD: ZL Hearts
« on: May 24, 2015, 06:35:56 pm »
----------------------------
HUD - "ZL HEARTS"
version 1.0


Attachment:  HUD - ZL Hearts.zip
----------------------------

- Explanation:
This stuff will help you to change the appearance of the health bar in your Solarus project.
The first heart represents the first four lives... OK stop! No further explanation!. A picture is worth a thousand words;

Example 1:
The original health bar (here, there are 15.5/20 hearts or 15.5 * 4 = 62 lives on 80) will be replaced by this smaller bar:


Example 2:
I played with the console to test "game:set_life()" and "game:set_max_life()"



- Tested with Solarus v1.4.2

- IMPORTANT !!! Save your files before replacing them!

- Copy these files in your Solarus project. The file path may differ from yours.

..\data\sprites\hud\empty_heart.dat    (There are 6 animations instead of 2 animations if you compare with the original data file.)

..\data\sprites\hud\hearts.png      (Some graphics are edited from a Zelda game. For copyright reasons, don't sell your project! )

..\data\scripts\hud\hearts.lua      (This file contains the main script edited from a original one by Christopho.)

..\data\scripts\hud\hud.lua      (It is not necessary to replace this file. The script contains a few more lines than the original created by Christopho. Keep yours and see below )
1st choice:
 Copy the "hud.lua" file or add/replace these lines if you want to align element to right  when the player wins a new  heart container.
Code: [Select]
(...)
local hearts = hearts_builder:new(game)
hearts:set_dst_position(- (game:get_max_life() + 16), 6)
hud.elements[#hud.elements + 1] = hearts
local nb_max_hearts_displayed = game:get_max_life() / 4
(...)
local nb_max_hearts = game:get_max_life() / 4

if nb_max_hearts ~= nb_max_hearts_displayed then
nb_max_hearts_displayed = nb_max_hearts
hearts:set_dst_position(- (game:get_max_life() + 16), 6)
 end
(...)

2nd choice:
Keep your "hud.lua" file if you want to align element to left when the player wins a new heart container.
Just adjust the x value of  hearts:set_dst_position(-104, 6)
Perhaps you should also change the value of x hearts.surface = sol.surface.create(116, 11) in the "hearts.lua" file.


EDIT:
- Erratum: For empty_heart.dat, I said there were "6 animations instead of 4 animations",  but it's "6 animations instead of 2 animations"
- Images were hosted at an ISP, so I attached them directly at the forum,  as I did with the .zip file.
You just have to be connected to see images.

« Last Edit: May 25, 2015, 07:41:25 pm by froggy77 »

YoshiMario2000

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: HUD: ZL Hearts
« Reply #1 on: May 25, 2015, 03:00:08 am »
I Imagine this will be very useful.
Can someone sticky this post?
This signature was way too long before, but now it's short!
Also, I am Still Alive!
On ad Off I go!

Do you ever get the feeling that the fandom of a product(s) ruin the potential that you could have had to enjoy the product?

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: HUD: ZL Hearts
« Reply #2 on: November 27, 2016, 05:57:46 am »
I like having different life meter options.  I once started a project years ago that had a much different life meter function; Stamina played a key factor into the use of the life meter.

I'd like to implement this life meter style.

I am torn however between using one of two life meter options:

1. a 2-variant life meter, in which the red one was the normal mode and a blue one would be a hero mode version, kind of like the way the Ganondorf Amiibo makes Link take double damage on either mode of Twilight Princess.

2. a colored life meter that switches between 4 different colors; red for the highest or normal damage.  Yellow for 25% more damage.  Green for 50% more damage.  Blue would be 75% more damage, and every "in-game hour" you would lose a quarter of a heart unless you slept in a bed.

My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: HUD: ZL Hearts
« Reply #3 on: November 27, 2016, 04:13:35 pm »
Nice project! Both ideas are interesting. Sorry, I cannot choose for you. :P

Diarandor

  • Hero Member
  • *****
  • Posts: 1053
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: HUD: ZL Hearts
« Reply #4 on: November 28, 2016, 11:09:25 am »
I like the fact that this HUD is smaller, so that it hides less part of the map. (This style could be a nice option for the games of the Solarus team if Christopho likes the idea.) The idea I have in mind is to draw each life bar above others, like in fighting games with several life bars; each life bar could have a different color. I think 2 life bars could be ok (a red one and a different one above, maybe green, and both bars with 40 life points corresponding to 10 hearts). Also, the only heart on the left could beat when the life is low (we already have the beat animation), and replace that annoying sound of low life for a beat sound coordinated with the beat animation.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: HUD: ZL Hearts
« Reply #5 on: December 10, 2016, 06:33:44 pm »

ffomega > Could you share the tileset version?
ffomega or Diarandor > Other request, could you draw a mock-up for these life meter styles?

Diarandor

  • Hero Member
  • *****
  • Posts: 1053
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: HUD: ZL Hearts
« Reply #6 on: December 11, 2016, 11:19:07 am »

ffomega or Diarandor > Other request, could you draw a mock-up for these life meter styles?
@froggy77: I was refering to this heart system:
Quote

but with a possible addition of having one life bar above another, like in this screenshot where you can see the yellow life bar above the red one:
http://199.101.98.242/media/shots/36816-Dragonball_GT_-_Final_Bout_%5BU%5D-4.jpg
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: HUD: ZL Hearts
« Reply #7 on: December 15, 2016, 04:10:32 pm »

ffomega or Diarandor > Other request, could you draw a mock-up for these life meter styles?
@froggy77: I was refering to this heart system:
Quote

but with a possible addition of having one life bar above another, like in this screenshot where you can see the yellow life bar above the red one:
http://199.101.98.242/media/shots/36816-Dragonball_GT_-_Final_Bout_%5BU%5D-4.jpg

Are you wanting a tileset version of my HUD? No problem at all :)  As for the mockup of my heart meter, that too won't be a problem :)

Here's a tileset version of the HUD I am trying to use:


Here's a mockup of the HUD with my heart meter (sadly there is no script for mine, as I am not a lua scripter):
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

Diarandor

  • Hero Member
  • *****
  • Posts: 1053
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: HUD: ZL Hearts
« Reply #8 on: December 15, 2016, 05:09:33 pm »
Are you wanting a tileset version of my HUD? No problem at all :)  As for the mockup of my heart meter, that too won't be a problem :)

Nope, but thank you :). I'd like to create my own hud by myself (which will have a similar style).
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: HUD: ZL Hearts
« Reply #9 on: December 15, 2016, 05:55:09 pm »
Oh I apologize then :) I guess I do not understand what you were asking for ^^
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

Diarandor

  • Hero Member
  • *****
  • Posts: 1053
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: HUD: ZL Hearts
« Reply #10 on: December 15, 2016, 06:24:37 pm »
I was just saying that I like that hud style to display the hearts :D.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: HUD: ZL Hearts
« Reply #11 on: December 15, 2016, 07:25:51 pm »
Quote
ffomega > Could you share the tileset version?
lol it was my question. Yes, it is what I
 was asking for. Thanks. I'm going to test different versions of life meter styles. For the
 moment, there is a problem with Dragonball style one, when the number of ♡ is odd.



ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: HUD: ZL Hearts
« Reply #12 on: December 16, 2016, 03:08:07 am »
if you manage to make an "Alundra" style life meter (which is where I was inspired to make mine from) then I'd love to use it!!
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/