YesNoOk
avatar

Detecting movehit. (Read 220 times)

Started by WooshaQ, July 23, 2013, 10:16:08 am
Share this topic:
Detecting movehit.
#1  July 23, 2013, 10:16:08 am
  • ***
  • Smart Icoca wannabe!
    • Poland
    • samouczek.com/

  • Online
For some reason I cannot detect movehit in the state below. Putting movehit trigger does not seem to work, any idea why? I want to add some kind of effect when p2 is hit, any idea why?

Code:
[Statedef 1300]
type = S
movetype = A
physics = N
anim = 1300
ctrl = 0
velset = 0,0
juggle = 0
poweradd = 30
facep2 = 1
sprpriority = 2

[State -2, Varset]
type = Varset
trigger1 = time = 0
var(38) = 0

[State -2, Varset]
type = Varset
trigger1 = time = 0
var(58) = 0

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
var(35) = 0

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
var(56) = 0

[State -2, Attack_Down]
type = VarSet
trigger1 = time = 0
fvar(25) = fvar(0)

[State 1000, NotHitBy]
type = NotHitBy
trigger1 = prevstateno = 40 && var(3)
trigger1 = Time = 0
value = SC, AT
time = 2

[State 1100, Position]
type = PosSet
trigger1 = Time = 0
y = 0

[State -2, Explod]
type = Explod
trigger1 = anim = 1300 && animelem = 8
trigger2 = anim = 1300 && animelem = 22
anim = 6470
pos = 0,0
postype = p1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1
scale = const(size.xscale), const(size.yscale)

[State -2, Explod]
type = Explod
trigger1 = anim = 1301 && animelem = 9
anim = 6471
pos = 0,0
postype = p1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1
scale = const(size.xscale), const(size.yscale)

[State -2, Explod]
type = Explod
trigger1 = anim = 1300 && animelem = 10
trigger2 = anim = 1300 && animelem = 15
trigger3 = anim = 1300 && animelem = 24
trigger4 = anim = 1300 && animelem = 29
trigger5 = anim = 1301 && animelem = 6
trigger6 = anim = 1301 && animelem = 10
anim = 7800
postype = p1
pos = 0,0
facing = -1
sprpriority = 3
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State -2, Explod]
type = Explod
trigger1 = anim = 1300 && animelem = 21
anim = 7800
postype = p1
pos = ceil(15*const(size.xscale)),0
facing = -1
sprpriority = 3
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State -2, Explod]
type = Explod
trigger1 = anim = 1300 && animelem = 21
anim = 7800
postype = p1
pos = ceil(14*const(size.xscale)),0
facing = -1
sprpriority = 0
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State -2, Explod]
type = Explod
trigger1 = anim = 1310 && animelem = 10
trigger2 = anim = 1300 && animelem = 24
trigger3 = anim = 1301 && animelem = 6
trigger4 = anim = 1301 && animelem = 10
anim = 7800
postype = p1
pos = ceil(-3*const(size.xscale)),0
facing = -1
sprpriority = 0
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State 220, ChangeAnim]
type = ChangeAnim
triggerall = anim = 1300
triggerall = animelemtime(18) = 0
trigger1 = command = "holddown"
value = 1301
ignorehitpause = 0

[State -2, posadd]
type = posadd
triggerall = anim = 1300
trigger1 = animelem = 3
x = 2*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1300
trigger1 = animelem = 4
trigger2 = animelem = 18
x = 10*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1300
trigger1 = animelem = 5
trigger2 = animelem = 6
trigger3 = animelem = 19
trigger4 = animelem = 20
x = 4*const(size.xscale)

[State 1000, ‰ą‚đ–‚炷]
type = PlaySnd
triggerall = anim = 1300
trigger1 = animelem = 8
trigger2 = animelem = 22
value = 0, 2
channel = 0

[State 1000, ‰ą‚đ–‚炷]
type = PlaySnd
triggerall = anim = 1300
trigger1 = animelem = 9
trigger2 = animelem = 23
value = 1, 0

