The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: BlackBadger22 on August 22, 2017, 07:32:11 pm

Title: Auto Load "Save States"
Post by: BlackBadger22 on August 22, 2017, 07:32:11 pm
Im running Mame64 through a front end.

My goal is this
When game is selected and loaded up that it automatically goes to a save state that has "set number" of credits pre inserted.
I always have friends playing on my machines and I feel it isn't as fun without a little challenge.
Basically that game will load right to the save state where the credits are loaded and you have to press start and when you are out the only thing to do is back out of the game.

HELP ME ARCADE WORLD!!
Title: Re: Auto Load "Save States"
Post by: headkaze on August 23, 2017, 11:22:28 am
You can use MAME's Lua plugin system to do this.

I just quickly modified my savestate_plugin.zip (http://headsoft.com.au/download/mame/savestate_plugin.zip) (untested):
Code: [Select]
-- license:BSD-3-Clause
-- copyright-holders:Ben Baker
local exports = {}
exports.name = "savestate"
exports.version = "0.0.1"
exports.description = "SaveState plugin"
exports.license = "The BSD 3-Clause License"
exports.author = { name = "Ben Baker" }

local savestate = exports

function savestate.startplugin()
emu.register_prestart(function()
end)

emu.register_start(function()
manager:machine():load("auto")
end)
   
emu.register_stop(function()
end)

emu.register_pause(function()
end)

emu.register_resume(function()
end)
end

return exports

All it does is load the save state "auto" when the game starts. You can change it to whatever name you want. So all you have to do is set the game up how you want then save the state with the name you want and it should auto-load to this state.
Title: Re: Auto Load "Save States"
Post by: abispac on August 23, 2017, 04:22:17 pm
load games,insert credits ,exit game, go to savesta folder, set properties to read only. you are done