Jump to content

Photo

Z2 Boss Health Meter

FFC

  • Please log in to reply
10 replies to this topic

#1 James24

James24

    Apprentice

  • Members
  • Real Name:James
  • Gender:Male
  • Location:Australia

Posted 23 March 2012 - 01:23 AM

Z2 Boss Health Meter


Description

This script displays the boss's health as in Zelda 2: The Adventure of Link. When the boss is at full health, all rectangles are red and as the boss loses health the squares become white. Note that the boss is defined to be the NPC with the most health on a given screen. Further, the meter can be moved by changing variable values in the code. Assumes that the quest maker is using the pure tileset palette which has red as 108 but this value can be changed.

Screenshots and Demo

N/A

Code

Script


Setup

Its a standard ffc script - the usual setup in the compiler and then a ffc for the screen with the code.

Resources

None except std.zh

#2 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Gender:Female
  • Location:Rainbow Factory

Posted 04 May 2012 - 06:47 AM

Not bad, very nostalgic of Zelda 2 that's for sure. Do you think you could make it so you can control the size of the rectangles? I don't need it, but someone else might like that little feature to customize it. icon_smile.gif

4/5 for above average. icon_thumbsup.gif

#3 mathewlan13

mathewlan13

    Newbie

  • Members

Posted 04 May 2012 - 08:53 PM

How do you use the script?

#4 MoscowModder

MoscowModder

    Still fighting the inevitable

  • Members
  • Gender:Male
  • Location:Wisconsin (WHAT)

Posted 04 May 2012 - 09:22 PM

Do you know how to compile/assign a script?

Assuming you do, place an FFC on screen, set its combo to something invisible besides combo 0, assign this script to the FFC, and it will automatically make a meter, and it assumes the enemy with the highest starting HP is the boss.

#5 mathewlan13

mathewlan13

    Newbie

  • Members

Posted 05 May 2012 - 06:59 AM

Thanks!
you seem to know a lot about Zelda Classic.

#6 James24

James24

    Apprentice

  • Members
  • Real Name:James
  • Gender:Male
  • Location:Australia

Posted 05 May 2012 - 08:38 PM

To control the size of the rectangles, simply edit the line:

Screen->Rectangle(0, xoffset, yoffset+8*i, xoffset+8, yoffset+8*i+5, colour, 1, 0, 0, 0, true, 128);

Set the xoffset+x where x is the horizontal size of the rectangle.
Same for the yoffset+8*i+x, increase/decrease x to control the vertical size of the rectangle.

#7 Jamian

Jamian

    ZC enthusiast

  • Members
  • Gender:Unspecified

Posted 16 March 2013 - 08:49 AM

QUOTE(James24 @ Mar 23 2012, 01:23 AM) View Post

int red = 108; //value can be modified depending on tileset palette
int white = 17; //value can be modified depending on tileset palette


Thanks for the script.

Can somebody explain what these values correspond to? Where do you find the value for the colour you want?

#8 ShadowTiger

ShadowTiger

    !~~ah~~ha~~!

  • Members
  • Gender:Unspecified

Posted 16 March 2013 - 10:40 AM

I believe that it's based on your color grid. Go to Quest -> Graphics -> Palette. Note how each line has 16 colors? So the third color in there is 02, because 00, 01, 02. The last one is 15. So color #16 is actually the first color on the next line. So "int white = 17;" is actually most likely the second color on Cset #1. (Again, the first one on top is Cset #0.)

So it's just a lot of counting to get to color #108. icon_razz.gif But that could be useful if it's a color in a Level-Palette dependent CSet, like 9 or 2, 3, and 4.

#9 MoscowModder

MoscowModder

    Still fighting the inevitable

  • Members
  • Gender:Male
  • Location:Wisconsin (WHAT)

Posted 16 March 2013 - 01:18 PM

Easy formula for colors:

1. Find the color within the CSet you want.
2. Color = (CSet * 16) + color within CSet {0 to 15}.
3. There is no step 3.

#10 Nightmare

Nightmare

    Original ZC Tester

  • Banned
  • Real Name:James
  • Gender:Unspecified
  • Location:Jackson, NJ

Posted 05 April 2014 - 11:51 AM

It didn't seem to work properly for the Gleeok I implemented in James Quest 2.  Does it just not work for Gleeoks/Manhandlas/etc., or is there a bug?

 

-James



#11 4matsy

4matsy

    SHE WILL WAKE ONLY WITH THE POWER OF NO. 3 CHEESEFORCE

  • Members
  • Real Name:Melvin
  • Gender:Male
  • Location:Under the 3rd rock from the left on screen 7F.

Posted 05 April 2014 - 12:06 PM

If I remember right, gleeoks do some weird engine craziness where the main body has its HP always set to 1000 or some crazy value like that, and one of the heads holds the actual HP remaining.

 

You'd simply have to change the script to make an exception for gleeoks, basically; just have it look at the HP of the current head part instead of the main enemy.

 

EDIT: Okay, I had it backwards. It's the other way around. From http://www.shardstor...m/ZCwiki/Gleeok:

 

"If a script checks the HP of a head, it will always be 1000. Damage done to heads is automatically transferred to the body, and the head's HP is reset to 1000 each frame."

 

So you'd have to have the script check the body, not the head.


Edited by 4matsy, 05 April 2014 - 12:17 PM.




Also tagged with one or more of these keywords: FFC

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users