News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Hold button to keep attack going (Solved)

Started by SamuraiSon, July 11, 2010, 12:59:33 AM

Previous topic - Next topic

SamuraiSon

I have an attack where you input the command and as long as you hold the button down,
the attack should keep going. If you release the button as soon as the attack starts, it
works fine. The problem is with holding the button down.... the animation shows for the
animation time then dissapears. When you let the button goes, the end animation appears.

Code appears below. My motivation for finshing ended with this roadblock. Thanks!

Spoiler (click to show)
; Wave Burner (Start)
[Statedef 3231]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 1240
poweradd = 10

[State 3231, 7]
type = ChangeState
trigger1 = command != "hold_c"
value = 3232

[State 3231, 7]
type = ChangeState
trigger1 = command = "hold_c"
trigger1 = AnimTime = 0
value = 3233

;----------------
; Wave Burner (Release C)
[StateDef 3232]
type = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
ctrl = 0
anim = 3237
poweradd = 20

[State 3232, 1]
type = Projectile
trigger1 = (AnimElem = 1)
projanim = 3232
projhitanim = 3232
projremovetime = 14
projpriority = 7
projscale = .7, .6
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 23,-45
velocity = 0
attr = S, SP
damage   = 33, 20
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,7
hitsound   = 5,2
;sparkxy = -1, 5
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 3232, 2]
type = playsnd
trigger1 = animelem = 1
value = s100, 0
volume = 100

[State 3232, 3]
type = explod
trigger1 = projhit = 1
anim = 1092
ID = 1092
bindtime = -1
postype = p2
pos = -35, -100
sprpriority = 1

[State 3232, Width]
type = Width
trigger1 = AnimElemTime(1)
value = 30

[State 3232, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;----------------
; Wave Burner (Hold C)
[StateDef 3233]
type = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
ctrl = 0
anim = 3233
poweradd = 20

[State 3233, 1]
type = Projectile
trigger1 = (AnimElem = 1)
trigger1 = command = "hold_c"
projanim = 3234
projhitanim = 3234
;projremanim = 3235
;projremovetime = stateno != 3239
projremovetime = 0
projpriority = 7
projscale = .7, .6
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 23,-45
velocity = 0
attr = S, SP
damage   = 33, 20
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,7
hitsound   = 5,2
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 3233, 2]
type = playsnd
trigger1 = animelem = 1
value = s100, 0
volume = 100

[State 3233, 3]
type = explod
trigger1 = projhit = 1
anim = 1092
ID = 1092
bindtime = -1
postype = p2
pos = -35, -100
sprpriority = 1

[State 3233, Width]
type = Width
trigger1 = AnimElemTime(3)
value = 30

;[State 3233, Check1]
;type = ChangeState
;trigger1 = command = "hold_c"
;value = 3233
;ctrl = 1

[State 3233, Check2]
type = ChangeState
trigger1 = command != "hold_c"
value = 3239
ctrl = 1

;-------------------------------------
; Wave Burner (End)
[StateDef 3239]
type = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
ctrl = 0
anim = 3239
poweradd = 10

[State 3239, 1]
type = Projectile
trigger1 = (AnimElem = 1)
projanim = 3235
projhitanim = 3235
projremovetime = 10
projpriority = 7
projscale = .7, .6
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 23,-45
velocity = 0
attr = S, SP
damage   = 33, 20
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,7
hitsound   = 5,2
;sparkxy = -1, 5
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 3239, 3]
type = explod
trigger1 = projhit = 1
anim = 1092
ID = 1092
bindtime = -1
postype = p2
pos = -35, -100
sprpriority = 1

[State 3239, Width]
type = Width
trigger1 = AnimElemTime(1)
value = 30

