Power Up and Damage Pause Code. Should be Conflictless.

Share and discuss custom LunaLua code and content packs for SMBX2.
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.)

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

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

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


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest