YesNoOk
avatar

Problem with a winpose (Read 621 times)

Started by Trinitronity, January 13, 2014, 07:26:31 pm
Share this topic:
Problem with a winpose
#1  January 13, 2014, 07:26:31 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Hello again, it's me, TrinitroMan.
If you have followed the thread to Ryon's Project Catch'em All, then you probably have found out, that I'm working on Togetic.
However, I have now a problem with the winpose. When winning the round, Togetic was supossed to jump continously. However, I have problems pulling it off. Thankfully, Alexei started to help me, and with his help, I got this code:
Code:
;---------------------------------------------------------------------------
;Unique Winpose
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Jump]
type = velset
trigger1 = animelem = 3
y = const(velocity.jump.y)

[State 181, Gravity]
type = Gravity
trigger1 = pos y < 0

[State 181, Prevent going through floor]
type = PosSet
trigger1 = pos y >= 0 && vel y > 0
y = 0

[State 181, ChangeAnim]
type = ChangeAnim
triggerall = pos y >= 0 && vel y > 0; && anim!=181  ; Where 5 is a time to offset the change, to allow for the jump, or it might change the anim too fast.
trigger1 = time > 10 && time < 30
trigger2 = time > 35 && time < 55
trigger3 = time > 60 && time < 90
trigger4 = time > 95
value = 181

[State 181, Persist Round]
type = AssertSpecial
trigger1 = time<=100
flag = roundnotover
ignorehitpause = 1

[State 181, Pokemon Cry]
type = PlaySnd
trigger1 = !time
value = 11,0
However, the problem is now that Togetic get stuck slightly below the ground after the first jump, and thus, Togetic cannot jump the other times (although I could clearly see that Togetic was trying to jump, so Alexei's idea with the multiple time triggers does seem to work).
So yeah, I would be glad, if this problem gets solved.
Thanks in advance!
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#2  January 14, 2014, 12:09:13 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
What you have right now, is the PosSet triggering even when pos y = 0. This is bad. What that will do is consistently position Togetic on the ground, even though he's already at position 0, locking him there. Change the pos y >= 0 to pos y > 0, so that it only triggers when Togetic is below the ground.

-[Все слова это только слова.]-
Re: Problem with a winpose
#3  January 14, 2014, 05:01:32 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Okay, I just did that, but the problem still persists...
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#4  January 15, 2014, 03:28:05 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
He's still stuck in the ground? Did you change the triggers on the jump too? From your code, it doesn't look like it, but you mentioned that it worked for you, so I'm not sure.

-[Все слова это только слова.]-
Re: Problem with a winpose
#5  January 15, 2014, 10:45:42 am
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Well, I'm not sure, what you mean, so I just post the current code now:
Code:
;---------------------------------------------------------------------------
;Unique Winpose
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Jump]
type = velset
trigger1 = animelem = 3
y = const(velocity.jump.y)

[State 181, Gravity]
type = Gravity
trigger1 = pos y < 0

[State 181, Prevent going through floor]
type = PosSet
trigger1 = pos y > 0 && vel y > 0
y = 0

[State 181, ChangeAnim]
type = ChangeAnim
triggerall = pos y >= 0 && vel y > 0; Where 5 is a time to offset the change, to allow for the jump, or it might change the anim too fast.
trigger1 = time > 10 && time < 30
trigger2 = time > 35 && time < 55
trigger3 = time > 60 && time < 90
trigger4 = time > 95
value = 181

[State 181, Persist Round]
type = AssertSpecial
trigger1 = time<=100
flag = roundnotover
ignorehitpause = 1

[State 181, Pokemon Cry]
type = PlaySnd
trigger1 = !time
value = 11,0
I hope it helps... :)
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#6  January 16, 2014, 12:01:30 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
I meant the trigger for your jump has not changed. If you want him to jump twice, you should have it trigger twice.

-[Все слова это только слова.]-
Re: Problem with a winpose
#7  January 16, 2014, 07:04:16 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Well, I think it should. At lest, I try to achive the second jump by looping an anim with an -1 frame at the end by changing the anim to itself, kinda like how the animation freeze was achieved in the intros.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#8  January 18, 2014, 12:40:50 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
I meant by using the example I showed you before. Use time triggers. It's just easier. Your two jumps are "scripted" anyways so there's no point in trying a dynamic approach.

