YesNoOk
avatar

Rapid Punch TargetBind Help (Read 4728 times)

Started by All-Star Platinum, April 16, 2018, 10:06:05 pm
Share this topic:
Rapid Punch TargetBind Help
#1  April 16, 2018, 10:06:05 pm
  • ***
  • Future Funk Punk
    • Canada
For some reason, a rapid attack I am coding has a specific bug that only affects some characters. (Physically larger/various; Snorlax, Blaziken, Spec Ops characters, etc) The character performs the rapid but the opponent is pulled horizontally (with character still performing move)

Overall the code does work, just can't seem to figure out exactly what the problem is. I have managed to pinpoint it to this part of the code;
Code:
[State 1220, TargetBind]
type = TargetBind
trigger1 = MOVEHIT
time = 1
id = -1
pos = 40,0

If I change the pos (example; pos = 0,0) it performs the same big as above (pulls horizontal)

The attacks code is below here;
Code:
; EX Rapid
; CNS difficulty: easy
[Statedef 1220]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -400
velset = 5,0
anim = 1220
ctrl = 0
sprpriority = 2

[State 1220, PosAdd]
type = PosAdd
trigger1 = time = 1
x = 15

[State 1220, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1220, Afterimage]
type = AfterImageTime
trigger1 = AnimTime < -2
time = 2

[State 1130, ]
type = PalFX
trigger1 = time%2 = 0
time = 1
add = 180,120,0

[State 1202, nhb]
type = nothitby
trigger1 = 1
value = SCA
time = 2
ignorehitpause = 1

[State 1220, Shake Screen]
type = EnvShake
trigger1 = AnimElem = 6
time = 8
ampl = 3
freq = 170

[State 1210, PosAdd]
type = PosAdd
trigger1 = animelem = 15
x = 8

[State 1220, TargetBind]
type = TargetBind
trigger1 = MOVEHIT
time = 1
id = -1
pos = 40,0

[State 1220, 1]
type = HitDef
trigger1 = AnimElem = 3,>=0
trigger1 = AnimElem = 15,<0
attr = S, SA
damage = 2,2
animtype = Hard
guardflag = MA
hitflag = MAFPD
priority = 1, Hit
pausetime = 0, 15
sparkno= 2
guard.sparkno=s8100
sparkxy = -32, -80
hitsound = s6, 11
guardsound = 6, 0
ground.type = high
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,-3
air.hittime = 12
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
envshake.time = 10
envshake.freq = 120
envshake.ampl = -4
fall = 1
kill = 0

[State 1100, 1]
type = HitDef
trigger1 = AnimElem = 17
attr = S, SA          ;Attributes: Standing, Normal Throw
hitflag = MAFP          ;Affect only ground people who are not being hit
damage = 50
animtype = Heavy
guardflag = MA
hitflag = MLF
priority = 7, Hit
pausetime = 2, 8
sparkno = 0
sparkxy = -10, -76
hitsound = s6, 1
guardsound = 6, 0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -8,-7
guard.velocity = -7
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
air.cornerpush.veloff = 0
air.velocity = -1,-7
airguard.velocity = -5, -4
fall = 1
p2stateno = 1025    ;Make p2 go to state 1025 on hit
p2facing = 1
kill = 1

[State 1220, end]
type = changestate
trigger1 = animtime = 0
value = 1205

Any help would be greatly appreciated.

Thanks

-A.S.P
Last Edit: April 17, 2018, 05:21:12 am by All-Star Platinum
Re: Rapid Punch TargetBind Help
#2  April 16, 2018, 11:07:53 pm
  • *****
  • Shame on you!
    • USA
You may want to try something like
floor(target,const(size.ground.front)+30)
as your value.
I think what's happening is your widths are bumping uglies. Use Ctrl+C to see their widths and collision boxes. If they're both overlapping mugen tries to correct that.
If you have to have P2 "Inside" P1 for the attack to look right, look into PlayerPush.
But the target size front will reposition each enemy and it'll look waaaaay better for each character if you get the math going properly. Experiment with the value you add, or subtract, from it.


vVv Ryuko718 Updated 10/31/22 vVv
Re: Rapid Punch TargetBind Help
#3  April 17, 2018, 03:40:58 am
  • ***
  • Future Funk Punk
    • Canada
By value do you mean

Code:
[State 1220, TargetBind]
type = TargetBind
trigger1 = floor(target,const(size.ground.front)+30)
time = 1
id = -1
pos =40,0

It works pretty badass only it's causing the opponent to fall extra quick and almost be underneath the character. I'll check what happens against the big guys

Much appreciated thank you.
Last Edit: April 17, 2018, 03:59:03 am by All-Star Platinum
Re: Rapid Punch TargetBind Help
#4  April 17, 2018, 05:20:43 am
  • ***
  • Future Funk Punk
    • Canada
Never mind, the player push was a success, the move works completely fine now and applies to larger characters.
Thanks for your help my dude.

-A.S.P
Re: Rapid Punch TargetBind Help
#5  April 19, 2018, 12:13:26 am
  • *****
  • Shame on you!
    • USA
It needs to be the position of P2, not the check.
    [State 1220, TargetBind]
    type = TargetBind
    trigger1 = 1 ;this can be Time = 1
    time = 1      ;and this would be how many tics it should stay still for
    id = -1
    pos =floor(target,const(size.ground.front)+30),0

PlayerPush isn't the best work-around for this. In 2v2, P4 will be able to go through you.
Did you try out the Ctrl+C to see what the clsn boxes were doing? Mess around with the X position with the clsn boxes visible until you get the best value and then turn off playerpush. See what happens then.
vVv Ryuko718 Updated 10/31/22 vVv