A place to have fun with Mugen
 
PortalHomeFAQMemberlistSearchRegisterComic WIP TrackerDownloadsLog inChat
Translate the Website
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Latest topics
» [Super Strip Fighter 4] Yuki [NSFW]
by Doom Today at 1:05 pm

» Hellblazer aka Constantine w/video preview 11/28
by ParaDo0x Today at 1:04 pm

» WIP Valkyrie Marvel by Regisc and Cristianomelo w/video preview 11/18
by Predator Today at 12:34 pm

» TK's Lets Play: Legend of Zelda - Beyond Hyrule (ZC)
by TK830515 Today at 12:23 pm

» Spider-Woman
by pockydeluxe1 Today at 12:20 pm

» Street Fighter IV Legacy
by volzzilla Today at 11:42 am

Special Features at MMV








Share | 
 

 Reflect attack not reflecting

View previous topic View next topic Go down 
AuthorMessage
Minun



Posts : 142
Join date : 2015-03-08

PostSubject: Reflect attack not reflecting   May 12th 2015, 8:16 pm

Instead of deflecting projectiles, it disappears and the character itself gets hurt by it for some reason.

Basically, I want the character to deflect projectiles with this attack.

;---------------------------------------------------------------------------
; Neutral B Forward
; CNS difficulty: easy
[Statedef 1300]
type    = S ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A ;Move-type: A-attack, I-idle, H-gethit
physics = S ;Physics: S-stand, C-crouch, A-air
juggle  = 1 ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0 ;Set velocity (x,y) (Def: no change)
ctrl = 0 ;Set ctrl (Def: no change)
anim = 1300 ;Change animation (Def: no change)
poweradd = 20 ;Power to add (Def: 0)
sprpriority = 2 ;Set layering priority to 2 (in front)



[State 0, Helper]
type = Helper
trigger1 = time = 0
helpertype = normal ;player
name = "Rejector"
ID = 1301
stateno = 1301
pos = 36,-40
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1.5
size.yscale = 1.5
;size.ground.back =
;size.ground.front =
;size.air.back =
;size.air.front =
;size.height =
;size.proj.doscale =
;size.head.pos = ,
;size.mid.pos = ,
;size.shadowoffset =
;ignorehitpause =
;persistent =





[State 0, CtrlSet]
type = CtrlSet
trigger1 = stateno = 40 && time = 15
value = 1
;ignorehitpause =
;persistent =


[State 201, 0]
type = ChangeState
trigger1 =  command != "hold_a"
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Neutral B Forward air
; CNS difficulty: easy
[Statedef 1301]
movetype= A ;Move-type: A-attack, I-idle, H-gethit
juggle  = 1 ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0 ;Set velocity (x,y) (Def: no change)
ctrl = 0 ;Set ctrl (Def: no change)
anim = 1301 ;Change animation (Def: no change)
poweradd = 20 ;Power to add (Def: 0)
sprpriority = 2 ;Set layering priority to 2 (in front)

[State Invisible Helper, Deflect]
type=reversaldef
trigger1=target,ishelper
reversal.attr=sca,ap
p2stateno= 1302


[State 0, DestroySelf]
type = DestroySelf
trigger1 =  root,stateno != 1300
;ignorehitpause =
;persistent =

;---------------------------------------------------------------------------
; Neutral B Forward
; CNS difficulty: easy
[Statedef 1302]
movetype= A ;Move-type: A-attack, I-idle, H-gethit

[State Deflect, Turn Projectile Around To Face Enemy]
type=turn
trigger1=ishelper&&time=0

[State Deflect, Mirror Speed]
type=velset
trigger1=ishelper
x=(-vel x)

[State Deflect, Hit]
type=hitdef
trigger1=ishelper
attr=s,sp
damage=(vel x*10),(vel x*2) ; needless to say, velocity will vary, so using velocity to damage accordingly is the best way to go imo, think of a real life situation, more speed, more impact
p1stateno= 1303


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 30
;ignorehitpause =
;persistent =
[Statedef 1303]
movetype=i

[State Impact, Shrink Setting]
type=varset
trigger1=time=0
fvar(2)=0
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

[State Impact, Shrink Setting]
type=varadd
trigger1=time>=0
fvar(2)=-0.7
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

[State Impact, Shrink To Nothing]
type=angledraw
trigger1=time>=0
scale=const(size.xscale)+(fvar(2)), const(size.yscale)+(fvar(2))
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

[State Impact, Gone]
type=destroyself
trigger1=const(size.xscale)=0&&const(size.yscale)=0
Back to top Go down
View user profile
Minun



Posts : 142
Join date : 2015-03-08

PostSubject: Re: Reflect attack not reflecting   May 14th 2015, 5:03 pm

Someone? Please?
Back to top Go down
View user profile
Minun



Posts : 142
Join date : 2015-03-08

PostSubject: Re: Reflect attack not reflecting   May 16th 2015, 8:09 am

Ok...
Back to top Go down
View user profile
borewood2013



Posts : 3122
Join date : 2014-08-11

PostSubject: Re: Reflect attack not reflecting   May 16th 2015, 11:43 am

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! yes

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....... Rolling Eyes

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...... No

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
or
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. Idea
Back to top Go down
View user profile https://onedrive.live.com/?cid=7DB65F02B0BBD12E
 
Reflect attack not reflecting
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
The Mugen Multiverse :: Mugen :: Mugen Help-
Jump to: