Page 1 of 4

Walljumps.lua (v1.2)

Posted: Wed Jul 27, 2016 2:17 pm
by PixelPest
I wrote an API yesterday that allows walljumping universally for all characters. Although it's a little tough to get it to work with Peach due to the hover, you can still get her to walljump if you get the timing right. v1.1 adds a new variable (see below). Thanks to Enjl for the suggestion. This version is still compatible with levels using the older version. Also as of v1.2 the player can no longer walljump when holding an item and also can't walljump while on a mount (boot, Yoshi, or clown car).



The following are variables that can be accessed via a lunadll.lua file, etc.:
  • walljumps.slideSpeed: Speed when sliding down walls. (Default: 3, Recommended Range: 2.5-3.5)
  • walljumps.jumpIntensityX: Absolute speed of how fast the player travels along the horizontal axis after walljumping. (Default: 3, Recommended Range: 3-5)
  • walljumps.jumpIntensityY: Speed of how fast the player travels along the vertical axis after walljumping. (Default: -9, Recommended Range: 8.5-10)
  • walljumps.delayTime: Time (in seconds) that the player has to wait to walljump after making contact with the wall. (Default: 0.25, Recommended Range: 0-0.4)
New v1.1:
  • walljumps.forceRelease: True or false (boolean) whether or not the player must release the jump key before performing a wall jump. (Default: false)
Example:

Code: Select all

local walljumps = API.load("walljumps");

walljumps.slideSpeed = 2.5;
walljumps.jumpIntensityX = 3.5
Download:

Hastebin (copy and save as a .lua file entitled "walljumps"): https://hastebin.com/ejakofuyed.lua
Dropbox (.zip file; includes test level--shown in video): https://www.dropbox.com/s/qcdcct0xzvyhu ... a.zip?dl=0

Re: Walljumps.lua

Posted: Wed Jul 27, 2016 2:23 pm
by loop
This looks very useful. Could be useful for my project (or anybody else's project for that matter.).

Re: Walljumps.lua

Posted: Wed Jul 27, 2016 2:23 pm
by Emral
shoutout to the other dozen people who made walljump in the past

Re: Walljumps.lua

Posted: Wed Jul 27, 2016 2:24 pm
by Enchlore
So it's more of a Mega Man X style wall jump... this is going to be, like, very useful for me. I was going to try to figure out how to code an MMX-style wall jump and this saves me a lot of work. Is it possible to assign a new sprite for sliding on the wall using empty spaces on the player GFX file?

Re: Walljumps.lua

Posted: Wed Jul 27, 2016 2:40 pm
by PixelPest
Enchlore wrote:So it's more of a Mega Man X style wall jump... this is going to be, like, very useful for me. I was going to try to figure out how to code an MMX-style wall jump and this saves me a lot of work. Is it possible to assign a new sprite for sliding on the wall using empty spaces on the player GFX file?
I was considering that. The issue revolves around all of the different characters with different empty spaces, especially with 2.0 coming out, which has character costumes that have different hitboxes, etc. The other issue with using those empty spaces is setting the hitboxes for them. I would suggest using an already existing sprite on the spritesheet, for example, when I had this idea earlier, I looked at using the jump animations of Mario and Luigi, since they have one hand in the air

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 2:08 pm
by Emral
After playing through a level with this I have noticed some issues.
1) You can just hold a button and jump your way into space, which feels awkward and is just wrong.
2) You don't "stick" to the wall, which makes jumping to walls on the opposite side very tricky and uncomfortable to control.

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 2:17 pm
by PixelPest
Enjl wrote:After playing through a level with this I have noticed some issues.
1) You can just hold a button and jump your way into space, which feels awkward and is just wrong.
2) You don't "stick" to the wall, which makes jumping to walls on the opposite side very tricky and uncomfortable to control.
If you can explain further, I'll see what I can do. What do you mean by "jump your way into space"? And I also don't understand what you're referring to by "stick"

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 2:30 pm
by Anthony Valle
Will this be included in SMBX 2.0? Just asking.
Also, this looks good so far, well done.

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 2:43 pm
by Emral
PixelPest wrote:
Enjl wrote:After playing through a level with this I have noticed some issues.
1) You can just hold a button and jump your way into space, which feels awkward and is just wrong.
2) You don't "stick" to the wall, which makes jumping to walls on the opposite side very tricky and uncomfortable to control.
If you can explain further, I'll see what I can do. What do you mean by "jump your way into space"? And I also don't understand what you're referring to by "stick"
1) You'll jump off a wall as long as the jump button is pressed after the initial delay is over, which means that as long as you're enclosed between two walls, holding the jump button is enough to propel you all the way to the top:
ImageImage

