juggle control variable

Started by Borghi, August 19, 2013, 06:53:39 AM

Previous topic - Next topic

Borghi

I hate juggle points. it's awful when a move doesn't connect cause there's no more points and looks that they are ghosts fighting.

SO! To prevent my chars from having some infinite combos I'm using a variable. The idea is to activate the var when a combo starts with a launcher and alter the air velocity of that launcher so it can be connected again but doesn't work as a launcher anymore. for example, an attack that has -5 of Y air velocity will change to 3 if the var is !=0. So, the second time the attack is connected within a combo the enemy will drop to the floor instead of rising.

This is working well sometimes and not some other times. I make it by having a "varset to 1" if the attack connects, and the same var set to 0 in the -2 state when "enemy, movetype != h". So, it activates when the enemy is hit in certain attacks and returns to 0 when the combo is over. With this var I regulate the air velocity in the attacks.

The thing is that sometimes it works and sometimes it doesn't, and i don't mean in different attacks. I perform the exact same combo over and over and it works 50/50.

Do you have any idea what could I be doing wrong?
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!

Burning_Typhoon

#1
If you want to change the velocity, why not just add the variable to the end of the specific attack you want altered?

I didn't click the quote button, but under the hit def of the attack, add something like...

[State xxx, VarSet]
type = VarSet
trigger1 =movehit
v = this
value = var(this)+1


and, in state -2...

[State -2, Reset var when the opponent recovers]
type=varset
triggerall=enemynear,hitover&&enemynear,hitshakeover&&enemynear,ctrl=1
trigger1= numenemy&&(enemynear,movetype!=H)
var(this)=0
ignorehitpause=1

Lastly, go back to the attack (or do this second)

ground.cornerpush.veloff = ifelse(var(this)>=2,-15,-4)
air.cornerpush.veloff = ifelse(var(this)>=2,-15,-4)


I've just used those numbers as an example you probably don't want them getting hit so high into the air... lol.  I wouldn't worry too much about trying to make sense of it all.  Attacking, I mean.  If a character is unhittable for some reason, it's going to look like you're attacking a ghost anyway.  Most supers need invincible start-up so they're not canceled out by a simple LP after you've just done a full 720 motion, or something.

When the move hits, I'm not 100% sure, but, the variable may already be 1.  If that's not the case, then change >=2 with >0

Borghi

Well, this is what  have so far (the problem persists)

I have 2 launcher attacks in this chars. One is state 210 (stong-crounching-punch) and the other 640 (strong jumping kick).

both of them have the same air.velocity:

air.velocity = -5,ifelse(var(45)=0,-6,5)

on both of them I put the same sctrl:

;var para JUGGLE
[State 0, VarSet]
type = Varset
trigger1 = movehit
var(45)=1


and in stateno -2 I add this:

;var para JUGGLE
[State 0, VarSet]
type = VarSet
trigger1 = enemynear, movetype != h
trigger2 = enemynear, ctrl=1
var(45)=0


The idea is that you can't use 2 launchers in the same combo.

So, when I start with 210 and try to use 210 again it works. The char fall fast to the ground and you can't continue the combo.

if I use 640 and then continue with 210, it also works.

But if I start with 210, then jump and hit 640 it doesn't work. i can continue the combo. Unless I make 210 again, then it stops.

So, somehow that's the problem, within that particular combination. I suppose somehow in the middle the varset in -2 is activated and that makes me able to continue the combo. But I can't find out why.
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!

Burning_Typhoon

#3
If it works properly with one move, you're missing some code on the other one that you have to duplicate.  Use the same launcher variable for both attacks. 

Woah, hold on.  I see what you did wrong.  Go back up and look at my post.  Replace "This" with 45.

var(45)= Var(45)+1 on hit.  So whatever it is, when that attack is done, the variable will go UP.  Not simply stay at one.

Borghi

It is the exact same code. That's the weird part.

I guess it has to do with one of them being an aerial move...
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!

Burning_Typhoon

Quote from: Borghi on August 20, 2013, 06:19:44 AM
It is the exact same code. That's the weird part.

I guess it has to do with one of them being an aerial move...

Maybe I just needed some rest or something, but, why not make variable 45 the air velocity itself?  Make variable 45 =-5.  Then, on move hit, make it = to -4 until the enemy recovers.

About above, it seems to work for me when I do it that way.  Only difference is I'll disable a move entirely.  Maybe I should quit doing that, though.  If you push a button at an inappropriate time, you should be punished for it...  oh well. 

For the air vel line, just use var (45) and have it change on hit.

Borghi

But if I do that I'll be forced to use the same vel on both attacks and that's no super good.
I'm using the exact same code for the moment only to check why the hell isn't working on some circumstances.
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!

Burning_Typhoon

Quote from: Borghi on August 21, 2013, 01:25:32 AM
But if I do that I'll be forced to use the same vel on both attacks and that's no super good.
I'm using the exact same code for the moment only to check why the hell isn't working on some circumstances.

Not if you use an "if else" for the attack.

Let's say one is -6, and the other is -5.  (I thought they both were negative 5)

Anyway, if you want negative -6, and one to be -5 the first time they hit, and the 2nd time, you want them both to be -4

air.velocity = ifelse(var(45)>=1, -4, -5), -??(forgot what you said you wanted this to be and I'm not going back to see)

and, for the other attack.

air.velocity = ifelse(var(45)>=1, -4, -6)

If that doesn't work, do you mind if I took a look at it?

Borghi

I'll send it to you! Let's talk in private.

     Posted: August 29, 2013, 12:41:34 AM
SOLVED!

this was the problem:

the varsets in the attacks needed ignorehitpause=1. Without that, the var activated too late, and second launcher could be connected with the var still off.

that solved it all.
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!