Multihit code error

Started by testament, October 12, 2015, 01:34:45 AM

Previous topic - Next topic

testament

I searched but not found, how create multi hits attack in FF3?

[Statedef 11002]
type    = A
movetype= A
physics = N
poweradd= 0
anim = 1040
ctrl = 0

[State 11002, width]
type = Width
trigger1 = anim = 1041 && animelem = 2
trigger2 = anim = 1041 && time >=4
player = 10, 0

[State 11002, Anim]
type=changeanim
trigger1= anim=1040 && !animtime
value=1041

[State 11002, statetype]
type=statetypeset
trigger1= anim=1040 || anim=1045
statetype=A
physics=A

[State 11002, statetype]
type=statetypeset
trigger1= anim=1041
statetype=A
physics=N

[State ]
type = VelSet
trigger1 = !Time
x = 9
y = -2

[State ]
type = Veladd
trigger1 = Time >= 18
y = .5

[State ]
type = Veladd
trigger1 = Time >= 0
trigger1 = FrontEdgeBodyDist = 0
y = .7

[State 11002, Vel]
type=velset
trigger1= anim=1040 && animelem=1
x=10.5
y=-6

[State 11002, Vel]
type=velset
trigger1= anim=1041
x=13
;y=0

[State 11002]
type = VelAdd
trigger1 = anim=1041
y = .5

[State 11002, Anim]
type=changeanim
trigger1= anim=1041 && animelemtime(1)>=15
value=1045
persistent=0

[State 11002, Anim]
type=changeanim
trigger1= anim=1041 && !animtime
value=1045
persistent=0

[State 11002, Hit]
type=hitdef
trigger1= anim=1041 && animelem=1
trigger2 = AnimElem = 1
trigger3 = anim=1041 && AnimElem = 1
trigger4 = anim=1041 && AnimElem = 1
attr=S,SA
damage = 60,10
animtype= medium
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime= 4,4
sparkNo = s8200
guard.sparkNo = s8100
sparkXY = -10 + 0 * (var(35) := 80), var(36) := -70
hitsound = s1,6
guardsound = s1,0
ground.type= low
ground.slidetime=16
ground.hittime=16
ground.velocity=-5,-3
air.type=Low
air.velocity=-5,-3
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
guard.velocity= -10.52
guard.cornerpush.veloff = 0
getpower= 72,36
givepower=36,36
envshake.time=8
envshake.freq=60
envshake.ampl=2
fall=1
fall.recovertime=18
fall.animtype=Medium
yaccel=.5
airguard.ctrltime= 16
airguard.velocity= -4,-1.5
forcestand=1
airguard.cornerpush.veloff = 0
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him

[State voz]
type = PlaySnd
trigger1 = !time
value = s0,5
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = s0,11

[State 11002]
type = statetypeset
trigger1 = anim = 1045
movetype = I

[State 1000, spark]
type = explod
trigger1 = animelem = 2
anim = 1046
id = 1046
pos = 60,-70
bindtime = -1
sprpriority = 7
trans = add
scale = 1,1
;pausemovetime=60

[State 11002, ChangeState]
type = ChangeState
trigger1 = movecontact
value = 1045
ctrl = 0

;--------------------------------------------------------------------
[StateDef 1045]
type = A
movetype= A
physics = A
juggle  = 0
velset = 0,0
anim = 43
ctrl = 0
sprpriority = 1

[State 1045, Velset]
type = VelSet
trigger1 = 1
x = -2.5

[State 1045, VelAdd]
type = VelAdd
trigger1 = animelem = 1
y = -4

[State 1045]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim+3)
persistent = 0
value = Anim+3
;---------------------------------------------------------------------------
My site
www.sites.google.com/view/mugenmultiverse
My Youtube Channel
www.youtube.com/channel/UCIHXYj0jW24N5cnuotDqpKw

Noctis

