PDA

View Full Version : Energy Tanks and Invul Frames



Lelouche Vi Britannia
05-16-2018, 03:52 PM
Question 1; and I put this in scripting since I'm almost positive this is going to require some scripting to pull off...

How would I set up an Energy Tank health system like Metroid uses. I want to do this for both Health and Magic (magic is simply being renamed Energy for flavor in the quest). I had this crazy idea to do a more scifi style quest, so I want to use Metroid's health system and adapt it for Energy which is being used for energy based weapons and special utility items.

Optionally, I'd like the energy value to be kinda abstract in the sense that no specific numbers are shown to the player so the energy tank system should have the energy tank squares as its top row and the bottom would simply be the Energy 00-99 counter, but the magic side would show Energy Tanks on the top row and a standard meter on the bottom.

Question 2; How do I reduce Enemy Invul frames? I'd like to set up the game so that the enemies do not have as many invul frames, so that rapid shots can each deal damage without passing though harmlessly (enemy hp's are getting adjusted up a bunch). Ideally, I'd also like knockback removed with the exception of specific items (Sword, Hammer, Hookshot, Bomb Weapons).

Thanks in advance.

Anarchy_Balsac
05-16-2018, 06:00 PM
Setup a variable to record current health and round up to the nearest full heart (Health is in 16ths of a heart IIRC). Set up another to represent a "life bar". Set up a 3rd for "checked damage"

Then run a function that runs every frame to check for damage, deduct "checked damage" from "life bar" and if life bar <= 0, set life bar back to max, and health to "current health "- 16. Otherwise, set health back to "current health".

The ONLY problem with this is that you may "die" with one full E-tank, and given how ZC works, I'm not sure if there is a way around this ZoriaRPG

Gleeok
05-17-2018, 10:38 AM
Someone actually did a Metroid HP system before. It might of just been: Game->Counter[..] = Link->HP; And maybe the reserve tanks were just another counter you check only when HP drops to zero.

You can check Link->HP <= 0 now and setting it above zero will save Link from dying. (This has been around since 2.5 RC1 IIRC).

Lelouche Vi Britannia
05-17-2018, 09:31 PM
There was a script I was using for an item that acted like a fairy in a bottle. Not sure if that will be of help.

How do I use the subscreen to display full or empty health tanks?

Lelouche Vi Britannia
05-18-2018, 09:53 PM
Better question; is there a way to modify how many hp are in a heart meter piece?

Downloader
05-21-2018, 07:59 PM
There was a script I was using for an item that acted like a fairy in a bottle. Not sure if that will be of help.

How do I use the subscreen to display full or empty health tanks?

Note that with scripting you can draw anything in the passive subscreen area by setting the Y, for example, in a drawtile or drawinteger function, to a negative number that is less than zero but greater than around -64 or so.
To draw that type of thing to the active subscreen, you might need to write code that adds and takes away items based on whether the Energy Tank is full or not, and overlap their space on the subscreen so that the item changes there depending on if the tank is full or not.

Lelouche Vi Britannia
05-22-2018, 12:20 PM
Currently working with someone on PureZC to get it working. I'll let everyone know how it goes.

ZoriaRPG
05-24-2018, 04:51 AM
Erm, yes. I was the one who wrote the Metroid ETanks thing, including drawing to the subscreen.

Here, have fun: Metroid ETanks and Save Points (http://timelord.insomnia247.nl/zc/ywkls_Metroid_0.8.5.zs).

There's a lot of stuff that ywkls had in his quest that you will need to strip out, but it's fairly easy to understand.

ZoriaRPG
05-24-2018, 06:22 AM
You cannot interact with npc states that control knockback or inv frames in 2.50.x. You can force the enemy xy manually, as a hack, but inv frames aren't something that you can read, or set, in ZC < 2.54 (some Alpha).

In the latest builds, you have npc->InvFrames. I might look into a knockback boolean, and of course add npc->Knockback(dir) or (angle), along with npc->Hit(w_type, damage, dir).

HP/Heart and MP/Block are internal engine constants. At present, there is no way to change them, although it doesn't seem overly difficult to add that as a future feature. I scripted my own HP and MP mechanics to bypass this in 2.50.

Lelouche Vi Britannia
05-27-2018, 10:01 PM
You cannot interact with npc states that control knockback or inv frames in 2.50.x. You can force the enemy xy manually, as a hack, but inv frames aren't something that you can read, or set, in ZC < 2.54 (some Alpha).

In the latest builds, you have npc->InvFrames. I might look into a knockback boolean, and of course add npc->Knockback(dir) or (angle), along with npc->Hit(w_type, damage, dir).

HP/Heart and MP/Block are internal engine constants. At present, there is no way to change them, although it doesn't seem overly difficult to add that as a future feature. I scripted my own HP and MP mechanics to bypass this in 2.50.

*sigh* Oh well, I'll just have to deal with it. Of course at the rate I'm working on this project, We'll be well into a new version of ZQuest by then.