eventleveltimer.lua
Posted: Sun Jul 02, 2017 11:46 pm
So this is a pretty simple edit of leveltimer.lua that makes a few changes that make it a bit easier to use in my opinion.
Changes:
-You can now use an SMBX event called Timer=(Number) to set the timer instead of doing it in lunadll.lua. Now you can just use the API in the lunaworld.lua file even if you want different times in different levels. I recommend making an autostart event with that name in every level and no other Timer= event.
-You can use an event called Timer+(Number) to add to the timer, a feature new to this patch (won't exceed 999). +(Number) flashes below the timer and plays the "increase.wav" sound effect in the folder. (Default is the "inventory" sound from Super Mario Bros 3) I recommend attaching this event to an axe.
-Minor changes to help center the text at the end of a level a bit better.
-Running out of time SFX will no longer play if the level already starts with less than 100 seconds. If you do want the sound to play simply go to line 77 and replace it with this:
I'm absolutely not an expert in Lua so the new code is fairly messy and patchy, but it seems to work without issue under normal circumstances (and by that I mean the player can't screw it up if it's implemented normally). If you run into bugs, please let me know.
Download:
http://www.mediafire.com/file/bvn1knxk3 ... ltimer.zip
To use, just load the API "eventleveltimer" in the lunaworld.lua file.
Changes:
-You can now use an SMBX event called Timer=(Number) to set the timer instead of doing it in lunadll.lua. Now you can just use the API in the lunaworld.lua file even if you want different times in different levels. I recommend making an autostart event with that name in every level and no other Timer= event.
-You can use an event called Timer+(Number) to add to the timer, a feature new to this patch (won't exceed 999). +(Number) flashes below the timer and plays the "increase.wav" sound effect in the folder. (Default is the "inventory" sound from Super Mario Bros 3) I recommend attaching this event to an axe.
-Minor changes to help center the text at the end of a level a bit better.
-Running out of time SFX will no longer play if the level already starts with less than 100 seconds. If you do want the sound to play simply go to line 77 and replace it with this:
Code: Select all
if secondsleft - timeelapsed <= 100 then
Download:
http://www.mediafire.com/file/bvn1knxk3 ... ltimer.zip
To use, just load the API "eventleveltimer" in the lunaworld.lua file.