playerphysicspatch.lua - now in 2 flavors

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

BrokenAce
Bot
Bot
Posts: 51
Joined: Sat Feb 06, 2016 11:48 am

Re: playerphysicspatch.lua - smbx controls like gunk

Postby BrokenAce » Sun Jul 10, 2022 3:39 pm

I just tried this out in Beta 4 and it does absolutely nothing. What gives? Am I missing something?

Ness-Wednesday
Purple Yoshi Egg
Purple Yoshi Egg
Posts: 1663
Joined: Sun Jun 28, 2015 3:50 pm
Flair: Diverse Scouts
Pronouns: He/Him

Re: playerphysicspatch.lua - smbx controls like gunk

Postby Ness-Wednesday » Sun Jul 10, 2022 3:46 pm

BrokenAce wrote: I just tried this out in Beta 4 and it does absolutely nothing. What gives? Am I missing something?
Did you try loading the API in a local Lua file?

BrokenAce
Bot
Bot
Posts: 51
Joined: Sat Feb 06, 2016 11:48 am

Re: playerphysicspatch.lua - smbx controls like gunk

Postby BrokenAce » Sun Jul 10, 2022 5:07 pm

Ness-Wednesday wrote:
Sun Jul 10, 2022 3:46 pm
BrokenAce wrote: I just tried this out in Beta 4 and it does absolutely nothing. What gives? Am I missing something?
Did you try loading the API in a local Lua file?

What's an API? If that's an alternate name for the code itself then yes I have tried that.

Edit: Never mind, just me being a noob. Turns out just I forgot to put the Require in my luna.lua.
Last edited by BrokenAce on Thu Aug 18, 2022 4:42 pm, edited 1 time in total.

deice
Rocky Wrench
Rocky Wrench
Posts: 622
Joined: Fri Jul 23, 2021 7:35 am

Re: playerphysicspatch.lua - smbx controls like gunk

Postby deice » Sun Jul 10, 2022 5:16 pm

BrokenAce wrote:
Sun Jul 10, 2022 5:07 pm
What's an API? If that's an alternate name for the code itself then yes I have tried that.
just for the record, i believe they mean "library" and not "API". an API is something else entirely.
in any case, if creating a file called "luna.lua" in the episode/level folder and placing

Code: Select all

require("playerphysicspatch") 
inside doesn't work then it's hard to say what the problem might be if you have no other libraries loaded which could be interfering.

BrokenAce
Bot
Bot
Posts: 51
Joined: Sat Feb 06, 2016 11:48 am

Re: playerphysicspatch.lua - smbx controls like gunk

Postby BrokenAce » Wed Aug 24, 2022 8:09 pm

Yoshi Milkman wrote:
Sun Sep 13, 2020 6:55 pm
A fix to this would be greatly appreciated
JamesR624 wrote:
Wed Jul 29, 2020 3:18 pm
This is awesome but I do wanna mention that it seems to really mess up "slippery physics". Now anything with the slippery property is more like slime. It INCREASES friction with this patch on as opposed to decreasing which is what it's supposed to do.