Remove all 4 triggers from your hitdef and make it just 1 trigger like so.
trigger1 = anim = 1041 && animelemtime(1) >= 0 && animelemtime(2) < 0
This means it will attack for every tick in the first frame of your animation 1041. It's the best result you can get for multihits as you can't have a single hitdef hit multiple times at the exact same time.

Alternatively, you could add a numhits = to the hitdef. Remove all 4 triggers, make it trigger1 = anim = 1041 && animelem = 1. Then below it, add
numhits = 10
This means it'll hit once, but be read as 10 times.

The last option would be to remove all 4 triggers, make it trigger1 = anim = 1041 && animelem = 1 and then copy/paste the entire hitdef multiple times. I've never done it this way but it should work.

Take your pick.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

testament

#2
Thanks.
I put this:
trigger1 = anim = 1041 && animelemtime(1) >= 0 && animelemtime(2) < 0
But don't work. p2 isn't hit, it becomes a null hit
My code

type=hitdef
trigger1 = anim = 1041 && animelemtime(1) >= 0 && animelemtime(2) < 0
attr=A,HA
damage = 90,40
animtype=Hard
guardflag=MA
hitflag=MAF
priority=7,Hit
pausetime= 4,4
sparkNo = s8200
guard.sparkNo = s8100
sparkXY = -10 + 0 * (var(35) := 80), var(36) := -70
hitsound = s1,6
guardsound = s1,0
ground.type=low
ground.slidetime=16
ground.hittime=16
ground.velocity=-10,-5
air.type=Low
air.velocity=-9,-4
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
guard.velocity= -10.52
guard.cornerpush.veloff = 0
getpower= 72,36
givepower=36,36
envshake.time=8
envshake.freq=60
envshake.ampl=2
fall=1
fall.recovertime=18
fall.animtype=Medium
yaccel=.5
airguard.ctrltime= 16
airguard.velocity= -4,-1.5
forcestand=1
airguard.cornerpush.veloff = 0
P2StateNo = 12000
palfx.time = 85
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,10
Palfx.color = 0
palfx.invertall = 1


i copy/paste the entire hitdef multiple times, but still the same
My entire code:
Spoiler (click to show)
;fliyng kick
[Statedef 11002]
type    = A
movetype= A
physics = N
poweradd= 0
anim = 1040
ctrl = 0

[State 11002, SuperPause]
type = SuperPause
trigger1 = animelem = 1
time = 51
anim = -1
sound = s200,0
pos = 0,0
darken = 1
p2defmul = 0
poweradd = 0
unhittable = 1


[State 11002, width]
type = Width
trigger1 = anim = 1041 && animelem = 2
trigger2 = anim = 1041 && time >=4
player = 10, 0

[State 11002, Anim]
type=changeanim
trigger1= anim=1040 && !animtime
value=1041

[State 11002, statetype]
type=statetypeset
trigger1= anim=1040 || anim=1045
statetype=A
physics=A


[State 11002, statetype]
type=statetypeset
trigger1= anim=1041
statetype=A
physics=N



[State ]
type = VelSet
trigger1 = !Time
x = 9
y = -2

[State ]
type = Veladd
trigger1 = Time >= 18
y = .5

[State ]
type = Veladd
trigger1 = Time >= 0
trigger1 = FrontEdgeBodyDist = 0
y = .7

[State 11002, Vel]
type=velset
trigger1= anim=1040 && animelem=1
x=10.5
y=-6

[State 11002, Vel]
type=velset
trigger1= anim=1041
x=13
;y=0

[State 11002]
type = VelAdd
trigger1 = anim=1041
y = .5

[State 11002, Anim]
type=changeanim
trigger1= anim=1041 && animelemtime(1)>=15
value=1045
persistent=0

[State 11002, Anim]
type=changeanim
trigger1= anim=1041 && !animtime
value=1045
persistent=0

