YesNoOk
avatar

chang anim of the charged attack (Read 663 times)

Started by Dendog90, October 04, 2019, 05:49:39 pm
Share this topic:
chang anim of the charged attack
#1  October 04, 2019, 05:49:39 pm
  • avatar
  • **
    • USA
so with my charged attack, I want him to be able to go to different animations as he's charging his attack instead of pausing on the last elem, so for instance; when the charging get to his level 1, his anim change, and when it gets to level 2, it changes again.

;Charge RP
[Statedef 161]
type = s
movetype = I
physics = s
ctrl = 0
anim = 161
poweradd = 0
sprpriority = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = command = "hold_x" && animelemtime(3) >= 0
value = 161
elem = 3




;===========================================================================

[State 0, VarAdd];if button is held for 50 ticks, the value goes up by 1 and he does 3 punches
type = VarAdd
trigger1 = time = 50
v = 20
value = 1


;=========================================================================
[State 0, VarAdd];if button is held for 120 ticks, the value goes up by 2 and he does 5 punches
type = VarAdd
trigger1 = time =120
v = 20
value = 1

;==================================================================================

[State 0, ChangeState]
type = ChangeState
triggerall= var(20)=0
trigger1 = animtime=0
value =156
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall= var(20)=1
trigger1 = animtime=0
value =162
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall= var(20)=2
trigger1 = animtime=0
value =163
ctrl = 0

;-------------------------------------------------------------------------------
;3 punches
[Statedef 162]
type = s
movetype = A
physics = s
ctrl = 0
anim = 162
poweradd = -50
sprpriority = 1

[State 0, punch rip]
type = PlaySnd
trigger1 = animelem= 2
value = S0,2
volumescale = 30
channel = -1
;lowpriority = -1
freqmul = 1.0

[State 0, rocket blast]
type = PlaySnd
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
value = S2621,0
volumescale = 90
channel = -1
;lowpriority = -1
freqmul = 1.0

[State 157, Rp flash]
type = Explod
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
anim = 157
pos = -15,-15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 2
ontop = 0



[State 159, dust]
type = Explod
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
anim = 159
pos = 60,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 1
ontop = 0


[State 159, RP shockwave]
type = Explod
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
anim = 167
pos = 68,-86
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = .2,.2
sprpriority = 1
ontop = 0



[State 0, Rocket Punch]
type = Projectile
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
ProjID = 162
projanim =158
projhitanim =1
projscale = 1,1
projremove = -1
projremovetime = -1
velocity = 10,0
projhits = 1
projpriority = 3
projsprpriority = 3
offset =  115,-70
postype = p1         ;p2,front,back,left,right
attr = S, sp                   ;Attribute: Standing, Normal Attack
damage = 28, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = s160
sparkxy = 0,-3                     
hitsound = s3100,0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 15
envshake.time =10
envshake.freq =40
envshake.ampl= 10

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime =0
value =0
ctrl = 1






;-------------------------------------------------------------------------------
;5 punches
[Statedef 163]
type = s
movetype = A
physics = s
ctrl = 0
anim = 163
poweradd = -100
sprpriority = 0

[State 0, punch rip]
type = PlaySnd
trigger1 = animelem= 2
value = S0,2
volumescale = 30
channel = -1
;lowpriority = -1
freqmul = 1.0

[State 0, rocket blast]
type = PlaySnd
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
trigger4= animelem = 11
trigger5= animelem = 13

value = S2621,0
volumescale = 90
channel = -1
;lowpriority = -1
freqmul = 1.0

[State 157, Rp flash]
type = Explod
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
trigger4= animelem = 11
trigger5= animelem = 13
anim = 157
pos = -15,-15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 2
ontop = 0



[State 159, dust]
type = Explod
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
trigger4= animelem = 11
trigger5= animelem = 13
anim = 159
pos = 60,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 1
ontop = 0

[State 159, RP shockwave]
type = Explod
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
trigger4= animelem = 11
trigger5= animelem = 13
anim = 167
pos = 68,-86
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = .2,.2
sprpriority = 1
ontop = 0

[State 0, Rocket Punch]
type = Projectile
trigger1 =animelem = 5
trigger2 = animelem = 7
trigger3= animelem = 9
trigger4= animelem = 11
trigger5= animelem = 13
ProjID = 163
projanim =158
projhitanim =1
projscale = 1,1
projremove = -1
projremovetime = -1
velocity = 10,0
projhits = 1
projpriority = 3
projsprpriority = 3
offset =  115,-70
postype = p1         ;p2,front,back,left,right
attr = S, sp                   ;Attribute: Standing, Normal Attack
damage = 28, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = s160
sparkxy = 0,-3                     
hitsound = s3100,0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 15
envshake.time =10
envshake.freq =40
envshake.ampl= 10

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime =0
value =0
ctrl = 1


and also how do I code a loop frame? please and thank you
Re: chang anim of the charged attack
#2  October 05, 2019, 04:57:23 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You have the variable. Use that to assist in changing the animation. Loop frames are in the air file. Iirc click the checkbox to loop it. Or edit in text and add this line

Loopstart

Before the frames you want to loop


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.
Re: chang anim of the charged attack
#3  October 05, 2019, 07:14:05 am
  • avatar
  • **
    • USA
Thanks again Cyanide