Replicating the flash damage effect from bosses

Status
Not open for further replies.

clairebun

Community Noise Maker
Sonic Team Junior
Not sure how I'm supposed to go about this. I want to aesthetically recreate the flashing effect on BrakEggman for normal enemies. I imagine I could easily utilize v.draw and v.getcolormap to show the sprite in the flash palette, but I don't know how to refer to the patch currently being used by a mobj, especially since frames are multidirectional. What do?
 
Last edited:
Yeah, that flash effect is hardcoded to be only be set for bosses with MF2_FRET every other tic, I'm afraid you can't replicate it using Lua currently.

v.draw/v.getColormap/any other v.function are only for custom graphics of your choosing that are to be displayed directly on the HUD (which could themselves be sprites, but that's possibly not what you want?), rather than an actual sprite used by a mobj in-game.
 
Last edited:
No "elegant" way of doing it, maybe, but that doesn't mean there's no way of doing it. The traditional solution is to actually set MF_Boss and MF2_Fret on the enemy and take it off when invincibility was supposed to end - but manually doing stuff with Fret was only really necessary because we couldn't anticipate taking damage, otherwise we'd have let the boss thinker manage that part for us. With the damage hook though you can guarantee it gets put on before damage is applied though, so you might be able to stick MF_Boss on with that to get flashing and take it off later without having to deal with fret at all.

That was good enough to get you the normal color #000000 flashing, but the whole-sprite flashing brak has might be restricted to certain mobj slots. If I were trying to do this back in the day, I might have resorted to replacing the crawla commander or something if I really wanted the silhouette flash.
 
Last edited:
Um Prime, the actual flashing effect DOES ultimately require MF_BOSS and MF2_FRET in the sprite rendering code though (see this line in R_DrawVisSprite for software, and this line in HWR_ProjectSprite in hw_main.c for OpenGL). And yes, Metal Sonic's and 2.1 Brak Eggman's own flashing are specific to their object types. The flags don't toggle the effect on in the damaging code as you seem to be thinking they do, they need to stay on the whole time after being damaged for the flashing effect.

There's honestly no way around it unless your object actually use those flags, or is also those object types for the Metal/Brak specific flashes.
 
Last edited:
Yeah, the thing is that I need to span this across pretty much every damageable object type sans MT_PLAYER, without actually damaging the object. Honestly I don't think what I'm asking for is within Lua's capabilities at the moment.
 
Um Prime, the actual flashing effect DOES ultimately require MF_BOSS and MF2_FRET in the sprite rendering code though
Yes. This is why I suggested literally setting and MF_BOSS as needed. At no point did I say that MF_Boss was not needed to do the effect, or even that MF2_FRET wouldn't be needed, only that the script might not have to handle setting and removing MF2_FRET manually.

MF2_Fret is something bosses apply to themselves when hurt - prior to lua however, there was no way to just set MF_BOSS right before something got hit, hence why MF2_FRET then had to be set and removed manually.

Yeah, the thing is that I need to span this across pretty much every damageable object type sans MT_PLAYER, without actually damaging the object. Honestly I don't think what I'm asking for is within Lua's capabilities at the moment.
You can set MF2_FRET without waiting for the mobj to get hurt, though - You'll get invincibility frames and flashing regardless. Having brak-style silhouette flashing on everything actually might be beyond it, though, unless you're willing to do some really crazy rube goldberg stuff like having a mobj with Brak's thingnum that spawns, copies the sprite of what spawned it, hides the sprite of what spawned it, and then flashes for that object before disappearing and revealing the original mobj again.
 
Last edited:
You can set MF2_FRET without waiting for the mobj to get hurt, though - You'll get invincibility frames and flashing regardless.
Ah yeah, that would be plenty. I'll give it a go when I have SLADE handy.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top