PDA

View Full Version : FFC contact with Link's Weapons



C-Dawg
11-13-2006, 08:24 PM
I'm wondering if there is (or could be) a way for an FFC to check whether it is on the same square as one of Link's weapons in use. For instance, his sword, an arrow, an exploding bomb, etc. Currently this works with secret combos (sortof - see my bug reports) but it would be more efficient to use scripts to track damage behavior.

It strikes me that you could simulate this behavior using an invisible FFC that "tracks" Link's attack. For instance, it could wait for Link's action to be "Attack," and then place an invisible FFC at the location his sword will swing for as long as his sword is there. If slashing is enabled, it can start where the sword starts and move along Link. Then, you could check whether the FFCs collide.

I dont' think this will work with other items, though, since I don't think there's a way to test what item Link is using.

Just for background, what I'm trying to do is program a boss with the following behavior:

1. Consists of one 2/2 body and two 2/2 wings
2. Flies around the room in, periodically spawning bombachus
3. If Link hits one wing with an arrow, it will stop flapping for a brief period
4. If Link his the other wing quickly enough, the boss will drop to the floor and be stunned. Boss is vulnerable to sword damage (tiered secret combos are fine) in this state only.
5. After a short period, boss will hop back up and take to the sky again.

With a way to detect whether the wing FFCs are in contact with an arrow, this is pretty easy. But without it, you'd have to resort to screen-based warping to determine which wing was hit first.

Saffith
11-13-2006, 09:08 PM
For now, using a second "sensor" FFC is all you can do. Just set up a separate one for each type of weapon you want to react to. I don't think you can check the level just yet, though.
I doubt think even that will work, though. I've tried it myself, and in my case, hitting the sensor never triggered it. Fairly certain that's a bug, but I might've set it up wrong. Been meaning to check that...
In b15, it should be possible to loop through all the items on the screen, checking each one's type and position.

C-Dawg
11-14-2006, 12:32 PM
If by "sensor" FFCs, the trouble is that they trigger secrets. If there was a sword->next combo or something like that, you could check this->Data to see if it was hit by a weapon. But currently, you have to trigger all secrets at once or none. Ya know?

jman2050
11-14-2006, 12:51 PM
solution: use singular flags

C-Dawg
11-14-2006, 02:54 PM
I'm not even sure what those are exactly. Are singular flags secrets that don't trigger any other flags when they go off? Or rather, they must all be triggered singularly before they activate secrets? Gimme a brief description of how they work.

Even then, I'm still using the tried and true screen animation method by doing this. Singular flag, singular flag -> trigger to new screen. Scripting might otherwise let you simulate a vulnerable period where you get a few minutes to beat the crap out of the boss as fast as you can, registering hits until it recovers.

Saffith
11-15-2006, 03:37 PM
That's almost it. With inherent flags and FFCs, it's possible to have multiple flags in the same place. A singular flag does not respond to anything; rather, if a singular flag is in the same area as another flag, triggering the latter will not affect any other flags on the screen.

jman2050
11-15-2006, 04:36 PM
That's almost it. With inherent flags and FFCs, it's possible to have multiple flags in the same place. A singular flag does not respond to anything; rather, if a singular flag is in the same area as another flag, triggering the latter will not affect any other flags on the screen.

What he said. Additionally, the all secrets->trigger 16-31 flag (which I should rename at one point) makes it so that all trigger flags that have singular flags on them mut be triggered before flags 16-31 are triggered. Additionally, the all secret->trigger perm (which should also be renamed) makes it so that the secrets of a room do not become permanent until all triggers with singular flags are triggered. Keep that in mind.

C-Dawg
11-16-2006, 11:07 AM
Hm. Is there a way, in a script, to check if a given singular flag has been triggered? I guess there is an indirect way, isn't there? Go with me on this:

1. Enemy is made up of three 2x2 FFCs, the outer two wings having arrow and singular flags on them.
2. Layer 0's arrow secrets go to a "stunny" looking combo.
3. The FFC script monitors what combo is being displayed by the wings. If the left wing ever displays a stunny combo, it quickly replaces it with the left wing damaged graphic. Same with the right.
4. FFC will return the wings to normal after a period of time.
5. If both wings are set to damaged graphic combos at the same time, the middle FFC changes combo and location to be the "fallen" combo. This combo has an innate sword flag.
6. The sword secret is the damaged animation for the fallen combo, and cycles back to the combo with an innate sword flag in a few tics.
7. The sword flag has no singular flag, so it will trigger tiered secrets, letting you display boss HP and such.

Gee, I think that might actually work.