-[Все слова это только слова.]-
Re: Problem with a winpose
#9  January 18, 2014, 10:10:22 am
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Uhm...I thought I did?
Code:
[State 181, ChangeAnim]
type = ChangeAnim
triggerall = pos y >= 0 && vel y > 0; Where 5 is a time to offset the change, to allow for the jump, or it might change the anim too fast.
trigger1 = time > 10 && time < 30
trigger2 = time > 35 && time < 55
trigger3 = time > 60 && time < 90
trigger4 = time > 95
value = 181
Or should I add the time triggers somewhere else? Because the first jump just works fine. I only have problems with the landing, which results in problems with the other jumps (Togetic will jump so often, until the screen turns black).
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#10  January 18, 2014, 05:03:41 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
I was talking about to your junp. That's just a ChangeAnim...

I was always referring to this here:
Code:
[State 181, Jump]
type = velset
trigger1 = animelem = 3
y = const(velocity.jump.y)

     Posted: January 18, 2014, 05:04:41 pm
I was trying to say that using time triggers there would be a whole lot easier than relying on AnimElem and going about things dynamically.

-[Все слова это только слова.]-
Re: Problem with a winpose
#11  January 18, 2014, 08:04:58 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
You know what, nevermind. I was able to fix the problem with the jumping all by myself.
The only thing I had to to was changing the duration of the last frame of the anim from -1 to 30, and changing the code to this:
Code:
;---------------------------------------------------------------------------
;Unique Winpose
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Begin]
type = Velset
trigger1 = animelem = 1
y = 0

[State 181, Jump]
type = velset
trigger1 = animelem = 3
y = const(velocity.jump.y)

[State 181, Gravity]
type = Gravity
trigger1 = pos y < 0

[State 181, Prevent going through floor]
type = PosSet
trigger1 = pos y > 0 && vel y > 0
y = 0

[State 181, ChangeAnim]
type = Null;ChangeAnim
triggerall = pos y >= 0 && vel y > 0; Where 5 is a time to offset the change, to allow for the jump, or it might change the anim too fast.
trigger1 = time > 10 && time < 30
trigger2 = time > 35 && time < 55
trigger3 = time > 60 && time < 90
trigger4 = time > 95
value = 181

[State 181, Persist Round]
type = AssertSpecial
trigger1 = time<=100
flag = roundnotover
ignorehitpause = 1

[State 181, Pokemon Cry]
type = PlaySnd
trigger1 = !time
value = 11,0
Now, Teogtic jumps multiple times while still using animelem triggers.
The only problem left now is that every time Togetic lands on the ground after one of the jumps, he is slightly below the ground, though the jump itself still works as it should...
...still thanks, though. If you were not here, I would never come this idea.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#12  January 18, 2014, 11:15:43 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
That's good to hear. I was just suggesting that way because it's easier to deal with. Anyways, does it eventually reset him to be standing on the ground, or not at all?

-[Все слова это только слова.]-
Re: Problem with a winpose
#13  January 19, 2014, 10:37:55 am
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
No, he's always slightly below the ground after one of the winpose jumps.
What's odd is that it only happens during the winpose, but nowhere else.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#14  January 19, 2014, 10:26:41 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
It's probably because the velocity from Graivty is not reset to 0, so you still have a constant force pushing you down. Reset the Velocity to 0 using the same trigger (pos y>0) as you used to reset your position.

-[Все слова это только слова.]-
Re: Problem with a winpose
#15  January 20, 2014, 12:58:44 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Tried it, but it still doesn't work... :-\
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#16  January 20, 2014, 11:51:46 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Wow... this is a persistent one. Post your newly modified code, please.

-[Все слова это только слова.]-
Re: Problem with a winpose
#17  January 21, 2014, 04:58:30 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Okay:
Code:
;---------------------------------------------------------------------------
;Unique Winpose
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Begin]
type = Velset
trigger1 = animelem = 1
y = 0

[State 181, Jump]
type = velset
trigger1 = animelem = 3
y = const(velocity.jump.y)

[State 181, Gravity]
type = Gravity
trigger1 = pos y < 0

[State 181, Gravity]
type = VelSet
trigger1 = pos y >= 0 && vel y > 0
y = 0

[State 181, Prevent going through floor]
type = PosSet
trigger1 = pos y > 0 && vel y > 0
y = 0

