YesNoOk
avatar

Small jump tends to be "capricious" (Read 801 times)

Started by Momotaro, April 21, 2020, 05:21:40 pm
Share this topic:
Small jump tends to be "capricious"
#1  April 21, 2020, 05:21:40 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
I'm tweaking stuff around.

I used some code to give a small jump à la POTS / kof to a character.
The small jump itself does not react well. most of the time just doing normal jump.

Any idea where is the problem ?
Thanks


Code:
;====================<Jumping>====================
[StateDef 40]
type = S
physics = S
moveType = I
anim = 40
ctrl = 0
velSet = 0,0
sprPriority = 1
faceP2 = 1

[State 40, Direction]
type = VarSet
trigger1 = 1
sysvar(1) = ifElse(!Time, 0, ifElse(command = "holdfwd", 1, ifElse(command = "holdback", -1, sysvar(1))))

[State 40, High Jump]
type = VarSet
trigger1 = !Time
var(3) = ifElse(command = "highjump", 3, 0)

[State 40, High Jump]
type = VarSet
trigger1 = !Time && PrevStateNo = 100
var(3) = 3

[State 40, Low Jump]
type = VarSet
trigger1 = command != "holdup" && (var(3) != [1,2])
var(3) = ifElse((var(3) = 3 && sysvar(1)), 2, 1)

[State 40, Jump Sound]
type = PlaySnd
trigger1 = !AnimTime
value = ifElse((var(3) = [2,3]), 9, 9), 0
;value = ifElse((var(3) = [2,3]), 41, 40), 0

[State 40, Dust Helper]
type = Helper
trigger1 = !AnimTime
helperType = Normal
stateNo = 8100
ID = 8100
name = "Jump Dust"
posType = P1
ownPal = 1

[State 40, Velocity: Normal Jump]
type = VelSet
trigger1 = !AnimTime
x = ifElse(!sysvar(1), const(velocity.jump.neu.x), ifElse(sysvar(1) = 1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, Velocity: Low Jump]
type = VelSet
trigger1 = !AnimTime && var(3) = 1
x = ifElse(!sysvar(1), const(velocity.jump.neu.x), ifElse(sysvar(1) = 1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = 0.75 * const(velocity.jump.y)

[State 40, Velocity: Long Low Jump]
type = VelSet
trigger1 = !AnimTime && var(3) = 2
x = ifElse(!sysvar(1), const(velocity.jump.neu.x), ifElse(sysvar(1) = 1, const(velocity.runjump.fwd.x), const(velocity.runjump.back.x)))
y = 0.75 * const(velocity.jump.y)

[State 40, Velocity: Long Jump]
type = VelSet
trigger1 = !AnimTime && var(3) = 3
x = ifElse(!sysvar(1), const(velocity.jump.neu.x), ifElse(sysvar(1) = 1, const(velocity.runjump.fwd.x), const(velocity.runjump.back.x)))
y = 1.0772 * const(velocity.jump.y)

[State 40, End]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1
Re: Small jump tends to be "capricious"
#2  April 21, 2020, 06:05:18 pm
  • *****
  • Shame on you!
    • USA
Watch sysvar(1) to make sure it's staying solid.
 I take it your small jump you have to hit down,up and release up pretty fast to activate it?

I've had little problems like this in the past where I thought mugen would naturally fire off the chunk of code with the triggers I had. They wouldn't work until I added
triggerall = 1
try adding that to
[State 40, Low Jump]
type = VarSet
trigger1 = command != "holdup" && (var(3) != [1,2])
var(3) = ifElse((var(3) = 3 && sysvar(1)), 2, 1)
This way you know mugen is looking at it every tic.

You might want to reorder your VelSets at the end. Make the low jump the last one loaded?
vVv Ryuko718 Updated 10/31/22 vVv
Re: Small jump tends to be "capricious"
#3  April 21, 2020, 06:30:59 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Yes, this is the type of small jump.
But the command should be : taping up, or up+forward or up+back.

Seems like it's very very sensitive compared to usual POTS characters.
To make it happen I have to taop very very slightly the command.

Thanks.
I tried this stuff with : triggerall = 1
but it doesn't seems to work better.
Re: Small jump tends to be "capricious"
#4  April 21, 2020, 07:56:11 pm
  • *****
  • Shame on you!
    • USA
On your varsets try adding
triggerall =  var(3) != [1,2]
to all of them. This way if the small jump activates it's locked in??
 
vVv Ryuko718 Updated 10/31/22 vVv
Re: Small jump tends to be "capricious"
#5  April 21, 2020, 08:11:17 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Thanks again, I tried.
No real change.  :S
Re: Small jump tends to be "capricious"
#6  April 22, 2020, 02:23:10 pm
  • *****
  • Shame on you!
    • USA
 You might want to try to work these 3 varsets into 1 varset with a nested ifelse? But maybe try it this way unless something's wrong.
[State 40, High Jump]
type = VarSet
trigger1 = !Time
var(3) =  0
 
[State 40, High Jump]
type = VarSet
triggerAll = !Time
Trigger1 = PrevStateNo = 100
trigger2 = command = "highjump"
var(3) = 3
 
[State 40, Low Jump]
type = VarSet
trigger1 = command != "holdup"
var(3) = (3+sysvar(1)/2) ;;either 4/2 or 2/2 aka 2 or 1


But the command should be : taping up, or up+forward or up+back. 
var(3) = ifElse((var(3) = 3 && sysvar(1)), 2, 1)  ;;; If var(3) has to be 3, you have to have done the high jump or have been in state 100, right? 


 
vVv Ryuko718 Updated 10/31/22 vVv