HP instead of hearts
#1
Posted 29 September 2010 - 02:16 PM
#2
Posted 29 September 2010 - 02:18 PM
#3
Posted 29 September 2010 - 02:24 PM
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
Posted 29 September 2010 - 03:29 PM
#5
Posted 29 September 2010 - 03:32 PM
#6
Posted 29 September 2010 - 03:32 PM
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:
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
Posted 29 September 2010 - 03:37 PM
#8
Posted 29 September 2010 - 03:40 PM
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:
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
Posted 29 September 2010 - 03:44 PM
How do I make a Global script and put it in the quest
#10
Posted 29 September 2010 - 03:44 PM
#11
Posted 29 September 2010 - 03:48 PM
so do I like copy the script on to a notepad document or something
#12
Posted 29 September 2010 - 03:54 PM
Edited by MoscowModder, 29 September 2010 - 03:55 PM.
#13
Posted 29 September 2010 - 03:56 PM
#14
Posted 29 September 2010 - 03:57 PM
#15
Posted 29 September 2010 - 03:58 PM
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