2) Usually when you have walljump code, you give the player a certain amount of tolerance before detaching them from the wall, to let them switch over to moving into the opposite direction without losing the ability to jump off the wall. Just play New Super Mario Bros. for the DS.
Image

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 2:57 pm
by PixelPest
Enjl wrote:1) You'll jump off a wall as long as the jump button is pressed after the initial delay is over, which means that as long as you're enclosed between two walls, holding the jump button is enough to propel you all the way to the top:
ImageImage
So are you saying that the code should force the player to let go of the jump button?
Enjl wrote:2) Usually when you have walljump code, you give the player a certain amount of tolerance before detaching them from the wall, to let them switch over to moving into the opposite direction without losing the ability to jump off the wall. Just play New Super Mario Bros. for the DS.
Image
So you mean it should consider the player wallsliding if they're within a certain distance from the wall, not necessarily pushed directly up against it?

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 3:32 pm
by Emral
No, no.
If you look at any other walljump in videogames you'll see that a PRESS of the button is required for the jump to take effect, not HOLDING it.

For the 2nd thing, play NSMBDS. The player does not even go away from the wall for a second or two. They stick to it.

Re: Walljumps.lua

Posted: Wed Aug 03, 2016 7:53 pm
by Turret 3471
This is amazing!! Now I'm gonna need to think of how to use wall jumping in certain levels... Man, I guess you could say people are making SMBX great again! :lol:

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 1:15 pm
by timocomsmbx2345
I would really love to see ground-pounding (if that's possible).
Also, THIS IS AWESOME!!

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 1:26 pm
by PixelPest
timocomsmbx2345 wrote:I would really love to see ground-pounding (if that's possible).
Also, THIS IS AWESOME!!
Thanks! By ground-pounding, do you want the maneuver from like Super Mario Galaxy and Super Mario 64? Like that ground pound?

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 3:39 pm
by timocomsmbx2345
PixelPest wrote:
timocomsmbx2345 wrote:I would really love to see ground-pounding (if that's possible).
Also, THIS IS AWESOME!!
Thanks! By ground-pounding, do you want the maneuver from like Super Mario Galaxy and Super Mario 64? Like that ground pound?
Super Mario 64 ground-pound.

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 4:08 pm
by timocomsmbx2345
THE WALL JUMPING DOESNT WORK!

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 4:10 pm
by PixelPest
timocomsmbx2345 wrote:THE WALL JUMPING DOESNT WORK!
Can you be a little more specific as to what isn't working?

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 4:14 pm
by timocomsmbx2345
PixelPest wrote:
timocomsmbx2345 wrote:THE WALL JUMPING DOESNT WORK!
Can you be a little more specific as to what isn't working?
i got an error abut an "API" when i test it.

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 4:15 pm
by PixelPest
timocomsmbx2345 wrote:
PixelPest wrote:
timocomsmbx2345 wrote:THE WALL JUMPING DOESNT WORK!
Can you be a little more specific as to what isn't working?
i got an error abut an "API" when i test it.
What exactly is the error and what code do you have in your lunadll.lua file?

Re: Walljumps.lua

Posted: Thu Aug 11, 2016 5:29 pm
by underFlo
Sounds like you're using outdated LunaLua and the API.load in the 1st line errors, but I can't tell for sure until I've seen the error.