Item One: A Lives & Points System: While not yet perfect, I have it semi-functional in two games. There are a few bugs remaining, but I am certain that I can find a way around both of the big ones.
One is that the game is set to deplete a life and respawn Link when he is below 16HP (1-heart), but sometimes if Link takes enough damage to go from 30-40HP to -HP, instead of removing a life and respawning, the engine kills him.
The other has to do with some conflicts in my onContinue and onExit scripts, as the points and life count do not always reset as I desire.
Item Two: EctoGoggles!: This is an item, a new spin based on the bool item concept that MoscowModder used in his OneRing script, that enables or disables the amulet item via an item that Link must use. That is, to see invisible enemies, Link must activate his EctoGoggles, which drain MP (or Energy, as in the demo below).
(Using scripts like this, it is possible to enable any passive item only when using an active item, should you desire; the amulet seemed the most natural (initial) choice for the science-fiction themed games that I am making.)
I included some nice visual effects, including an initial screen wave, and a blue overlay, plus sound effects, etc..
Most Important...
What I learned, that may be crucial to anyone wanting to do this sort of thing: If you set up a global script to set an item to false, ZC slows to a crawl. (It dropped from 60FPS to about 25FPS on my system.)
There is a way around this, and I figured it out on my own, by a combination of experimentation and (for a change), actual understanding of the language. I thought to post the script and ask for help, but as soon as I saw that it was only happening when the passive item was set to false, but not when it was set to true, I had a suspicion that it was a waitframe category issue. I tried a simple return function first, but of course, that broke the script.
Waitframes(1), however, works like a charm, and the bottom line is that if you want to use a while loop to set an item to true, this does not seem to slow down ZC, but if you set it to false, it does. What I did, was add a Waitframes(1) to the else if statements and if statements that made the item false, and amazingly, that fixed it.
I will be posting scripts to the database, with the EctoGoggles being my next entry, and the Lives System once I debug some of the flaws. For the time being, here is a demo of EctoGoggles rev.7. (The sound files make it a tad bloated at 5.7MB for such a tiny demo, and it includes an original score of music.)
It is a mere six-screen arena, and includes some other things that I have not implemented, such as a guns and ammunition system (from a previous demo that I posted) and the lives & points system, plus a modification of jsm116's whip concept, somewhat streamlined, and turned into a proton pack/
I expect to be drawing some 'Ghostbusters' sprites--I would rip the ones from NGBII, but they are slightly larger than 16x16, and I don't want to push too hard to make an oversized player sprite just yet--to add into the game, plus ghosts, and nasties. Some will be visible only via the goggles, and my mate suggested that I set up puzzles that the player can only solve via the goggles... More on that in the future.
I am uploading this now, so it may take 5-10 minutes to be ready to download.
I will of course be posting the scripts to the database, particularly when I get the bugs out of the lives system. I will likely post the EctoGoggles scripts into the forums this evening, while I prepare a proper DB template for them.
I would appreciate any feedback, suggestions, or assistance in getting the Lives system fully-operational. The main crux is interupting the normal game engine death sequence. I am doing this:
The flaw occurs if Link dies because of zero HP, and the game does not interrupt the death with this:
if ((Game->Counter[CR_LIVES] >= 1) && (Link->HP < 17))I'm not sure if there is a better way to handle this. Perhaps something similar to HP_DEAD for NPCs would work? I'm open to any ideas or suggestions and any feedback.