[State 181, ChangeAnim]
type = Null;ChangeAnim
triggerall = pos y >= 0 && vel y > 0; Where 5 is a time to offset the change, to allow for the jump, or it might change the anim too fast.
trigger1 = time > 10 && time < 30
trigger2 = time > 35 && time < 55
trigger3 = time > 60 && time < 90
trigger4 = time > 95
value = 181

[State 181, Persist Round]
type = AssertSpecial
trigger1 = time<=100
flag = roundnotover
ignorehitpause = 1

[State 181, Pokemon Cry]
type = PlaySnd
trigger1 = !time
value = 11,0
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#18  January 21, 2014, 08:51:09 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
*sigh* You did it again, lol. The trigger shouldn't be pos y >= 0 or his velocity will be reset to 0 even when you're standing on the ground, keeping him there. Make the trigger pos y>0.

-[Все слова это только слова.]-
Re: Problem with a winpose
#19  January 22, 2014, 09:26:45 am
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Okay, changed back to pos > 0, and the glitch is still happening...
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#20  January 22, 2014, 09:50:31 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
What was the purpose of this:

Code:
[State 181, Begin]
type = Velset
trigger1 = animelem = 1
y = 0

To debug this you can start by disabling things with Null and see what happens. This is is classic case of trial and error.

-[Все слова это только слова.]-
Re: Problem with a winpose
#21  January 23, 2014, 06:04:42 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
What was the purpose of this:

Code:
[State 181, Begin]
type = Velset
trigger1 = animelem = 1
y = 0

To debug this you can start by disabling things with Null and see what happens. This is is classic case of trial and error.
Okay, I tried you idea, and I decided to not use the PosSet trigger, since appearantly, there are the problems.
However, another problem is that the Gravity trigger ignores the VelSet triggers, which set the y vel to 0. How can I prevent that?
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#22  January 24, 2014, 12:16:24 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
I'm not sure what you mean by that. Gravity should only trigger when your pos y<0. VelSet should only be one tick long. That's why from the very beginning I was talking about using time triggers for the jump velset. The PosSet should only have a trigger of pos y > 0 so that you reset your position when you're below the ground. There should be a VelSet above it to stop your Velocity.

Code:
[StateDef ****]
type = S
movetype = I
physics = N

[State ****, Jump]
type = VelSet
trigger1 = animelem = 3 && vel y=0
y = const(velocity.jump.y)

[State ****, Gravity]
type = Gravity
trigger1 = pos y < 0

[State ****, Reset Vel]
type = VelSet
trigger1 = pos y>0
y = 0

[State ****, Reset Pos]
type = PosSet
trigger1 = pos y>0
y = 0

That should be all there is to it. I'm not sure why  it's causing you so much trouble.

-[Все слова это только слова.]-
Re: Problem with a winpose
#23  January 24, 2014, 09:01:58 am
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
I'm not sure what you mean by that. Gravity should only trigger when your pos y<0. VelSet should only be one tick long. That's why from the very beginning I was talking about using time triggers for the jump velset. The PosSet should only have a trigger of pos y > 0 so that you reset your position when you're below the ground. There should be a VelSet above it to stop your Velocity.

Code:
[StateDef ****]
type = S
movetype = I
physics = N

[State ****, Jump]
type = VelSet
trigger1 = animelem = 3 && vel y=0
y = const(velocity.jump.y)

[State ****, Gravity]
type = Gravity
trigger1 = pos y < 0

[State ****, Reset Vel]
type = VelSet
trigger1 = pos y>0
y = 0

[State ****, Reset Pos]
type = PosSet
trigger1 = pos y>0
y = 0

That should be all there is to it. I'm not sure why  it's causing you so much trouble.
Okay I changed this:
Code:
[State 181, Gravity]
type = VelSet
trigger1 = pos y > 0 && vel y > 0
y = 0

[State 181, Prevent going through floor]
type = PosSet
trigger1 = pos y > 0 && vel y > 0
y = 0
to this:
Code:
[State 181, Gravity]
type = VelSet
trigger1 = pos y > 0 && vel y > -2
y = 0

[State 181, Prevent going through floor]
type = PosSet
trigger1 = pos y > 0 && vel y > -2
y = 0
and now, the problems are gone for some reasons...
...I know it's probably the wrong way to fix this problem, but screw it, the problem is fixed, and that's the important part.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problem with a winpose
#24  January 25, 2014, 12:16:59 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Lol, well that's fine by me. I'm not gonna nitpick semantics at this point. Maybe if you were working for me. >:D

-[Все слова это только слова.]-