Wall hit error

Started by Sol Knight X, January 13, 2016, 06:08:20 AM

Previous topic - Next topic

Sol Knight X

So I tried coding this move on my current W.I.P where after the last hit of a specific move connects, the opponent gets kicked straight to the wall then slides down. when the entire move connects, the move works just fine. However, if the first part misses, this happens.



I have it arranged so that in the hitdef for the second hit of the attack, player 2 goes into a custom state. While he does go into that custom state, the changestate that comes after never triggers, and I cant for the life of me figure out why.

Here's the code if anything.

Spoiler (click to show)
;---------------------------------------------------------------------------
; Burning Strike P2 State
[Statedef 1380]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 2

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time
value = 1380

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = 0
y = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 1
x = -12
y = 0
;ignorehitpause =
;persistent =

[State 0, poopy]
type = ChangeState
triggerall = Pos y < 0
trigger1 = BackEdgeBodyDist <= 0
trigger2 = FrontEdgeBodyDist <= 0
value = 1385

;-------------------------------
;Burning Strike Wall Bounce
;
[Statedef 1385]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1385

[State 1027, State]
type = SelfState
trigger1 = AnimTime = 20
value = 5000
If anymore information is required, I'll do my best to provide. This is the first time i've really come to the guild for development help. ;-;

Cyanide

animtime = 20 is true 20 ticks before the end of the animation. If it's not 20 ticks long, minimum, it will never be triggered.

Either use time = 20 for an actual delay, or more normally, animtime = 0 which is the end of an 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.

altoiddealer

I thought animtime counted up as a negative value?

animtime = -20
Anim ends in 20 ticks


Felkazz

It is as altoiddealer said.
AnimTime = 20 will never trigger.

Sol Knight X

#4
Changing animtime to 0 made the problem happen whether both hits connected or not. I mamaged to make a gif of the specific results with the original code to clarify what the issue is.
When both hits connect:


When first hit misses:


Edit: Here's an imgur link to the 2 gifs in case they aren't loading for anyone.
http://imgur.com/a/UNFkt

Felkazz

The gif won't load here...

Sol Knight X

Added to previous post. Imgur link has both gifs that were posted.

Cyanide

Debug is always useful. Turn it on. Which state is he stuck in. Looking at the gif where the second kick connects by itself he is stuck in state 1380 and never getting to the second one.

You may want to loosen up the triggers, say, backedgebodydist < 10 or something.


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.

ESFAndy011

Looking at the two gifs, I think I know what your problem is.

[State 0, poopy]
type = ChangeState
triggerall = Pos y < 0
trigger1 = BackEdgeBodyDist <= 0
trigger2 = FrontEdgeBodyDist <= 0
value = 1385

The thing is, whenever you hit a standing opponent with the second kick, he is keeping his pos y at 0, and 1385 never triggers as a result. Change that triggerall to "Pos y <= 0". In fact, you might even remove it altogether, because I personally don't see a point to it.

I will agree with this, though:

Quote from: Cyanide on January 14, 2016, 10:04:19 AM
You may want to loosen up the triggers, say, backedgebodydist < 10 or something.
Quote from: Millie, &quot;Ozy and Millie&quot;"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."