YesNoOk
avatar

checking the juggle value (Read 777 times)

Started by Ryanide, September 13, 2008, 12:38:23 am
Share this topic:
checking the juggle value
#1  September 13, 2008, 12:38:23 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
I'm almost ready to update Maxime with a new AI and gameplay patch. However, there's something that I want to include and I'm having trouble figuring out how to do it.

I want to have a constant -2 state that checks the opponent's juggle points, and then applies a palFX to the background along with a text explod "Finish up!" when the juggle limit is almost reached.

So an example: Maxime's juggle const is set to 30. When he's used up 20 juggle points, the screen will flash for a second and a little "Finish up!" will appear underneath his life bar until the combo is ended.

I can't find any triggers in the doc files that return the remaining juggle points.

And I don't want to work with hitcounts either, since some of my attacks don't take up any juggle points (the aerial finishers and hypers for example)

Can anyone help with this? I'm inexperienced with how to use variables, so that could be the problem.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: checking the juggle value
#2  September 13, 2008, 12:52:13 am
  • ******
There isn't any trigger for that.
A very straightforward way would be to set a variable and increase it in the moves themselves, by the value of the move, if it hits. It would reset when the target hits the ground. May be just a little annoying to need to put that in all your moves, but hey :P it should be the most straightforward method.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: checking the juggle value
#3  September 13, 2008, 12:54:04 am
  • ******
  • [E]
    • Mexico

  • Online
There is not that trigger, the only help I can offer you is none, as I gave up on mugen's juggle system long ago. I use a combination of assert special for no juggle and a var to keep track of juggle points.
Re: checking the juggle value
#4  September 13, 2008, 05:01:48 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
I guess I'd better start mucking around with variables then.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: checking the juggle value
#5  September 13, 2008, 06:17:49 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
so considering that I have a constant "no juggle check" assertspecial now...

how do I get Maxime's moves to miss once a set number of variable juggle points are reached?

statetype to idle?
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: checking the juggle value
#6  September 13, 2008, 06:29:16 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
seperate hitdef place a hitdef after the original one, triggered by when the variable is equal to a point where you want it to stop juggling.
Re: checking the juggle value
#7  September 13, 2008, 07:13:21 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
I have one solution: I set Maxime's juggle const to 0, then disable juggle checking using an assert special in state 2. Next, I have to following code as a -2 state:


Code:
[statedef -2]

[state -2, juggle counter initialise]
type = varset
trigger1 = time = 0
v = 7
value = 40

