Bounce up from fall.

Started by I_Cry, December 31, 2012, 08:44:00 PM

Previous topic - Next topic

I_Cry

Hi, I'm not a good coder and not yet fully understand everything about coding. As i'm trying different things to become somewhat better at it I've encountered a problem.
The point of my move is when I hit the enemy in the air. he falls to the ground and bounces upwards.

However when I do this the enemy whom I hit falls (i think he hits the ground) but then dissapears (no anim?) I can however kick him out of the air he's stuck in with a special moveor hyper.

I would like a bit of assistance.

this is the custom bounce code implemented:

; Downward Smash
[Statedef 4700]
type = A
movetype = H
physics = N
velset = 0,0;-4,8
facep2=1

[State 4700, Wid]
type = Width
trigger1 = 1
edge = 25,-25

[State 4700, Vels]
type = VelSet
trigger1 = !Time
trigger1 = PrevStateNo != 4701
x = -2
y = 8
[State 4700, Vels]
type = VelSet
trigger1 = !Time
trigger1 = PrevStateNo = 4701
x = -1
y = 8

[State 4700, Gethit]
type = ChangeAnim
trigger1 = !Time
value = 5050

[State 4700, Bounce]
type = ChangeState
trigger1 = Pos Y >= -8.1
value = 4701
[State 4701, Land]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 4701
;---------------------------------------------------------------------------
; Bouncing Upward
[Statedef 4701]
type = A
movetype = H
physics = N
velset = 0,0
facep2=1
[State 4701, HitGround]
type = PosSet
trigger1 = !Time
y = 0
[State 0, 1]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)
[State 0, 2]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14
[State 0, EnvShake]
type = EnvShake
trigger1 =time=0
time=15
ampl=6
[State 4701, BounceGround]
type = ChangeAnim2
trigger1 = !Time
value = 4700
[State 4701, BounceUp]
type = VelSet
trigger1 = Anim = 4700 && AnimElemNo(0) = 2
x = -3
y = -8

[State 4701, FallAgain]
type = VelAdd
trigger1 = Anim = 4700 && AnimElemNo(0) >= 2
y = .4
persistent = 1

[State 4701, Land]
type = SelfState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 5100


This is the Hitdef from the move if needed:

[State 1305, Hit]
type=hitdef
trigger1= animelem=2 && var(31)>=3
attr=A,SA
damage=ifelse(var(10)=3,40,ifelse(var(10)=2,35,30)),5
animtype=Hard
guardflag=HA
hitflag=MAF
priority=4,Hit
pausetime= ifelse(var(20),6,12), ifelse(var(20),6,12)
sparkno=s7020+(random%8)
guard.sparkno=s7001
sparkxy=-10,-64
hitsound=s2,3
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-8,10
air.type=High
air.velocity=-8,10
ground.cornerpush.veloff = 0
guard.velocity= -10.65
guard.cornerpush.veloff = 0;-5.2
fall=1
fall.recover=0;0
getpower= ifelse(p2movetype=H,72,144)*!var(20), 36*!var(20)
givepower=36,36
envshake.time=12
envshake.freq=120
envshake.ampl=4
yaccel=.6
airguard.ctrltime= 16
airguard.velocity= ifelse(var(20),-4,-8), -1.5
airguard.cornerpush.veloff = 0
p2stateno = 4700



Cyanide

Bit of mugen stupidity here

velset = 0,0 won't be doing what you want or expect.

[State 4701, Land]
type = SelfState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 5100

Is actually taking effect as at that first tick you're moving down still, and your pos Y is 0 or greater. Add the animelemtime(2) > 0 line to that selfstate and see how it goes.


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.

I_Cry

I tried adding the that to the selfstate  but still no succes though.

Cyanide

Perhaps you need to check anim 4700. If you have any frames with a time of 0 they break the whole animation.


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.

I_Cry

#4
Quote from: Cyanide on January 01, 2013, 12:43:20 AM
Perhaps you need to check anim 4700. If you have any frames with a time of 0 they break the whole animation.

I just checked my animation and didn't find a single frame with a 0 timeframe. Even tried duplicating anims with a clean state to try again and same result.

Edit: I've edited it the anim to 5080 and now the enemy flies through the floor and then arcs infinitly upwards. 

Edit2: I've got it mostly working, but when the opponement enter fall state after being hit, he 'blinks' for a nanosecond as if an anim was missing.



Cyanide

Show us the text for anim 4700?


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.