Power Up and Damage Pause Code. Should be Conflictless.

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

Moderator: Userbase Moderators

Alucardium
Goomba
Goomba
Posts: 2
Joined: Wed Oct 19, 2022 3:12 pm
Flair: Hobbyist
Pronouns: he/him

Power Up and Damage Pause Code. Should be Conflictless.

Postby Alucardium » 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.

Here is a link to the .lua:
https://pastebin.com/HA36zjCR

Image

I think the way this stuff works you guys can use it when making particular levels. I personally use this in scripts/base/game, and added this line to lunabase.lua under require("base/darkness"):

Code: Select all

require("base/game/DamagePause");
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.

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.)

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

Re: Power Up and Damage Pause Code. Should be Conflictless.

Postby Emral » Wed Oct 19, 2022 10:14 pm

Useful script for episode creators but you should really not meddle with your base installation like this.

Alucardium
Goomba
Goomba
Posts: 2
Joined: Wed Oct 19, 2022 3:12 pm
Flair: Hobbyist
Pronouns: he/him

Re: Power Up and Damage Pause Code. Should be Conflictless.

Postby Alucardium » Thu Oct 20, 2022 9:56 am

Enjl wrote:
Wed Oct 19, 2022 10:14 pm
Useful script for episode creators but you should really not meddle with your base installation like this.
👍 For sure. It's definitely not worked out with larger scope scripts, and It's definitely not something you should do if you're not fine with troubleshooting. So far it's only been fine with smaller scripts, and even then you might have to configure them a bit.

Some examples where it hasn't worked out for me have been the Extended Koopas overhaul that reworks base koopas, and MarioMan's pause menu. On the other hand, it's worked out so far with things like fast fireballs, modern reserve items, anotherPowerDownLibrary (though I personally don't use it), coyotetime, your playerphysicspatch, and shelljumping (though I had to decrease the leniency because you could hurt yourself throwing shy guys).

It heavily depends on how the code itself was designed or meant to be implemented. You definitely need to know the cause and effect of enabling things, because the majority of levels weren't designed with random ol' scripts in mind and vice versa.

FutureNyanCat
Eerie
Eerie
Posts: 765
Joined: Fri Dec 20, 2013 8:39 pm
Flair: Species: Felis robotus
Pronouns: He/Him
Contact:

Re: Power Up and Damage Pause Code. Should be Conflictless.

Postby FutureNyanCat » Wed Feb 15, 2023 7:45 am

By the way if you take damage during editor playtesting and you try to pause the game while everything is paused, the 1.3 pause menu will come up, it will resolve itself if the damage pause stops.

deice
Volcano Lotus
Volcano Lotus
Posts: 596
Joined: Fri Jul 23, 2021 7:35 am

Re: Power Up and Damage Pause Code. Should be Conflictless.

Postby deice » Wed Feb 15, 2023 8:21 am

FutureNyanCat wrote:
Wed Feb 15, 2023 7:45 am
By the way if you take damage during editor playtesting and you try to pause the game while everything is paused, the 1.3 pause menu will come up, it will resolve itself if the damage pause stops.
this is a known quirk of the tester, occurs consistently if Defines.levelFreeze gets set manually through a lua script.

dragonfan96
Foo
Foo
Posts: 831
Joined: Sun Aug 03, 2014 1:42 pm
Pronouns: he/him
Contact:

Re: Power Up and Damage Pause Code. Should be Conflictless.

Postby dragonfan96 » Wed Jul 05, 2023 3:01 am

So um with it using Defines.levelFreeze apart of DamagePause.lua script, it actually makes the stopwatch(and reserve green stopwatch(SMB3)) NPC cease to function..


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 4 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari