Page 1 of 1
Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Mon May 17, 2021 8:56 pm
by IrisZeppelinFan
I’ve been trying to do it with the C and D keys as per the original post, but it won’t work. How can I activate it for really difficult episodes?
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Tue May 18, 2021 8:32 am
by Hoeloe
There is no savestate system in SMBX. It's not an emulator.
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Tue May 18, 2021 12:51 pm
by IrisZeppelinFan
That’s not what this post said:
viewtopic.php?t=15461
Am I misunderstanding something?
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Tue May 18, 2021 4:53 pm
by ShadowXeldron
That's a script intended for level creators to add to their levels. Judging by the post, it is built in so you won't need to download anything. Add this to your level/world's luna.lua file:
Code: Select all
local savestate = require("savestate")
savestateTable = {};
function onKeyboardPress(keycode)
if keycode == 0x43 then --C
savestateTable[#savestateTable + 1] = savestate.save();
playSFX(58);
elseif keycode == 0x44 and #savestateTable > 0 then --D
savestate.load(savestateTable[#savestateTable]); --load most recent
end
end
This is pulled directly from one of the links of that post. It also only works with SMBX2. If there isn't a luna.lua, create one.
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Wed May 19, 2021 12:39 am
by IrisZeppelinFan
Thanks. How do I open a .lua file?
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Wed May 19, 2021 3:40 am
by ShadowXeldron
Right click it and open with Notepad. I also just remembered that if the level/episode in question uses onKeyboardPress then it probably won't work, but to my knowledge it's seldom used.
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Wed May 19, 2021 4:58 pm
by IrisZeppelinFan
And where can I find the luna.lua file?
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Thu May 20, 2021 9:21 am
by ShadowXeldron
Luna.lua files should be in the epiosde's folder. If there isn't one, you can create one using the scripts menu in the editor, open any of that episode's levels and choose the episode-wide script. It might ask you what program to use, if you have a code editor such as Visual Studio Code installed, use that. Otherwise, use notepad.
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Sat May 22, 2021 6:54 pm
by IrisZeppelinFan
Sorry to ask (am novice), but where is the editor to open?
Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?
Posted: Sun May 23, 2021 6:55 am
by ShadowXeldron
Do you mean the level editor or the program used to edit the lua code? The scripts menu is on the top of the level editor, and it should ask you which program to open it with.