[State 1100, HitDef]
type = HitDef
triggerall = !var(24) && !var(5)         
trigger1 = anim = 1300
trigger1 = animelem = 9
attr = S, SA
animtype = Medium   
air.animtype  = back
damage = ceil(60*fvar(25)*fvar(26)*fvar(28)*fvar(29)),ceil(3*fvar(26)*fvar(29))
priority = 5,Hit
getpower = 40,80
givepower = 60,0
hitflag = MAF
guardflag = M
pausetime = 2,6-(enemynear,statetype=A)*4
guard.pausetime = 2,6-(enemynear,statetype=A)*4
sparkno = 8210+(random%8)
guard.sparkno = S8410
sparkxy = -15, ceil(-70*const(size.yscale))
hitsound = S2,4
guardsound = S3,1
ground.type = Low
ground.slidetime = 11
ground.hittime = Ifelse(p2statetype=C,14,13)
guard.hittime = 12
guard.slidetime = 11
guard.ctrltime = 12
air.hittime  = 13
ground.velocity = -5.5*const(size.xscale)
guard.velocity = -5.5*const(size.xscale)
air.velocity = -5.0*const(size.xscale),-8.5*const(size.yscale)
fall = 0
fall.recover = 0
fall.envshake.time = 12
fall.envshake.freq = 80
fall.envshake.ampl = -4
down.bounce = 1
air.fall = 1
air.recover = 0
yaccel = .60*const(size.yscale)
envshake.time = 5
envshake.freq = 60
envshake.ampl = 3
;envshake.phase =
P2facing = 1
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
id = 1300

[State 1100, HitDef]
type = HitDef
triggerall = !var(24) && !var(5)         
trigger1 = anim = 1300
trigger1 = animelem = 23
attr = S, SA
animtype = hard   
air.animtype  = back
damage = ceil(50*fvar(25)*fvar(26)*fvar(28)*fvar(29)),ceil(3*fvar(26)*fvar(29))
priority = 5,Hit
getpower = 20,10
givepower = 0,0
hitflag = MAF
guardflag = M
pausetime = 2,4-(enemynear,statetype=A)*2
guard.pausetime = 2,4-(enemynear,statetype=A)*2
sparkno = 8210+(random%8)
guard.sparkno = S8410
sparkxy = -15, ceil(-70*const(size.yscale))
hitsound = S2,4
guardsound = S3,1
ground.type = high
ground.slidetime = 13
ground.hittime = Ifelse(p2statetype=C,19,17)
guard.hittime = 15
guard.slidetime = 13
guard.ctrltime = 15
air.hittime  = 17
ground.velocity = -5.5*const(size.xscale)
guard.velocity = -5.5*const(size.xscale)
air.velocity = -5.0*const(size.xscale),-8.5*const(size.yscale)
fall = 0
fall.recover = 0
fall.envshake.time = 12
fall.envshake.freq = 80
fall.envshake.ampl = -4
down.bounce = 1
air.fall = 1
air.recover = 0
yaccel = .60*const(size.yscale)
envshake.time = 5
envshake.freq = 60
envshake.ampl = 3
;envshake.phase =
P2facing = 1
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
id = 1301

[State -2, posadd]
type = posadd
triggerall = anim = 1301
trigger1 = animelem = 5
x = 8*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1301
trigger1 = animelem = 6
x = 7*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1301
trigger1 = animelem = 7
trigger2 = animelem = 8
x = 1*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1301
trigger1 = animelem = 10
x = 2*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1301
trigger1 = animelem = 14
x = -3*const(size.xscale)

[State -2, posadd]
type = posadd
triggerall = anim = 1301
trigger1 = animelem = 15
x = -5*const(size.xscale)

[State 1000, ‰ą‚đ–‚炷]
type = PlaySnd
trigger1 = anim = 1301
trigger1 = animelem = 8
value = 0, 2
channel = 0

[State 1000, ‰ą‚đ–‚炷]
type = PlaySnd
trigger1 = anim = 1301
trigger1 = animelem = 9
value = 1, 2