[State 11002, Hit]
type=hitdef
trigger1 = anim = 1041 && animelemtime(1) >= 0 && animelemtime(2) < 0
attr=A,SA
damage = 90,40
animtype=Hard
guardflag=MA
hitflag=MAF
priority=7,Hit
pausetime= 4,4
sparkNo = s8200
guard.sparkNo = s8100
sparkXY = -10 + 0 * (var(35) := 80), var(36) := -70
hitsound = s1,6
guardsound = s1,0
ground.type=low
ground.slidetime=16
ground.hittime=16
ground.velocity=-10,-5
air.type=Low
air.velocity=-9,-4
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
guard.velocity= -10.52
guard.cornerpush.veloff = 0
getpower= 72,36
givepower=36,36
envshake.time=8
envshake.freq=60
envshake.ampl=2
fall=1
fall.recovertime=18
fall.animtype=Medium
yaccel=.5
airguard.ctrltime= 16
airguard.velocity= -4,-1.5
forcestand=1
airguard.cornerpush.veloff = 0
P2StateNo = 12000
palfx.time = 85
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,10
Palfx.color = 0
palfx.invertall = 1



[State 11002, Explod]
type = Explod
trigger1 = Time = 0     ;    50   
anim = 13000
pos = 6,-12
postype = p1
supermove = 1
supermovetime = 9999
pausemovetime = 9999

[State voz]
type = PlaySnd
trigger1 = !time
value = s0,5
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = s0,11

[State 1040]
type = statetypeset
trigger1 = anim = 1045
movetype = I

[State 1000, spark]
type = explod
trigger1 = animelem = 2
anim = 1046
id = 1046
pos = 60,-70
bindtime = -1
sprpriority = 7
trans = add
scale = 3,1.5
;pausemovetime=60

[state AfterImageTime]
type = AfterImageTime
trigger1 = 1
time = 2
ignorehitpause = 1

[state Afterimage]
type = Afterimage
trigger1 = !time
time = 2
length = 7
PalBright = 0,0,-50
PalContrast = 145,145,145
PalAdd = 5,-10,-30
PalMul = .9,.9,.9
FrameGap = 1
Palcolor = 0
sprpriority = 5
Trans = Add
ownpal = 1
ontop = 1
ignorehitpause = 1

[State 11002, ChangeState]
type = ChangeState
trigger1 = movecontact
value = 11003
ctrl = 0

;--------------------------------------------------------------------
[StateDef 11003]
type = A
movetype= A
physics = A
juggle  = 0
velset = 0,0
anim = 43
ctrl = 0
sprpriority = 1

[State 11003, Velset]
type = VelSet
trigger1 = 1
x = -2.5

[State 11003, VelAdd]
type = VelAdd
trigger1 = animelem = 1
y = -5

[State 11003]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim+3)
persistent = 0
value = Anim+3


;---------------------------------------------------------------------------
My site
www.sites.google.com/view/mugenmultiverse
My Youtube Channel
www.youtube.com/channel/UCIHXYj0jW24N5cnuotDqpKw

Noctis

That doesn't make sense that it stopped being able to hit. Just change the trigger to trigger1 = anim = 1041 and it'll hit the entire time you're in that anim until you go into anim 1045. Or rather it should.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

Zyriliss

#4
Trigger = Time%(put number here)

This should make it hit multiple times over a single active hitdef..  Just play with the number to figure out how fast you want it to happen.

(Edit: Unless you wanted one hit to be apply as more.. then what Noctis said with numhit will do it.)

trigger1 = anim = 1041 && animelemtime(1) >= 0 && animelemtime(2) < 0

This would mean both of those triggers would need to be true to be active..  As they're both different animelements.. this cannot be so.  It could work.. but you'd need to split it up more than that.
Delving within the depths of a castle full of evil.. or at least lost or even trapped within one.. That's where you'll find me.

testament

Thanks.
I put " trigger1= time%(0.5) " and this error happens:
Library error message:
Data: 0,0.500000,27,
Types: trig,float,oper,
If i put trigger1=time%(1)  dont hit.
If i put trigger1= time%(2) or (50) or (any number), hit one time.

