Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Projectile Cancel/Reflect  (Read 1200 times)

Offline Tazzer

  • M.U.G.E.N Contributor
  • ****
  • Posts: 951
  • R.I.P Fuzzy Elf
  • Referrals: 0
Projectile Cancel/Reflect
« on: October 06, 2009, 10:19:08 PM »
I was just wondering if it would be a difficult process to make certain moves cancel out a projectile (as in if Ryu and Ken threw out Hadokens at the same time and they colide and stop each other) or reflect it?

For example if I wanted to apply this property to Poison's standing and air whip attacks.. would this be possible?  and if so, is it difficult to do?   My line of thinking was to make it work kind of like Rose's scraf where you can either destroy the projectile or send it back at your opponent.   

I just don't know squat about coding and I don't have the first clue how to go about it.
« Last Edit: October 06, 2009, 10:25:58 PM by Tazzer »

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #1 on: October 07, 2009, 08:51:50 AM »
I think as long as the projectile has CLSN 2 boxes it will cancel when colliding with another projectile. But there are different ways to make a projectile, some people like using helpers and some like using projectile code. As far as making a move reflect or cancel a projectile it could be achieved by making an attack like the scarf for Rose where it extends from the body and has no CLSN 2 boxes and only a CLSN 1 box and as long as the projectile has a CLSN 2 properly placed it should be canceled when the projectile comes into contact with the attack. To make it reflect you would have to implement a reversal code to the move and place the opponent into a custom state. Its more complicated but I think zvitor's expertise in this department would better explain how this could be achieved and maybe he has a code that you can use and can direct you on how to install.  After all he is the "king of code". :thumbsup:

Offline Tazzer

  • M.U.G.E.N Contributor
  • ****
  • Posts: 951
  • R.I.P Fuzzy Elf
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #2 on: October 08, 2009, 10:28:58 PM »
Thanks for the reply :).


Ok I added the CLSN 2 boxes to her handcuff projectile and now that cancels out other projectiles (which is cool, thank you!)

However I wanted her whip attacks to do that.  I added the blue boxes to her whip and lmao.. boy was that a mistake! (understand you're dealing with someone here with no char creation know-how)  The whip DID stop the projectile, but Poison reacted like she'd been hit and took damage.  Which..duh, I should have figured that would happen.  I really didn't think that through.  Was just hoping it would work the same way it did on her cuffs.   But no go.  I've since removed the CLSN 2 from her whip and am still trying to figure out how to get her whip to deal with projectiles.  Doesn't even have to reflect (that would be cool, however..) I would just settle for nullifying the on-coming projectile.

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #3 on: October 08, 2009, 10:37:33 PM »
I'll see if I can figure a way to help you with this cause I guess zvitor is busy with no doubt some WIP he has going on. :watchmen: I'm guessing that a helper will need to be made so that it will cancel a projectile, I see what I can pull out of my hat. ;)

Offline Tazzer

  • M.U.G.E.N Contributor
  • ****
  • Posts: 951
  • R.I.P Fuzzy Elf
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #4 on: October 08, 2009, 10:54:40 PM »
You are beyond awesome!  Thanks for even taking the time to try.   However, don't worry about it if it proves to be something that'll be very hard to do.  It was just an idea I had is all.  I don't want you frustrating yourself with my nonsense lol.

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #5 on: October 08, 2009, 11:05:54 PM »
No biggie I'll check it when I get some time, I'd like to learn anyway just to get better at coding. :watchmen: Hopefully one day I'll be as good as zvitor.  :worship: LOL

Offline ALEXZIQ

  • CC, TEAM SPOILER & LOTDK PROJECT LEADER
  • CC Staff
  • *
  • Posts: 6414
  • Country: 00
  • "Sic Gorgiamus Allos Subjectatos Nunc"
  • Referrals: 1