[State 1100, HitDef]
type = HitDef
triggerall = !var(24) && !var(5)         
triggerall = var(35) != 1302
trigger1 = anim = 1301
trigger1 = animelemtime(9) >= 0
trigger1 = animelemtime(10) < 0
attr = C, SA
animtype = hard   
air.animtype  = hard
damage = ceil(50*fvar(25)*fvar(26)*fvar(28)*fvar(29)),ceil(3*fvar(26)*fvar(29))
priority = 5,Hit
getpower = 20,10
givepower = 0,0
hitflag = MAF
guardflag = L
pausetime = 7,10
guard.pausetime = 7,10
sparkno = 8210+(random%8)
guard.sparkno = S8410
sparkxy = -15, ceil(-10*const(size.yscale))
hitsound = S2,5
guardsound = S3,1
ground.type = trip
ground.slidetime = 13
ground.hittime = Ifelse(p2statetype=C,19,17)
guard.hittime = 17
guard.slidetime = 13
guard.ctrltime = 17
air.hittime  = 17
ground.velocity = -5.0*const(size.xscale),-7.0*const(size.yscale)
guard.velocity = -8.0*const(size.xscale)
air.velocity = -5.0*const(size.xscale),-7.0*const(size.yscale)
fall = 1
fall.recover = 0
fall.envshake.time = 12
fall.envshake.freq = 80
fall.envshake.ampl = -4
down.bounce = 1
air.fall = 1
air.recover = 0
yaccel = 1.0*const(size.yscale)
envshake.time = 5
envshake.freq = 60
envshake.ampl = 3
;envshake.phase =
P2facing = 1
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
id = 1302

[State 200, hitspark x]
type = null ;VarSet
trigger1 = 1
var(42) = floor(ifelse(30+(abs(enemynear,Pos X-Pos X)/2)<110,30+(abs(enemynear,Pos X-Pos X)/2),110))

[State 200, hitspark y]
type = null ;VarSet
trigger1 = anim = 1300
var(43) = -70

[State 200, hitspark y]
type = null ;VarSet
trigger1 = anim = 1301
var(43) = -10

[State 200, sparkno]
type = null ;VarSet
trigger1 = anim = 1300
var(44) = 19999 ; = 8180

[State 200, sparkno]
type = null ;VarSet
trigger1 = anim = 1301
var(44) = 19999 ; = 8170

[State -2, ctrlset]
type = ctrlset
trigger1 = anim = 1300
trigger1 = animelemtime(34) >= 1
trigger2 = anim = 1301
trigger2 = animelemtime(21) >= 1
value = 1

[State 920]
type = StateTypeSet
trigger1 = anim = 1300
trigger1 = AnimElemTime(24) >= 0
trigger2 = anim = 1301
trigger2 = AnimElemTime(10) >= 0
movetype = I

[State -2, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 1301
StateType = C

[State -2, ChangeState]
type = ChangeState
trigger1 = anim = 1300
trigger1 = animtime = 0
value = 0
ctrl = 1

[State -2, ChangeState]
type = ChangeState
trigger1 = anim = 1301
trigger1 = animtime = 0
value = 11
ctrl = 1
Re: Detecting movehit.
#2  July 23, 2013, 08:40:14 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
You could always save the movecontact condition via a variable. :)

If using a movecontact control does not work, then there probably is a movehitreset controller somewhere. Either that other opponent is not in a hit state long enough to make the movecontact controller work. 

"You must defeat my flaming
dragon punch to stand a chance."
Re: Detecting movehit.
#3  July 23, 2013, 09:24:20 pm
  • ***
  • Smart Icoca wannabe!
    • Poland
    • samouczek.com/

  • Online
Why looking at -2 file I found something strange, namely this entry:

[State -2, PowerAdd]
type = PowerAdd
triggerall = movehit
trigger1 = numtarget(1300)
trigger2 = numtarget(1310)
trigger3 = numtarget(1320)
value = 90
ignorehitpause = 1

Movehit works in character -2 file, I even tried simple movehit as a trigger, but the same detection is not ok in helpe i'm using, I've tried root,movehit and parent,movehit but it simply doesn't catch.
Re: Detecting movehit.
#4  July 24, 2013, 08:54:17 am
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
Quote
[State 1000, NotHitBy]
type = NotHitBy
trigger1 = prevstateno = 40 && var(3)
trigger1 = Time = 0
value = SC, AT
time = 2
This probably doesn't do what you want. Unless you want every standing, and every crouching attack to miss, in addition to every throw.
If you want every throw that is also a standing or crouching one to miss, bad luck but HitBy and NothitBy can't do that.
The logic on hitoverride and nothitby is different, hitoverride uses AND logic, but Nothitby uses OR logic.

About the movehit problem, I would guess either this is the problem or something in the minus states. Maybe there is a movehitreset there?

Quote
[State 920]
type = StateTypeSet
trigger1 = anim = 1300
trigger1 = AnimElemTime(24) >= 0
trigger2 = anim = 1301
trigger2 = AnimElemTime(10) >= 0
movetype = I