Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

IrisZeppelinFan
Shy Guy
Shy Guy
Posts: 5
Joined: Mon May 17, 2021 7:52 pm

Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby IrisZeppelinFan » Mon May 17, 2021 8:56 pm

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?

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby Hoeloe » Tue May 18, 2021 8:32 am

There is no savestate system in SMBX. It's not an emulator.

IrisZeppelinFan
Shy Guy
Shy Guy
Posts: 5
Joined: Mon May 17, 2021 7:52 pm

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby IrisZeppelinFan » Tue May 18, 2021 12:51 pm

That’s not what this post said:

viewtopic.php?t=15461

Am I misunderstanding something?

ShadowXeldron
Snifit
Snifit
Posts: 232
Joined: Sun Dec 08, 2019 8:21 am
Flair: phpBB > ProBoards
Pronouns: He/Him
Contact:

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby ShadowXeldron » Tue May 18, 2021 4:53 pm

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.

IrisZeppelinFan
Shy Guy
Shy Guy
Posts: 5
Joined: Mon May 17, 2021 7:52 pm

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby IrisZeppelinFan » Wed May 19, 2021 12:39 am

Thanks. How do I open a .lua file?

ShadowXeldron
Snifit
Snifit
Posts: 232
Joined: Sun Dec 08, 2019 8:21 am
Flair: phpBB > ProBoards
Pronouns: He/Him
Contact:

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby ShadowXeldron » Wed May 19, 2021 3:40 am

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.

IrisZeppelinFan
Shy Guy
Shy Guy
Posts: 5
Joined: Mon May 17, 2021 7:52 pm

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby IrisZeppelinFan » Wed May 19, 2021 4:58 pm

And where can I find the luna.lua file?

ShadowXeldron
Snifit
Snifit
Posts: 232
Joined: Sun Dec 08, 2019 8:21 am
Flair: phpBB > ProBoards
Pronouns: He/Him
Contact:

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby ShadowXeldron » Thu May 20, 2021 9:21 am

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.

IrisZeppelinFan
Shy Guy
Shy Guy
Posts: 5
Joined: Mon May 17, 2021 7:52 pm

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby IrisZeppelinFan » Sat May 22, 2021 6:54 pm

Sorry to ask (am novice), but where is the editor to open?

ShadowXeldron
Snifit
Snifit
Posts: 232
Joined: Sun Dec 08, 2019 8:21 am
Flair: phpBB > ProBoards
Pronouns: He/Him
Contact:

Re: Didn’t know where to ask, but what buttons do I use to activate the savestate function?

Postby ShadowXeldron » Sun May 23, 2021 6:55 am

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.


Return to “Help and Support”

Who is online

Users browsing this forum: Blue Tangerine and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari