[v1.1] noHitHelper.lua - Streamline level reloading for no-hitting bosses

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

Moderator: Userbase Moderators

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

[v1.1] noHitHelper.lua - Streamline level reloading for no-hitting bosses

Postby FutureNyanCat » Sun Sep 24, 2023 3:52 am

noHitHelper.lua
by FutureNyanCat and MrNameless (with coding assistance from Emral)

This is a simple library me and MrNameless made together to help assist skilled players and playtesters in doing bosses no-hit. This essentially streamlines the level reloading process so that players will simply reload the level if ever they take damage or fall into an insta-kill hazard (like pits or lava), helping them restart runs against bosses quicker without dealing with pause screens or level entry and exiting.

By default, if the player is hit, the entire screen will freeze with a sound cue and muting of music to allow players to assess easier what projectiles/enemies/attacks hit them. There are also configurable settings to enable instant reload and adjust the freeze-frame duration.

If you're really inching to use this library to no-hit FULL levels too, go ahead. Take this at your own risk.

Demonstration
The featured episodes are Epic Neuro Battle (by willie870307), The Princess Cliche (by Redigit), and The Invasion 2 (by Redigit).
v1.1 - NEW - Freeze Frame - Configurable freeze-frame time before the level reloads, allowing the player to assess easier what hit them.
Spoiler: show
Image
v1.0 - Instant Restart
Spoiler: show
Image
Image
Image
Image
Notes
  • The library should work as intended when testing in most episodes, even outside of boss battles. However it may override functions for quick retry from rooms.lua and respawnRooms.lua (or similar scripts), as noHitHelper.lua reloads the level at the exact moment the player dies or takes damage.
  • Do note that this library restarts the player from the last saved checkpoint every time the level is reloaded, so be sure to place checkpoints before bosses when testing them.
  • The library is not recommended to be loaded in levels that rely on taking damage as part of a mechanic, as it can make such a level impossible to beat.
  • This does not account for lives as the level immediately reloads upon dying or taking damage. You won't lose a life this way. Tested via The Invasion 2. However, it accounts for LunaLua-powered death counters as long as the reload is caused by the player dying.
Configurable Settings (v1.1):
  • noHitHelper.instantRestart - (Boolean) Set to true to enable instant reload if the player gets hit. If false, the freeze-frame feature is used.
  • noHitHelper.restartDelay - (Value) Set to any number to increase or decrease the freeze-frame duration. Requires the above setting to be set to "false" before usage.
DOWNLOAD (Current ver: 1.1)

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

[v1.1] noHitHelper.lua - UPDATE!

Postby FutureNyanCat » Mon Sep 25, 2023 7:19 am

v1.1 - Freeze-Frame Mode
New to v1.1 of noHitHelper.lua is Freeze-Frame, which causes the entire screen to freeze as soon as the player gets hit. A short amount of time will pass before the level reloads. To indicate this further, a sound cue is played (default is 54 - Player Died 2) and will also mute any playing music. This is also configurable too - see the documentation in the downloads or check the first post!

This code was implemented by MrNameless.

Demonstrated in The Princess Cliche (by Redigit):
Spoiler: show
Image


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 5 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari