A problem with hyper attack (again)

Started by Synck, December 29, 2015, 11:05:52 PM

Previous topic - Next topic

Synck

This is the old topic where I talked about hyper attack's problem:
http://mugenguild.com/forum/topics/problem-hyper-attack-170787.0.html

Now I have a problems with the stages:
(P.S my friend sent me this, he's testing her nowadays)
She's totally stuck in this stage.

Also my friend told me that my character totally disappears in few stages (and she never comes back), but she works great only in few stages (like stage_0 and kfm stage).

What I'm supposed to do?

@[user id=81778]altoiddealer[/user]: I'm sorry for calling you but you're the one who gave me the code. Would you help me again?

altoiddealer

Please post the code, and I coulld probably point out the issue.


Synck

Here you go


;BLAST!
[Statedef 3022]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 3009
ctrl = 0
sprpriority = 2

[State 0, Hair]
type = helper
trigger1 = !numhelper(3024)
name = "Hair"
ID = 3024
stateno = 3024
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = screenbound
trigger1 = 1
value = 0

[state 1000]
type = playsnd
trigger1 = time = 0
value = S999,0

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = playerPush
trigger1 = 1
value = 0

[state 1000]
type = envcolor
;trigger1 = anim = 3009 && hitcount < 10
trigger1 = movehit && hitcount <= 9
value = 255,255,255
time = 1
ignorehitpause = 0

[State 3050, hitvar]
type=varset
trigger1 = anim!=3009
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 3050, hitvar]
type=varadd
trigger1=anim=3009&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=1

[State 3050, hit]
type=hitdef
trigger1=anim=3009 && animelemtime(15)>=0
trigger1= timemod = 2,0 && var(14)<10
attr = A, HA
damage = 45,8
animtype = heavy;fucking metal
guardflag = MAF
hitflag = MAF
getpower = 0
priority = 4, Hit
pausetime = 5, 0
sparkno = 3
sparkxy = -8, -35
hitsound = 5, 4
guardsound = S6, 0
guard.sparkno = 40
ground.type = High
guard.velocity = -5
airguard.velocity = 0,-1
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.5,-1.5
air.type = high
air.velocity = -2.5,-1.5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
envshake.time = 16
envshake.freq = 60
envshake.ampl = 8

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 1 && Time < 60
time = 2

[state 1000]
type = explod
trigger1 = time = 0
anim = 3015
pos = 30,-32
postype = p1
removeongethit = 1
removetime = -1
bindtime = -1
under = 1
scale = 0.50,0.50
ID = 3022
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = 1
x = 20
y = 0

[state 1000]
type = changestate
trigger1 = abs(Pos x) > (Gamewidth/2) + 550
value = 3023

;State over
[Statedef 3023]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 45
ctrl = 0
sprpriority = 2

[state 1000]
type = removeexplod
trigger1 = time = 0
ID = 1588

[state 1000]
type = removeexplod
trigger1 = time = 0
ID = 3022

[state 1000]
type = screenbound
trigger1 = 1
value = 0

[State 4002, pos]
type = posset
trigger1 = time = 0
x = ifelse (pos x > 0, - ((gamewidth/2)+30), ((gamewidth/2) + 30))
y =-150

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = velset
trigger1 = time = 0
x = 3.5

[state 1000]
type = changestate
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1


altoiddealer

#3
To figure this one out, the first step is to root out everything that is definitely NOT causing the problem.

Since there is nothing to slow down the character in the first state from the Vel X of 20, and since she surely reaches that distance from the center of the screen, there is nothing in the first state that can be causing the issue.  She will definitely trigger the ChangeState and go into the second state.

So focusing on the second state...

Well, that very last ChangeState is probably causing the issue in some way.  Have you looked in debug to see what state she gets frozen in?

Try adding trigger1 = Time > 10 to that last controller.

You also might need to Floor the PosSet value.
Try:

[State 4002, pos]
type = posset
trigger1 = time = 0
x = Floor(ifelse (pos x > 0, - ((gamewidth/2)+30), ((gamewidth/2) + 30)))
y =-150


