Power Up and Damage Pause Code. Should be Conflictless.
Posted: Wed Oct 19, 2022 4:47 pm
This is my first post here, hello!
I wrote a script that adds damage pause to the game. It notes whether it's supposed to happen or not so things like the SMB2 Timer powerup still work, and it shouldn't conflict with other code or affect existing level geometry.
There's already a script that does something like this, but it made springs in certain levels disappear as a side effect. As a result it made progression impossible when I was playing with my little bro. I decided to rewrite the function from scratch in a way that shouldn't conflict with anything. I figured it's in good etiquette to link the file anyways, as it inspired this whole thing:
Unlike mine currently, this script pauses other players as well, so it would be nice if you could check it out here: viewtopic.php?f=101&t=28358
If my current LUA experience hasn't failed me, this code should be immune to any edge cases.
I wrote a script that adds damage pause to the game. It notes whether it's supposed to happen or not so things like the SMB2 Timer powerup still work, and it shouldn't conflict with other code or affect existing level geometry.
Here is a link to the .lua:
https://pastebin.com/HA36zjCR
Code: Select all
require("base/game/DamagePause");
Unlike mine currently, this script pauses other players as well, so it would be nice if you could check it out here: viewtopic.php?f=101&t=28358
If my current LUA experience hasn't failed me, this code should be immune to any edge cases.
If you find any bugs, let me know so I can fix them!
Known bugs:- Does not freeze the other player during multiplayer (I will make instructions to disable the fix for preference.)