[State 3239, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Cyanide

Lemme guess

Does the attack once whether it is held down or not then fails to do any more projectiles? Your code is basically right, but animelem is a bad trigger for this.

Try animelemtime(1) = 0

instead.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

SamuraiSon

The attack is supposed to be a flamethrower effect in that the enemy can keep getting
hit by it until the user lets go of the button. I'll probably do a push effect to keep the
opponent from getting stuck in the flamethrower.

SamuraiSon

Problem solved. Instead of trying to control the flame seperately as a projectile, I combined both the flame
and the shooting animation into one. Now you just hold the button until the user get tired of using the
flamethrower or gets hit. 

Spoiler (click to show)
;----------------------------------------------------------------------------
; Wave Burner (Start)
[Statedef 3231]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 1240
poweradd = 10

[State 3231, 7]
type = ChangeState
trigger1 = command != "hold_c"
value = 3232

[State 3231, 7]
type = ChangeState
trigger1 = command = "hold_c"
trigger1 = AnimTime = 0
value = 3233

;----------------
; Wave Burner (Release C)
[StateDef 3232]
type = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
ctrl = 0
anim = 3237
poweradd = 20

[State 3232, 1]
type = Projectile
trigger1 = AnimElemTime(1) = 0
projanim = 3232
projhitanim = 3232
projremovetime = 14
projpriority = 7
projscale = .7, .6
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 23,-45
velocity = 0
attr = S, SP
damage   = 33, 20
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,7
hitsound   = 5,2
sparkxy = -100000, 50000
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 3232, 2]
type = playsnd
trigger1 = animelem = 1
value = s100, 0
volume = 100

[State 3232, 3]
type = explod
trigger1 = projhit = 1
anim = 1092
ID = 1092
bindtime = -1
postype = p2
pos = -35, -100
sprpriority = 1

[State 3232, Width]
type = Width
trigger1 = AnimElemTime(1)
value = 30

[State 3232, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;----------------
; Wave Burner (Hold C)
[StateDef 3233]
type = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
ctrl = 0
anim = 3233
poweradd = 20

[State 3233, 1]
type = HitDef
trigger1 = (AnimElem = 1) || (AnimElem = 2) || (AnimElem = 3)
trigger2 = (AnimElem = 4) || (AnimElem = 5) || (AnimElem = 6)
trigger3 = (AnimElem = 7) || (AnimElem = 8) || (AnimElem = 9)
attr = A, SA
animtype  = Heavy
damage    = 10,30
guardflag = M
hitflag = MAF
pausetime = 4,4
sparkxy = -1000,-6000
priority = 7, Hit
hitsound = S20,2
guardsound = S20,6
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2.5
air.velocity = -2.5, -7
fall = 1
air.fall = 1
[State 3233, 2]
type = playsnd
trigger1 = animelem = 1
value = s100, 0
volume = 100

[State 3233, 3]
type = explod
trigger1 = projhit = 1
anim = 1092
ID = 1092
bindtime = -1
postype = p2
pos = -35, -100
sprpriority = 1

[State 3233, Width]
type = Width
trigger1 = AnimElemTime(3)
value = 30

[State 3233, Check2]
type = ChangeState
trigger1 = command != "hold_c"
value = 3239
ctrl = 1

;-------------------------------------
; Wave Burner (End)
[StateDef 3239]
type = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
ctrl = 0
anim = 3239
poweradd = 10

[State 3239, 1]
type = Projectile
trigger1 = (AnimElem = 1)
projanim = 3235
projhitanim = 3235
projremovetime = 10
projpriority = 7
projscale = .7, .6
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 23,-45
velocity = 0
attr = S, SP
damage   = 33, 20
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,7
hitsound   = 5,2
;sparkxy = -1, 5
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 3239, 3]
type = explod
trigger1 = projhit = 1
anim = 1092
ID = 1092
bindtime = -1
postype = p2
pos = -35, -100
sprpriority = 1

[State 3239, Width]
type = Width
trigger1 = AnimElemTime(1)
value = 30

[State 3239, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Average Mugen Guild Poster

Shouldn't you put a timer on that too? Just in case.

fucking bad poster asshole that home32 bitch

SamuraiSon

I like just in case stuff. I, more or less, wanted to get the bare bones done because I still gotta
go back and change damage, change the triggers around to not allow for infintes, and other
things like that.

I'll check into using a timer. Thanks for the feedback.