Skip to content

[SUGOI] Make stagefailed more useful, add linedef executor to toggle, and expose to Lua

Sal requested to merge TehRealSalt/SRB2:failed-level-lua into next
  • Can now apply to normal stages, simply defaults to "false" in normal stages.
  • Post-level cutscenes are now always skipped when the stage was failed.
  • Normal stage intermission shows the level title (to match Special Stages just saying "Special Stage" when you fail them)
  • Normal stage intermission zeroes-out Time and Guard bonuses.
  • Exposes the boolean as a Lua read+write global.
  • Adds linedef executor type 466, which toggles the level fail state through the map itself. By default, it will mark the stage as failed. Checking No Climb will mark the stage as successful.

Desired for SUGOI, as the stagefailed boolean prevents level completion flags to not update, and thus level completion emblems to not be awarded. This means a lot less crappy non-ideal workarounds. Can also be incredibly useful for custom Special Stage designs, or even unique normal stage concepts.

srb20492

Fixes #361 (closed), although it is not the proposed method. I chose this method instead because it is less redundant with code that is already in vanilla.

Also considered adding a "failnext" level header option, for determining where you go when you fail a level VS when you successfully complete it, but I decided that's out-of-scope for this branch -- Lua can handle that well enough.

EXE: srb2win_failed-level-lua.exe Test script -- stage will fail when you have less than 50 rings: failure-test.lua

Edited by Sal

Merge request reports