Re: Projectile Cancel/Reflect
« Reply #6 on: October 09, 2009, 06:50:37 AM »
I think you just need a variable in a basic to do it. Ive been working on it with Bane so he can slap batarangs down. I am still playing with it, but I think I am on the right track


 :th_zombie: :th_zombie: Jacko :th_zombie: :th_zombie:

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #7 on: October 09, 2009, 10:41:28 AM »
I just thought about what you stated about the CLSN 2 box in the whip attack that you wanted to make cancel projectiles, try to input a "no hit by" code into that move and make sure to include the hit types for all attacks to use a frame of the attack as a trigger like say that last frame with the whip I guess and that way it will cancel out the projectile but will not harm that character. there is a code to reflect the projectile back at the opponent and cause them to take damage from the reflected projectile but it works only with helpers and not with regular projectile code. I like to keep things simple and this "no hit by" code implementation should be simple enough to accomplish what your trying to do and if you time your attack wrong you will be punished for it by taking damage. I think that would work, no?

Offline Tazzer

  • M.U.G.E.N Contributor
  • ****
  • Posts: 951
  • R.I.P Fuzzy Elf
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #8 on: October 09, 2009, 04:48:14 PM »
I just thought about what you stated about the CLSN 2 box in the whip attack that you wanted to make cancel projectiles, try to input a "no hit by" code into that move and make sure to include the hit types for all attacks to use a frame of the attack as a trigger like say that last frame with the whip I guess and that way it will cancel out the projectile but will not harm that character. there is a code to reflect the projectile back at the opponent and cause them to take damage from the reflected projectile but it works only with helpers and not with regular projectile code. I like to keep things simple and this "no hit by" code implementation should be simple enough to accomplish what your trying to do and if you time your attack wrong you will be punished for it by taking damage. I think that would work, no?


It sounds like it would work out just fine.  Although, remember... no coding knowledge what-so-ever guy here *waves* lol.  I wouldn't know where or how to edit that stuff so it works.  I can add clsn boxes no problem...but I would know how to do the rest of what you just said.   I'm trying to learn, but as of now I just don't know anything.   Do you know of any really good coding turorials that you would recommend?


ALEXZIQ:  That sounds great.  Please let me know how that works out for you, and then maybe you can show me how to do it too?

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #9 on: October 09, 2009, 05:59:32 PM »
well as far as coding tutorials go, most of the other Mugen forums have a section for coding tutorials but they lack the instructions on how to implement them, most of the posters I guess think that everyone should know or don't care to go into detail to help others. I don't know everything about code but I understand it to a certain degree. I had to learn on my own but I know how frustrating it is to understand so I try and help those as frustrated as I use to be. Lol. Most coders like to keep code to themselves and treat it like a Holy grail. They don't like to share their knowledge and hate for anyone to use a code they claim as their own. Anyways thats another story you'll find out on the journey they call Mugen. Lol.


Ok let me help you out with implementing the "no hit by" code. Here is the code that you want to use:

[State 3000, NHB] <--- Change this number to the number of the move your placing this into.
type = NotHitBy
trigger1 = AnimElem = 2 <--- Change this number to the number of the frame of animation you are adding the CLSN2 box to. make sure there is a CLSN1 box also.
value = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT;, AA, AT, AP
time = 12 <---- this number is the time limit that the "no hit by" lasts, you'll have to experiment with this number to achieve the result your looking for. But 10 is a good number to start with.


I'll bet your asking yourself, "OK, now where the heck do I put this code."

I knew you'd ask that. Lol.

What you need to do is find the number of the move code you want to add the "no hit by" code to. You'll find the number by opening the .cmd file of the character and looking at the commands which look like this:

[Command]
name = "TripleKFPalm" <--- this is the name of the move, make note of this.
command = ~D, DF, F, D, DF, F, x <----- this is the directional movement and button mashes that perform the move. The letter in capital are the directions, U=up and so on and the lower case letters are the buttons to mash.
time = 20


Now if you know how to perform the move then look at the command line to find the move you want to edit and take note of the name.

Now scroll down the wall of gibberish/code till you find a portion of gibberish/code that contains the move name. it will look like this:

