Hey I remember that was 2OS' MUGEN projectile reflector code! He said that was not tested so I guess it needs some fixes and tweaks. By the way, 2OS's MUGEN ideas and code are usually very innovative and inspiring!
Please note for now all MUGEN versions (winmugen, MUGEN1.0, MUGEN1.1) do not support projectile reflector officially!
Unless in the future Elecbyte will be adding some new functions like ProjReflected trigger or helpertype = projective for Helper state controller.........well, for now these are in every MUGEN fan's dream I guess.......
If I am not wrong, then there are two (2) types of projectiles in MUGEN for now:
- Helper-based Projectile, a simulating projectile used by a Helper state controller
- Projectile, the real projectile state controller
The un-tested MUGEN projectile reflector code by 2OS shall work, and it is for Helper-based Projectile only
With some fixes and tweaks, it still has many limits and errors, like:
- since it makes use of the ReversalDef, which supports very limited set of HitDef values: pausetime, sparkno, hitsound, p1stateno, and p2stateno, and Elecbyte said, "The sparkxy parameter is treated as an offset to P2's hitdef's sparkxy", so you can really position the hit spark. You can let sparkno be -1 and use Explod upon MoveHit to produce a custom hit spark (shall not be too hard do so I didn't do it in my demo below here).
- since it makes use of the ReversalDef, which is a very buggy state controller, some times it is not able to reverse a thing at all (you will see it in my demo below here).
- despite of its limits and errors, it is able to use enemies' Helper-based projectile animation and HitDef, this is the only part that makes it behave like the projectile reflector in real fighting games.
The other non-Helper-based projectile reflector, that can reflect both the Helper-based projectile and the real projectile, makes use of the HitOverride state controller, and it has been commonly used in MUGEN (KOF Kula, KOF Athena, my old TMNT Cyber Shredder,...etc.)
It has pro and con:
- pro: you can have more control and it rarely produces bugs and errors
- con: the reflected projectile is your projectile, not your enemies'........
Well, this method actually is a fake projectile reflector
Ok now my demo here:
- reflecting Helper-based Projectile (by 2OS with some fixes and tweaks):
- in case imgur not working for you....:
* as you see in this MUGEN GIF, the 1st time KFM failed to reflect CFJ Oni's Helper-based projectile, it is due to ReversalDef bug (someone can try to fix it?) or the Helper-based projectile setup......
* the reflecting hit spark was misplaced because ReversalDef doesn't support sparkxy with respect to KFM, please see above explanation for an Explod MoveHit hit spark method
* a more serious MUGEN bug: the reflected Helper-based projectile belongs to CFJ Oni, however, he is not able to block/guard that even there is a guardflag = MA in the Helper's HitDef........
* you can't really possible to use your own sparks and sounds for the reflected Helper-based projectile because it belongs to your enemies' and there is no way to insert sprites and sounds to your enemies' SFF and SND......
Now the much less buggy non-Helper-based projectile reflector that can reflect both the Helper-based projectile and the real projectile (my old Cyber Shredder HitOverride method):
- in case imgur not working for you....:
* the failed projectile reflecting 1st attempt was not a bug! I deliberately delayed KFM's taunt to show he was getting hit.
* the 2nd projectile reflecting attempt succeeded as expected. The flying KFM head (LOL) is the fake "reflected enemy's projectile)
So, a real buggy projectile reflector, and a fake yet rarely buggy projectile reflector, two-in-one for this KFM demo for you......
Download here: https://www.sendspace.com/file/y42l2r
Download here: http://www.mediafire.com/download/p694odqphqoahbt/kfm_projectile_reflector_demo_with_2OS_MUGEN_code.zip
2OS' MUGEN projectile reflector code is placed in KFM's taunt state: StateDef 195
The "Rejector" Helper code is placed just below StateDef 195.
Please note that a "Stand get-hit (shaking)" StateDef 5000 common get-hit state, is needed to put under "; Override common states (use same number to override) :" (just right above [Statedef -2]), because it contains a DestroySelf state controller to prevent KFM's "Rejector" Helper from entering KFM's StateDef 5000 (a KFM clone) when being reversed/countered. This is a 2OS' MUGEN tip too.