[state -2, no juggle]
;no juggle[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = var(7) >= 1
flag = nojugglecheck
ignorehitpause = 1
persistent = 1

[state -2, juggle counter reset]
type = varset
trigger1 = p2stateno = 5120 ;getting up from ground anim
v = 7
value = 40

After each hitdef I have a varadd that detracts whatever number of points from the variable 7.

So far, it seems to work with one attack: his anti-air move, and only when I use that move several times in a row. However it doesn't seem to work on any of his aerials.

Why could this be?
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: checking the juggle value
#8  September 13, 2008, 07:57:03 am
  • *****
    • Peru
    • www.mugenguild.com/renzo
I developed a simple Juggle system for some of my chars, feel free to use it if you find it useful.

In a negative state:
Code:
;------------------------------------------------------------------------------
;Custom Juggle Checking
;==================

;This SCTRL sets the total ammount of available juggle points to a var
;as soon as the nearest enemy leaves the ground
;We need !(var20) in the trigger because if we don't use it, var(21) will increase over time.
[State -2, VarSet]
type = VarSet
trigger1 = (enemyNear, statetype=A) && !var(20)
var(21) = 15
ignorehitpause = 1

;If the nearest enemy lands, we disable juggle checking
[State -2, VarSet]
type = VarSet
trigger1 = enemyNear, statetype!=A
var(20) = 0
ignorehitpause = 1

;If the nearest enemy jumps, we activate juggle checking
[State -2, VarSet]
type = VarSet
trigger1 = (enemyNear, statetype=A)
var(20) = 1
ignorehitpause = 1

;This is just to keep triggers clean. We use a variable to simplify
;the expression that determines whenever a move should hit
;(talking only in terms of juggle points, not actual move triggering, like !movecontact)
[State -2, VarSet]
type = VarSet
trigger1 = 1
var(22) = ((var(20) && var(21)>0) || !var(20))

;We decrease the juggle counter.
;The number we compare against HitPauseTime is the
;actual pausetime of the HitDef minus 1
;... a bit annoying, because you have to put every move you
;want to affect juggling, but I can't find another way...
;The value we susbtract from var(21) is the "cost" of the move.
[State -2, Juggle--]
type = VarAdd
triggerall = Var(20) && movehit
trigger1 = (stateno=200) && HitPauseTime=10
trigger2 = (stateno=210) && HitPauseTime=11
trigger3 = (stateno=220) && HitPauseTime=18
trigger4 = (stateno=300) && HitPauseTime=10
trigger5 = (stateno=310) && HitPauseTime=11
trigger6 = (stateno=320) && HitPauseTime=18
trigger7 = (stateno=400) && HitPauseTime=10
trigger8 = (stateno=410) && HitPauseTime=11
trigger9 = (stateno=420) && HitPauseTime=18
trigger10 = (stateno=600) && HitPauseTime=10
trigger11 = (stateno=610) && HitPauseTime=11
trigger12 = (stateno=620) && HitPauseTime=18
trigger13 = (stateno=700) && HitPauseTime=10
trigger14 = (stateno=710) && HitPauseTime=11
trigger14 = (stateno=711) && HitPauseTime=11
trigger15 = (stateno=720) && HitPauseTime=18
trigger16 = (stateno=1030) && HitPauseTime=18
trigger17 = (stateno=1031) && HitPauseTime=11
var(21) = -15
ignorehitpause = 1

;------------------------------------------------------------------------------


In your hitdef, you just have to check if var(22) is not zero.
Code:
[State 200, HitDef1]
type = HitDef
trigger1 = !movecontact && !movereversed && var(22)
trigger1 = !(enemynear, Hitfall)
attr = S, NA
damage = 20, 0
animtype = Light
guardflag = M
hitflag = MAF
priority = 3, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = S800
sparkxy = -10, -29
hitsound = S200, 3
guardsound = S200, 11
ground.type = High
ground.slidetime = 13
ground.hittime = 13
ground.velocity = -4
airguard.velocity = -1.5,-1
air.type = High
air.velocity = -3,-5
air.hittime = 25
getpower = 0,0
givepower = 20,20

Hope this helps; it works fine, but I had some problems in characters like P.o.t.S Duck Hunt bonus, because the freaking ducks -obviously- never land.

Edit: It's only me or code tags look like crap in Opera and Chrome?
Last Edit: September 13, 2008, 08:02:10 am by ME WANT COOKIE
Re: checking the juggle value
#9  September 13, 2008, 09:19:48 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
Thanks for your help everyone. I managed to fix the problem.

Here's what I did:

Code:
[statedef -2]

[state -2, juggle counter initialise]
type = varset
trigger1 = gametime = 1
v = 7
value = 0

;the variable is initiallised at the start of the game.

[state -2, no juggle]
;no juggle[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = var(7) <= 30
flag = nojugglecheck
ignorehitpause = 1

; When the variable's value reaches above the specified
;amount, the nojuggle assert is disabled. The character's
;default juggle const is set to 0.

[State 0, BGPalFX]
type = BGPalFX
trigger1 = var(7) > 20
time = 10
;add = 0,0,0
;mul = 256,256,256
;sinadd = 0,0,0,10
invertall = 1
;color = 256
ignorehitpause = 1
persistent = 1

;something to let the player know that
;their combo will soon come to an end.

;attack check. All the attacks now have to be defined with
;how many juggle points they add.

;attack 1
[State 0, VarAdd]
type = VarAdd
trigger1 = movehit = 1 ;replace with number of attack hits. Only final blow will register.
trigger1 = stateno = 200 ;replace with attack stateno.
trigger1 =  p2movetype = H
v = 7    ;fv =
value = 1 ;however many juggle points this attack gives.
;ignorehitpause = 1
;persistent = 0

[state -2, juggle counter reset]
type = varset
trigger1 = p2stateno = 5120
trigger2 = p2stateno = 5200
trigger3 = p2stateno = 5210
trigger4 = p2stateno = 45
trigger5 = p2stateno = 0
v = 7
value = 0

; all these opponent states will cause the juggle counter to reset.

So far, it's working fine. I'll need to test it a bit more though to make sure there are no bugs.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: checking the juggle value
#10  September 13, 2008, 11:58:04 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
instead of p2stateno even though i'm not sure if it matters you can use enemy,stateno or enemynear,stateno . Don't kno if it matters because i tested the p2stateno out and seemed to do the same as enemynear.
Re: checking the juggle value
#11  September 13, 2008, 01:08:44 pm
  • ***
i think enemynear will be more efficient in 2on2 battles but thats just a guess
Re: checking the juggle value
#12  September 14, 2008, 02:49:54 am
  • *****
    • Peru
    • www.mugenguild.com/renzo
Maybe I'm not understanding it, but with the code you provided has some errors:

-A better way to reset the juggle counter is triggering when enemynear,movetype!=H
-The Juggle counter will increase even If you manage to hit the enemy while he's on the floor.
-movehit doesn't return the number of hits of the current HitDef; it only checks if the move hasn't hit the enemy (value of 0) or it has (non zero). So changing the number from 1 to whatever number of hits the move has has no effect.
Re: checking the juggle value
#13  September 14, 2008, 06:38:02 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
I want the juggle counter to increase when I hit floored enemies. Otherwise, he'd be able to infinite with his low attacks against a wall.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: checking the juggle value
#14  September 14, 2008, 08:24:42 am
  • *****
    • Peru
    • www.mugenguild.com/renzo
In terms of fighting games, that's not juggling; its just a combo limiter. Nothing wrong with your idea, it's just it could confuse people like me.