;Triple Kung Fu Palm (uses one super bar)
;OJt[˂iQ[WxPj
[State -1, Triple Kung Fu Palm]
type = ChangeState
value = 3000 <--- This is the move code number found in the .cns file
triggerall = command = "TripleKFPalm" <--- See the name of the move, so this is the reference code to the corresponding move code in the .cns file
triggerall = power >= 1000
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = movecontact


Now we'll leave all this so you can close it once you have found the move code number that is in the .cns file and then open the.cns file and look for the move code with a statedef # 3000 cause thats the move code number of the example I showed you. When you find the move code it will look like this:

;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
; CNS difficulty: medium
[Statedef 3000] < --- See here's the statedef number
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2

[State 3000, Width]
type = Width
trigger1 = AnimElem = 2, >= 0
value = 15,0

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 2, 1
pos = 25, -57
anim = 100
sound = 20, 0
poweradd = -1000

[State 3000, Super B]
type = AfterImage
trigger1 = AnimElem = 2, 1
time = 2

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1 && Time < 60
time = 2

[State 3000, Super D]
type = NotHitBy
trigger1 = AnimElem = 2
value = , NA, SA, AT
time = 11

[State 3000, Super E]
type = NotHitBy
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(14) < 0
value2 = C, NA
time = 1

[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 12
trigger3 = AnimElem = 20
value = 0, 3

[State 3000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 11
trigger3 = AnimElem = 13
trigger4 = AnimElem = 19
trigger5 = AnimElem = 21
trigger4 = AnimElem = 31
x = 10

[State 3000, 4]
type = VelSet
trigger1 = AnimElem = 5
trigger2 = AnimElem = 13
trigger3 = AnimElem = 21
x = 6

[State 3000, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 3000, 5]
type = HitDef
trigger1 = AnimElem = 5
trigger2 = AnimElem = 13
attr = S, HA
animtype  = Hard
damage    = 72,4
getpower  = 0
priority  = 6
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -6
air.velocity = -3,-2.8
air.fall = 1
fall.animtype = Hard
fall.recover = 0

[State 3000, 6]
type = HitDef
trigger1 = AnimElem = 21
attr = S, HA
animtype  = Hard
damage    = 75,4
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -5, -4
guard.velocity = -12
air.velocity = -5,-4
airguard.velocity = -3,-3
fall.animtype = Hard
fall = 1
fall.recover = 0

[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


Now all you have to do is make a copy of the "no hit by" code and make sure you made the proper edits and place it anywhere in the code, just not at the beginning or the end but in the middle, anywhere in the middle.

Does this help? If you need more direction let me know. Peace.

Offline Tazzer

  • M.U.G.E.N Contributor
  • ****
  • Posts: 951
  • R.I.P Fuzzy Elf
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #10 on: October 09, 2009, 06:15:13 PM »
Help?  Dude it is amazing.. I will so be able to do this.  Your instructions were very clear.  Thanks so much for taking the time to help me out.  It's appreciated.  I'll let you know how it works out.

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #11 on: October 09, 2009, 06:20:05 PM »
No problem, I just hope it works out the way you want it to. :watchmen:

Offline Tazzer

  • M.U.G.E.N Contributor
  • ****
  • Posts: 951
  • R.I.P Fuzzy Elf
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #12 on: October 10, 2009, 11:02:29 AM »
I edited the code with the proper numbers and put it in to the move's coding (not at the beginning or the end).. and while the whip will stop the fireball, Poison still takes damage and enters her get hit animation.   I don't know what I'm doing wrong.

Offline YD

  • ******
  • Posts: 3085
  • Country: 00
  • Referrals: 0
Re: Projectile Cancel/Reflect
« Reply #13 on: October 10, 2009, 01:07:10 PM »
I edited the code with the proper numbers and put it in to the move's coding (not at the beginning or the end).. and while the whip will stop the fireball, Poison still takes damage and enters her get hit animation.   I don't know what I'm doing wrong.

Try adjusting the "time" a little more by increments of 10, I stated that you may have to play with this to achieve the desired effect.

If that still doesn't work send my a link in a PM and I'll see if I can help you out. :watchmen:
« Last Edit: October 10, 2009, 01:08:43 PM by youngdragun »