Jump to content

Photo

HP instead of hearts


  • Please log in to reply
35 replies to this topic

#1 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 29 September 2010 - 02:16 PM

Is there or can someone make a script where instead of having hearts there's an HP number counter (the way I'd like it to lose health is just to have 1 HP be equal to a quarter of a heart and a heart container adds 4 HP to the counter)

#2 Chakaa

Chakaa

    Hench 4 Life

  • Members
  • Real Name:Mark
  • Location:Massachusetts

Posted 29 September 2010 - 02:18 PM

I think you can do this with counters, I'm not sure exactly how, but I think it's possible without scripting.

#3 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2010 - 02:24 PM

The subscreen counter object can't display the heart counter.

The script should be simple, but it can't display it on the subscreen.
A simple script could just draw the counter (it's counter 0 by the way) onscreen. More complicated ones could draw a background or change the color depending on its value. By the way, each quarter heart is actually 4 HP. If you want to display 1 HP for each quarter heart the script will have to divide and round the counter value.

If you don't mind using the default heart meter, you can simply change the graphics to whatever you please, like these: http://www.purezc.co...ge=tiles&id=149 or these http://www.purezc.co...ge=tiles&id=438

Edited by MoscowModder, 29 September 2010 - 02:27 PM.


#4 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 29 September 2010 - 03:29 PM

Could I make an HP count thats equal to the health bar while having them both their (kinda like in Final Fantasy 7 where it shows their HP number and a Bar showing how much you have)

#5 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2010 - 03:32 PM

The HP counter will have to be scripted and can't be on the normal subscreen. It is definitely possible to have both.

#6 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 29 September 2010 - 03:32 PM

You can have HP show up in your subscreen as a number, but it will require some simple scripting and you'll have to give up a counter. I got rid of super bombs when I did it trying to get a Metroid kind of thing going.

Anyways, you'd have to have your counter always equal the amount of HP you have, then just use the counter on your subscreen. It'd be really easy:

CODE

Game->Counter[SUPER_BOMB] = Link->HP;

Keep in mind, you'd have to replace SUPER_BOMB with the correct variable, which can be found in std.zh, but you get the idea. You'll also have to make sure the player can hold an indefinite amount of super bombs. I can't remember how I did it, but I do believe I got it to work, so I'll come back once I've figured it out.

For the code snippet above, just plug that into your global script. I realize it won't give the exact results you wanted, but it is a start, and I will put together something better that will provide you with the desired effect. I assume each enemy in the game will do at least a quarter heart's worth of damage? (I'm pretty sure you can get it down to a 16th of a heart, but it's been awhile so I don't remember.)

#7 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 29 September 2010 - 03:37 PM

I don't mind if its not on the subscreen

#8 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2010 - 03:40 PM

That's a really cool and simple idea from Blaman.

You don't even have to sacrifice your super bomb counter because ZC now has 10 custom counters.

Try putting this in your global script:
CODE
global script slot_2{
void run(){
  while(true){
    Game->Counter[CR_SCRIPT1] = Link->HP;
    Waitframe();
        }
    }
}


Once you put that in, make a new counter on your subscreen for "Script 1"

Edited by MoscowModder, 29 September 2010 - 03:43 PM.


#9 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 29 September 2010 - 03:44 PM

ok how would I do that (I know nothing about scripts

How do I make a Global script and put it in the quest

#10 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2010 - 03:44 PM

I expanded the snippet to a full script. Save that as nameofgame.z and go to Quest -> Scripts -> Compile Zscript, find your new .z file, and compile it. Set the script slot_2 to the second global script slot. Make the new subscreen object and you should be done.

#11 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 29 September 2010 - 03:48 PM

Whats a snippet and how do I make a script (sorry about all these questions once I get my bearings on scripts theyr'll be less of em)

so do I like copy the script on to a notepad document or something

#12 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2010 - 03:54 PM

Copy the small yet complete script into a notepad document and save it as nameofyourgame.z. The .z extension is critical. In ZQuest, go to Quest -> Scripts -> Compile Zscript like I mentioned earlier. When it's compiled, put the script called slot_2 into the second global script slot. Not FFC, not Item, but Global. Once the script is in the proper global script slot it should start working as soon as you start playing. Make that subscreen element and you're good to go.

Edited by MoscowModder, 29 September 2010 - 03:55 PM.


#13 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 29 September 2010 - 03:56 PM

We got custom counters?! Well that makes things easier for those who want to use the super bombs. icon_xd.gif

#14 Smiles the Death Bringer

Smiles the Death Bringer

    The smiling demon!

  • Members
  • Real Name:William
  • Location:Dream Land

Posted 29 September 2010 - 03:57 PM

It said it had a compiling error

#15 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2010 - 03:58 PM

Custom counters were added in build 1280.

QUOTE
* Custom Counters! Just what everyone's always wanted, right? 10 of them for use with scripts.


Drat those compiling errors. What does it say specifically?

Edited by MoscowModder, 29 September 2010 - 03:58 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users