PDA

View Full Version : FF Combos and Tiered Secrets:



ShadowTiger
12-16-2006, 08:55 PM
I had an idea for a script which would take an FF combo that looks like a folded up rope, and when -three- tiers of secrets have been triggered on the screen, the rope would begin to magically unfurl itself to the right, creating a rather solid rope bridge-like structure in its wake.

I already have a fairly solid pseudocode for the bridge's unfurling, but I'm wondering how to go about the tiered secret ordeal in terms of the script. Perhaps I could create a little counter, and whenever the secrets are triggered, it adds one to that counter. When that counter equals three, a switch statement (Right?) will go to the function which will perform the operation I will force it to do at gunpoint.



So yeah, that was my question, really. The rest is just me showing off my fancy pseudocode in awkward paragraph format! :D

Now, since we're able to define certain variables ourselves within ZQuest, this will work wonderfully. A Freeform combo (Looks like curled up rope.) is stationed at a given point on the screen, say, in a sidescrolling area, resting on the final brick/combo of a ledge. By "on," I don't mean above. I mean, it occupies the same 16x16 pixel area of that combo you can stand on top of. When all three secrets are triggered, the FF combo begins to move to the right as it turns into the combo to its right, which features a graphic of the rope unraveling itself. It will move right in terms of sixteen pixel spaces at a time, done via yet another counter. This counter will be one of the user defined things. You can put in .. say .. 3, and it will set up a counter, moving it sixteen pixels to the right, incrementing the value of an internal variable until it reaches three, where it will either stop, or go to the next combo sixteen pixels over and transform that, depending on what you want it to do. You can also tell it which direction to move in. 1 is right, 2 is down, 3 is left, 4 is up.

Moresco
12-16-2006, 09:38 PM
I think it sounds like an awesome idea. And how you described it working in code would probably work fine.

So like you'd have maybe:

ropeCounter = 0;

when tiertrigger 1 is activated (i'm not sure about this part but it makes sense to me):
ropeCounter = 1; and so forth...

You can change the combos by doing:
Screen->ComboD[#ForSpotOnScreen] = #OfYourCombo;

Or maybe there's a better way or maybe I'm not getting it, but I think that's a fairly easy way to switch out combos??

Saffith
12-16-2006, 10:03 PM
I already have a fairly solid pseudocode for the bridge's unfurling, but I'm wondering how to go about the tiered secret ordeal in terms of the script. Perhaps I could create a little counter, and whenever the secrets are triggered, it adds one to that counter. When that counter equals three, a switch statement (Right?) will go to the function which will perform the operation I will force it to do at gunpoint.Switch? I'm not sure I see how that'd apply. Switch is basically a shorter way of writing "if... else if... else if..." If that's what you mean, you're right; I just don't see how you're using it.
Regardless of how, you can't use it. ZScript doesn't have it.

Anyway, what I suggest you do (for no other reason than that it's the first thing I thought of) is to set up a tiered secret on the FFC itself. Put an inherent secret flag on the FFC's combo, and another secret flag on the combo it'll change to, and another flag on that. Then, in the script:

while(true)
{
if(this->Data == COMBO_FFC_WILL_BE_WHEN_LAST_SECRET_IS_TRIGGERED)
break;
else
Waitframe();
}
Then just have it do its stuff after it breaks out of that loop.

ShadowTiger
12-16-2006, 10:06 PM
Damn spiffy, thank you. o.o' Not really sure why I thought of a Switch statement, but it sounded useful at the time. Well, either way, considering that it would take in 1, 2, 3, or 4 for right, down, left, or up directions to travel, those are more specific than using an if statement and counters. I can't quite imagine how an if statement would look rather than a switch, though I'm sure it can be done. Seems a bit messy to me though. Probably just because I can't imagine it though.

EDIT: .. G'haa. Your description sorted that mess out well enough. Well put.


...


*spends several minutes imagining your method*

Thanks very much again. :)

.. aaah, I see. Pretty nice.

C-Dawg
12-18-2006, 10:38 AM
Yea, as we've noticed in the scripting forum before, the only way an FFC Script can detect whether a secret is triggered (relative to how the screen was before the trigger, not a boolean checking of ANY secrets were triggered) is to detect the combo used by FFCs. I suspect you could also check the combo or flag on a normal combo, too.

So, for instance, if you want to hard code custom boss health, just have the script monitor the target's combo. When it changes, decrement boss health. Ensure the combo cycles back, which resets the monitor, and repeat.