[Open Assets] Keep Rings and Shields between levels (KeepStatus.lua)

This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.

FuriousFox

AKA FuriousFox
This LUA script will enable you to keep your rings and shields after finishing a level. You will automatically start the next level with whatever you had at the end of the previous level. Works in Co-Op too!

v1.0
Initial Release

v1.1
Fixed compatibility with NiGHTS Special Stages, spectators, custom exits, end of round in Match/CTF, and manual map changes.

v1.2
Fixed a "rings" variable not belonging to a player
Fixed problem where you received extra lives after grabbing a ring when starting a level with over 100 rings
 

Attachments

  • srb20000.gif
    srb20000.gif
    4.2 MB · Views: 810
  • KeepStatus.lua
    915 bytes · Views: 1,121
Last edited:
Already tested and confirmed working online and offline, so welcome to releases!
 
Just did a quick update to make the LUA work with NiGHTS Special Stages and gametypes that have spectators. Also made it so your rings and shields carry over even when the "exiting" state doesn't happen, such as custom exits, end of round in Match/CTF, and manual map changes.
 
I found that if you end a level with 100 rings, once you enter the next level it will award you with an extra life. I don't know how fixable this is but it's pretty silly.
 
I found that if you end a level with 100 rings, once you enter the next level it will award you with an extra life. I don't know how fixable this is but it's pretty silly.

Probably not. I remember Sonic 3 & Knuckles having similar problems when entering the boss part of Lava Reef Act 2.
 
Sounds like you may want to mess with "player.xtralife" - it's a counter to check how many lives have already been given through collecting 100 rings, 200 rings, etc.

EDIT: on an unrelated note, what is "rings != 0" in line 3 all about? "rings" is not the name of a standalone variable that exists in the context of your script, so it'll be seen as "nil" until given a value ...and so "rings != 0" will always be true. May as well get rid of that condition, unless of course you meant to write "player.rings" instead.
 
Last edited:
Sounds like you may want to mess with "player.xtralife" - it's a counter to check how many lives have already been given through collecting 100 rings, 200 rings, etc.

EDIT: on an unrelated note, what is "rings != 0" in line 3 all about? "rings" is not the name of a standalone variable that exists in the context of your script, so it'll be seen as "nil" until given a value ...and so "rings != 0" will always be true. May as well get rid of that condition, unless of course you meant to write "player.rings" instead.

Done and done. v1.2 addresses both of these.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top