Jump Script Fix - aka - I believe I can (stop) fly(ing)

WolfMerrik

New member
As mentioned on the comments in the YouTube video, mashing the button seems to let you fly...
I am not sure if this is the best fix, but it does indeed work:

This script would change varJumpRelease.asm

Code:
LDA #$00			; Its always good to start at 0
SEC
SBC #$02			; I chose 2 over the tutorials 3 because I wanted lighter/tighter jumps
LDX player1_object
CMP Object_v_speed_hi,x		; Rather than BPL, we will compare with the current player value
BMI skipVarJump			; If the speed is below the jumping (reverse falling speed)
LDA #$00			; the same fun way to set the values as the original lol.
SEC
SBC #$02			; This should be the same as we compare against above

STA Object_v_speed_hi,x
skipVarJump:
RTS

Definitely feel free to improve this!
 

CutterCross

Active member
WolfMerrik said:
As mentioned on the comments in the YouTube video, mashing the button seems to let you fly...
I am not sure if this is the best fix, but it does indeed work:

Code:
LDA #$00			; Its always good to start at 0
SEC
SBC #$02			; I chose 2 over the tutorials 3 because I wanted lighter/tighter jumps
LDX player1_object
CMP Object_v_speed_hi,x		; Rather than BPL, we will compare with the current player value
BMI skipVarJump			; If the speed is below the jumping (reverse falling speed)
LDA #$00			; the same fun way to set the values as the original lol.
SEC
SBC #$02			; This should be the same as we compare against above

STA Object_v_speed_hi,x
skipVarJump:
RTS

Definitely feel free to improve this!
For some reason it won't work on my end. Getting errors about a label already being defined. (I'm probably missing something though.)
 

CutterCross

Active member
WolfMerrik said:
Do you have this script as well as the other both being used by any chance?
Otherwise I am not sure.
I replaced the old jump script with this one, but I'm also using the varJumpRelease script if that helps narrow it down.
 

WolfMerrik

New member
CutterCross said:
I replaced the old jump script with this one, but I'm also using the varJumpRelease script if that helps narrow it down.

This script is for the jump release - so the one I posted should replace "varJumpRelease.asm"
I changed the post to make that more clear
 

CutterCross

Active member
WolfMerrik said:
This script is for the jump release - so the one I posted should replace "varJumpRelease.asm"
I changed the post to make that more clear
Oh haha, oops. That was my bad.

I replaced the varJumpRelease with this script and now it works perfectly!
 

WolfMerrik

New member
I should have said which life it modified, equal parts "our bad" haha.

That's great it's working!
I'm sure it is pretty crappy ASM, as I am VERY new to understanding it, but it does at least fix that glitch.
 

CutterCross

Active member
WolfMerrik said:
I should have said which life it modified, equal parts "our bad" haha.

That's great it's working!
I'm sure it is pretty crappy ASM, as I am VERY new to understanding it, but it does at least fix that glitch.
Well if it works without issues it's not crappy to me! Haha

I need to start diving into ASM myself too.
 
Code:
LDX player1_object
LDA Object_v_speed_hi,x
BPL skipVarJump
LDA #$00
SEC



STA Object_v_speed_hi,x
skipVarJump:
RTS

I just did this, I removed the part where it subtracts a number from the that loaded number...I think? You don't get that floaty feel when you fall with it, You fall quite fast but I haven't noticed any weird double jump effect or extra height from it.
 

WolfMerrik

New member
ostincoolston said:
I just did this, I removed the part where it subtracts a number from the that loaded number...I think? You don't get that floaty feel when you fall with it, You fall quite fast but I haven't noticed any weird double jump effect or extra height from it.

That would definitely work too, but I still wanted there to be a bit of an extra lift after releasing the jump button, so you didn't stop immediately.
In your script, I think you can remove the set carry "SEC" line as well if you want it to just stop.
 

cornphillips

New member
Its a great fix but it doesn't solve my problem, maybe an issue with the collision system.

When I am moving right or left, and falling in the air, when i hit the ground, i appear to hit, then bounce up a pixel for a few frames, then i fall to the ground.
It makes precision platforming much more frustrating to handle.
 

WolfMerrik

New member
cornphillips said:
Its a great fix but it doesn't solve my problem, maybe an issue with the collision system.

When I am moving right or left, and falling in the air, when i hit the ground, i appear to hit, then bounce up a pixel for a few frames, then i fall to the ground.
It makes precision platforming much more frustrating to handle.

I had not noticed that in the platformer I was working on, but I will definitely take a look at it, and maybe we can both figure it out.
I know the bounding boxes take into account an extra pixel, so I took one off the bottom of my player object.

Although it sounds like you are indeed having an issue with something in the collision script. Have you tried adjusting the values/speeds of your player object?
 

WolfMerrik

New member
Orgia Mode said:
Seems to work pretty well for me, thanks.

Thats great!

I am working on making a few other jump scripts (all based on this one)
Its simple, and it works, so for now, its the best we have =P
 

WolfMerrik

New member
dale_coop said:
Nice! Will try this script asap.
Thanks WolfMerrik

It is about time I started adding some code to this and got my feet wet with ASM.
It is definitely VERY alien to me, and this was really the first code I wrote for NESMaker

I would definitely appreciate any feedback from you, and you are very welcome!
 

dale_coop

Moderator
Staff member
I was so excited for your script... I tested it right now.
Works great... and nice feeling during gameplay. So for me it would definitely replace the native "varJumpRelease.asm" script, in my projects.
Thank you

PS: I saw you made doubleJump too! Definitely need to test this one toot ;)
 

DanielT1985

Member
This actually worked for me. It made the controls for jumping a lot better than what it did previously. Thanks for sharing the code.
 

WolfMerrik

New member
DanielT1985 said:
This actually worked for me. It made the controls for jumping a lot better than what it did previously. Thanks for sharing the code.

Thats great to hear!
Im very pleased with myself, and although it is a VERY basic script change, it greatly has helped me get the basics of ASM. So hopefully, I will be able to work on more complex scripts down the road.
 

Orgia Mode

New member
Wolf, can you add a comment header to your code(s) that claim credit as well as a version number in case you ever update them?
When I borrow a script, I frequently check back for updates just in case.
 
Top Bottom