It also couldn't hurt to keep that Vel X triggered.  I'm not sure exactly what conditions cause it, but sometimes VelSet only applies while being triggered (probably not in this case).

So it couldn't hurt to try changing that to:

[state 1000]
type = velset
trigger1 = 1
x = 3.5


LASTLY - For moves like this, it is always safe to use AssertSpecial controller with the flag NoAutoTurn.  I recommend adding that in both states.


Odb718

#4
Turn on Debug!
But I'm pretty sure...
[state 1000]
type = changestate
trigger1 = abs(Pos x) > (Gamewidth/2) + 550
value = 3023
Is going to be the issue. You're probably on 1.1. Some of the stages wont be the same resolution.
If I'm right in thinking you want the character to be out of the screen there before switching, you might be able to get away with,

trigger1 = abs(Pos x) > floor(Gamewidth + 150) ;floor is there just in case it would kick an error for some reason.
You should always have a timer back up on complex ultra's changestates. Just in case those super random happenings where P4 hits your character or something funky happens.

----
Use debug, and watch your Pos X value. You'll see if it's getting stuck at "550" or not.
Also, when I was coding my Felicia, I made an ultra where she shoots out the sand. I had multiple copies of the sand and I was moving them out of frame. Once I went too far right Mugen couldnt control them. So,
trigger1 = abs(Pos x) > floor(Gamewidth/2 + 150) mixed with a custom animation that puts the animation to the right of 0,0 might work better. If the sprite is at 400,0 you'd start the position -400, and move it to 150 and in total it'd be 550.
It's kinda what I had to do with the sand.
vVv Gouken718 vVv SabreTooth718 vVv


altoiddealer

ODB you are probably correct about that.

If your character is going to be 1.1 exclusive, then just replace "GameWidth" with "ScreenWidth" and that should solve it.


If this character is going to be 1.0 and 1.1... well, I'm not sure what value gets returned when you use "ScreenWidth" on 1.0 (if anything), but I imagine it would return "0", along with an error in debug that I think you would just have to accept.

If that is the case, then I think you can use:

trigger1 = ScreenWidth > 0
trigger1 = abs(Pos x) > (Screenwidth/2) + 550
trigger2 = ScreenWidth = 0
trigger2 = abs(Pos x) > (Gamewidth/2) + 550

Or just

trigger1 = Cond(ScreenWidth,abs(Pos x) > (Screenwidth/2) + 550,abs(Pos x) > (Gamewidth/2) + 550)


Synck

Character is going to be 1.0.
Anyway I have tried the codes and they work properly.
ODB's code was the answer, but it seems that code works only when character goes too long off the screen, but my friend is still telling me that in the stage (which is in the first post) where he tried her is the still same problem in stucking in edge of the screen.

I could use altoid's code but ScreenWidth doesn't exist in mugen 1.0, only in mugen 1.1.
I tried his code too and it works great in mugen 1.1.

Also do stage bounds could be the problem?

Odb718

I've seen stages have problems with projectiles. The projectile will sit at the edge of the screen or just past the edge and not be destroyed. You might want to search for that. I've seen it 3 or 4 times over the years. Sometimes it could be fixed in the projectiles, sometimes it was the stage.

About the screenwidth/1.0 problem, I think you can get the basic value with 2 or 3 checks/triggers in 1.0. Look in Mugen Class for the 1.1 stuff. You should be able to find it easy.
vVv Gouken718 vVv SabreTooth718 vVv


Synck

Thanks a lot Odb718. Your code helped me out.
And also I have seen that the problem was in a stage.

Well at least I must set a note in a character that she has a problem with a stages which do have a problem with lower screen bounds.
Problem solved.

Odb718

I'm currently working on a character and ran into needing this
http://mugenguild.com/forum/msg.2178776
thread myself.
Maybe skim it over and find something that might be able to help?
vVv Gouken718 vVv SabreTooth718 vVv