My site
www.sites.google.com/view/mugenmultiverse
My Youtube Channel
www.youtube.com/channel/UCIHXYj0jW24N5cnuotDqpKw

Rent

modulus can only be used with whole numbers, you need to make it a condition:
time%4 = 0
wat.

Noctis

#7
There's nothing wrong with what I said. It means it will be active during that time i.e during every single tick of said frame. That's why it's a (2) < 0. Even if it was an (2) <= 0 it would still work. Something else is interfering.

Time% would work here as well. I forgot about that one because I don't like using it for hitdefs. It's difficult to predict and it never hits the first tick so you'd need additional triggers just for that.

However, a Time%1=0 would work. It would hit every single tick a hitbox is active and movetype is = to A. Time%2=0 would hit every 2 ticks excluding the first 2 ticks and so on.

Time% does not use decimals either. Time is counted in whole numbers, not decimals so this will break. You could probably floor or ceil it, but that would literally be pointless.

Edit:
Are you sure you're not changing anims from 1041 to 1045 too soon? Is your hitbox set on the correct frames?

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

altoiddealer

#8
Ignore ignore ignore


Noctis

#9
Something wrong, Altoid?

Anyways, I failed to notice this because I got confused by another topic with a similar problem. Show us your state 12000.

Edit:
Wtf your state really does only hit once. I don't see anything different from any other hitdef. I added an ignorehitpause like I assume Altoid was hinting, but that's broken obviously because it'll force you into an infinite loop of attacks without advancing even a single tick. Dafuq's going on here. Trial and error it. Remove everything like p2stateno, fall, forcestand, velocities, etc. until it's down to the bare minimum and see if it hits multiple times, if it does, start adding things back until the error occurs again and you've found your problem.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

Zyriliss

#10
This topic still has an "unsolved" icon on it.. so I'm assuming the problem is still going.. So.. second look..

There is a lot going on in this code and not all of it is in order.. and it makes it tough to figure out.. but I think I see what it is..


[State 11002, ChangeState]
type = ChangeState
trigger1 = movecontact
value = 1045
ctrl = 0


This..  You hit them once blocked or not.. then it shifts to it's end..

Edit:   As you do have a lot going on.. it may be a good idea to cut anim 1040 and anim 1041 into separate states so that you get the amount of control that you need for something.. that.. well.. looks as complex as this..
Delving within the depths of a castle full of evil.. or at least lost or even trapped within one.. That's where you'll find me.

Noctis

It's not complex it's just messy, but also you're right about the changestate. I overlooked it because it was so messy I had a hard time seeing what was going wrong.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

testament

Thanks amigo.
I was trying, but gave up ...
I put new code, and now is working:
[State 11400, HitDef]
type = HitDef
trigger1 = AnimElem = 6,3
trigger2 = AnimElem = 6,6
trigger3 = AnimElem = 6,9
trigger4 = AnimElem = 7,3
trigger5 = AnimElem = 7,6
attr = A, SA
animtype = Hard
damage = 15, 6
guardflag = MA
hitflag = MAF
pausetime = 5, 5
sparkno = s30002
guard.sparkno = S6011
sparkxy = -20, -65
hitsound = S4, 3
guardsound = S2,0
ground.type = High
guard.slidetime = 6
ground.hittime  = 15
ground.velocity = -4, -4.5
air.velocity = -4, -4.5
fall = 1
fall.recover = 0
envshake.time = 12
envshake.ampl = 6; or 7
fall.envshake.time = 5
fall.envshake.ampl = 8
My site
www.sites.google.com/view/mugenmultiverse
My Youtube Channel
www.youtube.com/channel/UCIHXYj0jW24N5cnuotDqpKw

Noctis

What we said should work fine with that hitdef, too. You don't need to use animelem's, but yeah I tried your hitdef from earlier and for whatever reason I could only get it to hit once. Idk what was wrong with it. You could've just trial and error'd it, but whatever. Glad you got it working! Make sure to "solve" your own topics from now on when you're done with them.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."