Returning (Boomerang) Projectile This is the code that supposedly got thrown in ALL Capcom coders' faces at Mugen Dev Forum. Hogwash. There had been people in MUGEN asking for a returning/Boomerang type projectile for well over three months before I even bothered to sit down and redo Android 16's Rocket Punch. IF THEY CAN'T DO IT IN THREE MONTHS, THEY CAN'T DO IT. This code took me a whole 2 hours to both write and debug (using the helper docs from Mugen v01.01.2000 if I remember correctly - old age). Animation 360 is the hand that detaches from Android 16 and travels across the screen until: (1) reaching the screen edge [frontedgedist], (2) hitting the opponent [movecontact], or (3) after 2 seconds [time = 120]. At this point the projectile reverses direction and keeps returning until reaching the player's position [rootdist X]. It also has a HitDef for the return so you can get them on the way out and on the way back in. Animation 360 has no clsn2 boxes for a reason. Android 16's hand shouldn't get destroyed so by taking away the collision boxes the hand becomes invincible. The tracking/homing projectile code (1750) deals a little bit with things that can be done with helpers. Helpers ARE not projectiles or projectile substitutes but are a way to make odd things happen to a projectile acting helper. Helpers are still somewhat limited in scope as far as projectile type usage. State 350 is the start of the helper, state 360 is the helper (hand) going away from the character and state 370 is the helper (hand) coming back and being "destroyed". Add in the tired out fireball coding if desired as well. And as well: There are a LOT of new states and triggers, if you come across something you don't understand, look it up in the trigger and sctrls docs. You will get MUCH MORE information that way than me just explaining stuff that has already been explained before elsewhere. >>>>>> .air file ;Android 16 arm off animation [Begin Action 350] Clsn2: 1 Clsn2[0] = 10, 0,-31,-76 350,0, 0,0, 10 Clsn2: 1 Clsn2[0] = -31,-76, 10, 0 350,1, 0,0, -1 ;Android 16 hand going forward animation [Begin Action 360] Clsn1: 1 Clsn1[0] = 21,-62, 41,-49 360,0,0,0,4 ;Android 16 hand returning animation [Begin Action 370] Clsn1: 1 Clsn1[0] = 21,-62, 41,-49 360,0,0,0,4 Clsn1: 1 Clsn1[0] = 36,-67, 23,-46 360,1,0,0,4 Clsn1: 1 Clsn1[0] = 39,-49, 20,-61 360,2,0,0,4 Clsn1: 1 Clsn1[0] = 25,-44, 36,-64 360,3,0,0,4 ;Android 16 hand off animation for hitoverride state [Begin Action 375] Clsn2: 1 Clsn2[0] = -31,-76, 10, 0 350,1, 0,0, -1 >>>>>> top of .cmd file [Command] name = "Rocket_Punch" command = ~D, DF, F, a >>>>>> bottom of .cmd file ;Rocket_Punch [State -1] type = ChangeState value = 350 trigger1 = command = "Rocket_Punch" trigger1 = FrontEdgeDist >= 15 trigger1 = statetype = S trigger1 = ctrl = 1 >>>>> .cns file ;Rocket_Punch [Statedef 350] type = S movetype = A physics = S poweradd = -1000 juggle = 1 anim = 350 ctrl = 0 velset = 0,0,0 ;add tired out fireball cns codes here (280,add#) ; spawn (create) the projectile as a helper [State 350, 1] type = Helper trigger1 = time = 10 ID = 360 Pos = 0,0 postype = p1 stateno = 360 helpertype = normal keyctrl = 0 ownpal = 0 ;projectile launch sound [State 350, 2] type = PlaySnd trigger1 = Time = 2 value = 3,8 ;Damage adjuster for hitoverride - VERY USEFUL CODE! [State 350, 2.4] Type = LifeAdd trigger1 = GetHitVar(damage) > 0 value = -GetHitVar(damage) ;If Android 16 gets hit during move this makes his arm stay off ;and keeps Android 16 from going into the get hit states where ;his hand would reappear [State 350, 2.5] Type = HitOverride trigger1 = time >= 10 attr = SCA,AA,AP,AT stateno = 375 ;Changestate which puts Android 16 'in control' after helper ;projectile disappears and time >= 11 [State 350, 3] Type = ChangeState trigger1 = time >= 11 trigger1 = NumHelper(360) = 0 value = 0 ctrl = 1 ;Rocket Punch Helper 1 [Statedef 360] type = S movetype= A physics = S juggle = 2 poweradd= 0 ctrl = 0 anim = 360 ;HitDef [State 360, 1] type = HitDef trigger1 = Time = 0 attr = S, SA damage = 140,50 getpower = 0 givepower = 0 hitflag = MAFD guardflag = MA pausetime = 12,12 sparkxy = 0,-60 sparkno = 1 hitsound = 5,2 guardsound = 6,0 ground.type = Trip ground.slidetime = 10 ground.hittime = 15 ground.velocity = -1.5 air.velocity = -1.2,-3 guard.velocity = -5 fall = 1 ;Afterimage for trails behind projectile (hand) [State 360, 1.5] type = AfterImage Trigger1 = time = 1 length = 15 PalColor = 0 TimeGap = 1 FrameGap = 3 Trans = Add1 time = 20 ;speed of projectile helper (hand) [State 360, 2] type = velset trigger1 = time >= 0 x = 6 ;resets afterimage trails behind hand to not appear anymore [State 360, 3] type = afterimagetime trigger1 = movecontact = 1 trigger2 = FrontEdgeDist <= 15 trigger3 = time >= 60 value = 0 ;Switch to returning helper animations (hand) [State 360, 4] type = ChangeState trigger1 = movecontact = 1 trigger2 = FrontEdgeDist <= 15 trigger3 = time >= 60 value = 370 ctrl = 0 ;Rocket Punch Helper 2 ;destroy the helper [Statedef 370] type = S movetype= A physics = S juggle = 2 poweradd= 0 ctrl = 0 anim = 370 ;Reset afterimage trails [State 370, 1] type = afterimagetime trigger1 = 1 value = 0 ;HitDef [State 370, 2] type = HitDef trigger1 = Time = 10 attr = S, SA damage = 140,50 getpower = 0 givepower = 0 hitflag = MAFD guardflag = MA pausetime = 12,12 sparkxy = 0,-60 sparkno = 1 hitsound = 5,2 guardsound = 6,0 ground.type = Trip ground.slidetime = 10 ground.hittime = 15 ground.velocity = -1.5 air.velocity = -1.2,-3 guard.velocity = -5 fall = 1 ;return speed of helper (hand) [State 370, 3] type = velset trigger1 = time >= 0 x = -3 ;reset helper speed to zero [State 370, 4] type = VelSet trigger1 = RootDist X = 0 x = 0 ;remove helper [State 370, 5] type = DestroySelf trigger1 = RootDist X >= 0 ;Hitoverride state for keeping his hand from appearing [Statedef 375] type = S movetype = A physics = S poweradd = -1000 juggle = 1 anim = 375 ctrl = 0 velset = 0,0,0 ;Used for when hit again and again... [State 350, 2.4] Type = LifeAdd trigger1 = GetHitVar(damage) > 0 value = -GetHitVar(damage) ;used for when hit again and again... [State 350, 2.5] Type = HitOverride trigger1 = 1 attr = SCA,AA,AP,AT stateno = 375 ;Notice missing time value? [State 350, 3] Type = ChangeState trigger1 = NumHelper(360) = 0 value = 0 ctrl = 1 ************EXTRA EXTRA EXTRA EXTRA********************** ****************SEPARATE CODES*************************** ************WARNING, WARNING, WARNING******************** Now, for those that want the projectile to destroy itself and ANY projectile it comes in contact with then use these codes below (note: if projectile hits anything on the way out or back it destroys itself instantly): Part 2 - destroying boomerang >>>>>> .air file ;character animations [Begin Action 350] Clsn2: 1 Clsn2[0] = 10, 0,-31,-76 350,0, 0,0, 10 Clsn2: 1 Clsn2[0] = -31,-76, 10, 0 350,1, 0,0, -1 ;Android 16 hand going forward animation [Begin Action 360] Clsn1: 1 Clsn1[0] = 21,-62, 41,-49 Clsn2: 1 Clsn2[0] = 21,-62, 41,-49 360,0,0,0,4 ;Android 16 hand returning animation [Begin Action 370] Clsn1: 1 Clsn1[0] = 21,-62, 41,-49 Clsn2: 1 Clsn2[0] = 21,-62, 41,-49 360,0,0,0,4 Clsn1: 1 Clsn1[0] = 36,-67, 23,-46 Clsn2: 1 Clsn2[0] = 36,-67, 23,-46 360,1,0,0,4 Clsn2: 1 Clsn1[0] = 39,-49, 20,-61 Clsn2: 1 Clsn2[0] = 39,-49, 20,-61 360,2,0,0,4 Clsn1: 1 Clsn1[0] = 25,-44, 36,-64 Clsn2: 1 Clsn2[0] = 25,-44, 36,-64 360,3,0,0,4 ;Android 16 hand off animation for hitoverride state [Begin Action 375] Clsn2: 1 Clsn2[0] = -31,-76, 10, 0 350,1, 0,0, -1 >>>>>> top of .cmd file [Command] name = "Rocket_Punch" command = ~D, DF, F, a >>>>>> bottom of .cmd file ;Rocket_Punch [State -1] type = ChangeState value = 350 trigger1 = command = "Rocket_Punch" trigger1 = FrontEdgeDist >= 15 trigger1 = statetype = S trigger1 = ctrl = 1 >>>>> .cns file ;Rocket_Punch [Statedef 350] type = S movetype = A physics = S poweradd = -1000 juggle = 1 anim = 350 ctrl = 0 velset = 0,0,0 ; spawn (create) the projectile as a helper [State 350, 1] type = Helper trigger1 = time = 10 ID = 360 Pos = 0,0 postype = p1 stateno = 360 helpertype = normal keyctrl = 0 ownpal = 0 ;projectile launch sound [State 350, 2] type = PlaySnd trigger1 = Time = 2 value = 3,8 ;Damage adjuster for hitoverride - VERY USEFUL CODE! [State 350, 2.4] Type = LifeAdd trigger1 = GetHitVar(damage) > 0 value = -GetHitVar(damage) ;If Android 16 gets hit during move this makes his arm stay off ;and keeps Android 16 from going into the get hit states where ;his hand would reappear [State 350, 2.5] Type = HitOverride trigger1 = time >= 10 attr = SCA,AA,AP,AT stateno = 375 ;Changestate which puts Android 16 'in control' after helper ;projectile disappears and time >= 11 [State 350, 3] Type = ChangeState trigger1 = time >= 11 trigger1 = NumHelper(360) = 0 value = 0 ctrl = 1 ;Rocket Punch Helper 1 [Statedef 360] type = S movetype= A physics = S juggle = 2 poweradd= 0 ctrl = 0 anim = 360 ;helper hit by projectile not attack (AA) or throw (AT) [State 360, .7] type = NotHitBy trigger1 = time >= 0 value = ,AA,AT ;Hitoverride for 'gethit' animations - sends to destroy self [State 360, .8] type = HitOverride trigger1 = time = 0 attr = SCA,AP ;,AT,AA stateno = 371 time = -1 ;HitDef [State 360, 1] type = HitDef trigger1 = Time = 0 attr = S, SA damage = 140,50 getpower = 0 givepower = 0 hitflag = MAFD guardflag = MA pausetime = 12,12 sparkxy = 0,-60 sparkno = 1 hitsound = 5,2 guardsound = 6,0 ground.type = Trip ground.slidetime = 10 ground.hittime = 15 ground.velocity = -1.5 air.velocity = -1.2,-3 guard.velocity = -5 fall = 1 ;Afterimage for trails behind projectile (hand) [State 360, 1.5] type = AfterImage Trigger1 = time = 1 length = 15 PalColor = 0 TimeGap = 1 FrameGap = 3 Trans = Add1 time = 20 ;speed of projectile helper (hand) [State 360, 2] type = velset trigger1 = time >= 0 x = 6 ;resets afterimage trails behind hand to not appear anymore [State 360, 3] type = afterimagetime trigger1 = movecontact = 1 trigger2 = FrontEdgeDist <= 15 trigger3 = time >= 60 value = 0 ;remove helper [State 360, 3.5] type = DestroySelf trigger1 = movecontact = 1 ;Switch to returning helper animations (hand) [State 360, 4] type = ChangeState trigger1 = FrontEdgeDist <= 15 trigger2 = time >= 60 value = 370 ctrl = 0 ;Rocket Punch Helper 2 ;destroy the helper [Statedef 370] type = S movetype= A physics = S juggle = 2 poweradd= 0 ctrl = 0 anim = 370 ;Reset afterimage trails [State 370, 1] type = afterimagetime trigger1 = 1 value = 0 ;helper hit by projectile not attack (AA) or throw (AT) [State 370, 1.7] type = NotHitBy trigger1 = time >= 0 value = ,AA,AT ;Hitoverride for 'gethit' animations - sends to destroy self [State 370, 1.8] type = HitOverride trigger1 = time = 0 attr = SCA,AP ;,AT,AA stateno = 371 time = -1 ;HitDef [State 370, 2] type = HitDef trigger1 = Time = 10 attr = S, SA damage = 140,50 getpower = 0 givepower = 0 hitflag = MAFD guardflag = MA pausetime = 12,12 sparkxy = 0,-60 sparkno = 1 hitsound = 5,2 guardsound = 6,0 ground.type = Trip ground.slidetime = 10 ground.hittime = 15 ground.velocity = -1.5 air.velocity = -1.2,-3 guard.velocity = -5 fall = 1 ;return speed of helper (hand) [State 370, 3] type = velset trigger1 = time >= 0 x = -3 ;reset helper speed to zero [State 370, 4] type = VelSet trigger1 = RootDist X = 0 x = 0 ;remove helper [State 370, 5] type = DestroySelf trigger1 = RootDist X >= 0 trigger2 = movecontact = 1 ;destroy the helper [Statedef 371] type = S movetype= A physics = S juggle = 2 poweradd= 0 ctrl = 0 anim = 360 ;remove helper [State 371, 5] type = DestroySelf trigger1 = time >= 0 ;Hitoverride state for keeping his hand from appearing [Statedef 375] type = S movetype = A physics = S poweradd = -1000 juggle = 1 anim = 375 ctrl = 0 velset = 0,0,0 ;Used for when hit again and again... [State 350, 2.4] Type = LifeAdd trigger1 = GetHitVar(damage) > 0 value = -GetHitVar(damage) ;used for when hit again and again... [State 350, 2.5] Type = HitOverride trigger1 = 1 attr = SCA,AA,AP,AT stateno = 375 ;Notice missing time value? [State 350, 3] Type = ChangeState trigger1 = NumHelper(360) = 0 value = 0 ctrl = 1