I actually found a fix for this; if you change 0x3C to 0x0A on the 25th line, it'll disable the patch for players who are touching ice. However, since this is an edit to the slope-sliding patch, it also comes at the sacrifice of smooth slope sliding. There's probably a way to have both "fixes" active at once, if you know your way around the code (unfortunately I don't).

MarioChallengerX2
Buster Beetle
Buster Beetle
Posts: 89
Joined: Sat Dec 31, 2022 4:34 pm
Pronouns: he/him

Re: playerphysicspatch.lua - smbx controls like gunk

Postby MarioChallengerX2 » Sat Jan 07, 2023 9:36 pm

Uh, I'm blind. I can't tell what's different here. Is it speed? Or smoother control?

MrDoubleA
Edward
Edward
Posts: 394
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?

Re: playerphysicspatch.lua - smbx controls like gunk

Postby MrDoubleA » Sun Jan 08, 2023 9:05 am

MarioChallengerX2 wrote:
Sat Jan 07, 2023 9:36 pm
Uh, I'm blind. I can't tell what's different here. Is it speed? Or smoother control?
Faster acceleration and deceleration. Also, you decelerate in the air.

NoMoreStars
Bob-Omb
Bob-Omb
Posts: 22
Joined: Sat Jun 06, 2015 1:58 am
Flair: I'M A STONE LUIGI
Pronouns: She/Her

Re: playerphysicspatch.lua - smbx controls like gunk

Postby NoMoreStars » Wed Feb 21, 2024 11:03 pm

Has anyone been able to recreate SMW-esque physics using this? And if so, what variables should be changed?

mariobrigade2018
Rocky Wrench
Rocky Wrench
Posts: 682
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: playerphysicspatch.lua - smbx controls like gunk

Postby mariobrigade2018 » Thu Feb 22, 2024 12:00 am

BrokenAce wrote:
Wed Aug 24, 2022 8:09 pm
Yoshi Milkman wrote:
Sun Sep 13, 2020 6:55 pm
A fix to this would be greatly appreciated
JamesR624 wrote:
Wed Jul 29, 2020 3:18 pm
This is awesome but I do wanna mention that it seems to really mess up "slippery physics". Now anything with the slippery property is more like slime. It INCREASES friction with this patch on as opposed to decreasing which is what it's supposed to do.

I actually found a fix for this; if you change 0x3C to 0x0A on the 25th line, it'll disable the patch for players who are touching ice. However, since this is an edit to the slope-sliding patch, it also comes at the sacrifice of smooth slope sliding. There's probably a way to have both "fixes" active at once, if you know your way around the code (unfortunately I don't).
If you want a jank-ish fix for this, then you go to line 25 and add this:

Code: Select all

or player:mem(0x0A, FIELD_BOOL)
after player:mem(0x3C, FIELD_BOOL). this won't play nice when jumping/falling off of slippery tiles, and it won't feel exactly like the normal ice physics, but hey, ice worlds are now a possibility.

Just_Thomas
Spike
Spike
Posts: 296
Joined: Sat Dec 16, 2023 3:32 am
Pronouns: he/him

Re: playerphysicspatch.lua - smbx controls like gunk

Postby Just_Thomas » Thu Feb 22, 2024 2:31 am

I've only just come across this find here. It actually looks as if you can imitate the SMB1 (Lost Levels) behavior a little, doesn't it? Is the default configuration already recommended or would there even be recommendations on how to change it?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: playerphysicspatch.lua - now in 2 flavors

Postby Emral » Thu Feb 06, 2025 9:24 pm

Since my chocolate contest level I've been chipping away at a 2nd flavor of this script.
Introducing playerphysicspatch shmoove mode.
https://pastebin.com/r4bdCxTN

This variant of the script comes with a few changes.
- The aerial idle deceleration defaults to no deceleration.
- The script overwrites the use of Defines.walkspeed and Defines.runspeed, dynamically altering them to let you exceed the run speed cap.
-- It is possible to exceed the run speed cap by sliding, hitting bumpers, hitting springs, using starman, clear pipes, barrels, and other things that mess with your x speed

This variant of the script comes with a few bug.
- If you jump up into a slope the game freaks the fuck out and I don't know why and if someone smart is reading this and bored, please help me AAAAA

So if that bothers you just make sure to use it in a level without a lot of slopes for now lol

enjoy!

i've also added a new section to the bottom of the first post for configs! if you've ever customized physicspatch and really liked how it felt, leave a reply and i'll add it to the first post!

madman
Shy Guy
Shy Guy
Posts: 6
Joined: Wed May 01, 2024 12:50 pm

Re: playerphysicspatch.lua - now in 2 flavors

Postby madman » Thu Feb 06, 2025 11:56 pm

ooooh, this was already one of my favorite scripts, thanks for the update

edit: I'm getting a 404 on pastebin, "This paste has been deemed potentially harmful. Pastebin took the necessary steps to prevent access on February 6, 2025, 11:26 pm CST. If you feel this is an incorrect assessment, please contact us within 14 days to avoid any permanent loss of content."

could be I just need to be patient to wait for it to get approved idk

mariobrigade2018
Rocky Wrench
Rocky Wrench
Posts: 682
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: playerphysicspatch.lua - now in 2 flavors

Postby mariobrigade2018 » Fri Feb 07, 2025 12:53 am

madman wrote:
Thu Feb 06, 2025 11:56 pm
ooooh, this was already one of my favorite scripts, thanks for the update

edit: I'm getting a 404 on pastebin, "This paste has been deemed potentially harmful. Pastebin took the necessary steps to prevent access on February 6, 2025, 11:26 pm CST. If you feel this is an incorrect assessment, please contact us within 14 days to avoid any permanent loss of content."

could be I just need to be patient to wait for it to get approved idk
Could be the case. I downloaded it before it got taken down, so I'll keep it here until whatever happened gets resolved:
https://drive.google.com/file/d/1WZMvoe ... sp=sharing

Added in 1 minute 52 seconds:
anyways, I notice that for some reason it doesn't look like it's multiplayer compatible, so that may be the next thing I'll try to tackle.

EDIT: There is now a new update to the uncapped physics patch, so go download that in the first post. This is kept here for archival purposes.
Last edited by mariobrigade2018 on Sun Feb 09, 2025 2:46 am, edited 1 time in total.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: playerphysicspatch.lua - now in 2 flavors

Postby Emral » Fri Feb 07, 2025 8:50 am

i contacted pastebin about the issue... thanks for the backup

mariobrigade2018
Rocky Wrench
Rocky Wrench
Posts: 682
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: playerphysicspatch.lua - now in 2 flavors

Postby mariobrigade2018 » Fri Feb 07, 2025 12:33 pm

Emral wrote:
Fri Feb 07, 2025 8:50 am
i contacted pastebin about the issue... thanks for the backup
Yea no problem.

Something I did note is that the player animation acts like they're walking when running. I'm pretty sure that because of the defines change, so what I want to know is if there's any way to override the normal animation.

Added in 10 minutes 12 seconds:
also forgot to ask this but how is it "Fucked up on slopes!!!! SOMEONE HELP ME!!! OH NO!!!"

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 544
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: playerphysicspatch.lua - now in 2 flavors

Postby Marioman2007 » Sat Feb 08, 2025 12:16 am

mariobrigade2018 wrote:
Fri Feb 07, 2025 12:43 pm
Something I did note is that the player animation acts like they're walking when running. I'm pretty sure that because of the defines change, so what I want to know is if there's any way to override the normal animation.

Setting Defines.player_walkspeed and Defines.player_runspeed to WALKSPEED and RUNSPEED in onTick seems to fix the animation.

One bug I found is that the player is unable to fly with the leaf and tanooki suit.

mariobrigade2018
Rocky Wrench
Rocky Wrench
Posts: 682
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: playerphysicspatch.lua - now in 2 flavors

Postby mariobrigade2018 » Sat Feb 08, 2025 1:20 am

Marioman2007 wrote:
Sat Feb 08, 2025 12:16 am
mariobrigade2018 wrote:
Fri Feb 07, 2025 12:43 pm
Something I did note is that the player animation acts like they're walking when running. I'm pretty sure that because of the defines change, so what I want to know is if there's any way to override the normal animation.

Setting Defines.player_walkspeed and Defines.player_runspeed to WALKSPEED and RUNSPEED in onTick seems to fix the animation.
Doing that won't add the extra speed the star or slope gives you.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: playerphysicspatch.lua - now in 2 flavors

Postby Emral » Sat Feb 08, 2025 6:33 am

mariobrigade2018 wrote: also forgot to ask this but how is it "Fucked up on slopes!!!! SOMEONE HELP ME!!! OH NO!!!"
you clip into upwards slopes and straight up pass through upwards semisolid slopes. i think slopes just simply arent made for these kinds of speeds but i dont know the source code well enough to make sense of it.

Image

Anyway here's a new link that fixes multiplayer, pspeed and run animation. I added a new flag: "lenientPSpeed". If you enable this, the flight timer doesn't instantly deplete when landing without sufficient speed. It is a mode more lenient than basegame SMBX, and you might find it fun. It is disabled by default.
https://pastebin.com/HJ8jMeKA

mariobrigade2018
Rocky Wrench
Rocky Wrench
Posts: 682
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: playerphysicspatch.lua - now in 2 flavors

Postby mariobrigade2018 » Sat Feb 08, 2025 1:16 pm

Emral wrote:
Sat Feb 08, 2025 6:33 am
mariobrigade2018 wrote: also forgot to ask this but how is it "Fucked up on slopes!!!! SOMEONE HELP ME!!! OH NO!!!"
you clip into upwards slopes and straight up pass through upwards semisolid slopes. i think slopes just simply arent made for these kinds of speeds but i dont know the source code well enough to make sense of it.

Image
I see. Well today, MDA showcased a WIP Sonic in the SMBX discord, so it may help you with the slopes whenever it comes out? Not sure.
Emral wrote:
Sat Feb 08, 2025 6:33 am
Anyway here's a new link that fixes multiplayer, pspeed and run animation. I added a new flag: "lenientPSpeed". If you enable this, the flight timer doesn't instantly deplete when landing without sufficient speed. It is a mode more lenient than basegame SMBX, and you might find it fun. It is disabled by default.
https://pastebin.com/HJ8jMeKA
Just tested the update. Multiplayer and the leaf now work, but the run animation is still not playing properly. Also really appreciate the new settings. Very nice customizability option for this.


Return to “LunaLua”

Who is online

Users browsing this forum: Ewmayro and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari