Author Topic: Problem running mame's hiscore plugin from attract mode  (Read 1207 times)

wrybread

  • Sr. Member
  • ****
  • Posts: 100
    • View Profile
Problem running mame's hiscore plugin from attract mode
« on: June 07, 2022, 02:09:31 PM »
This is driving me nuts, I wonder if anyone has a theory. I'm running mame version 0.175 on Ubuntu, and the hiscore plugin works fine when I run it directly:

Code: [Select]
/home/wrybread/.attract/mame/mame64wry2 -rompath /home/wrybread/.attract/mame/roms -skip_gameinfo -pluginspath /home/wrybread/.attract/mame/plugins -plugin hiscore -verbose mspacman

But when I run mame from Attract Mode the plugin will run but it never loads any high scores.

Attract Mode's mame.cfg file looks like this:

Code: [Select]
executable           $HOME/.attract/mame/mame64wry2

args                 -rompath $HOME/.attract/mame/roms -skip_gameinfo -pluginspath /home/wrybread/.attract/mame/plugins -plugin hiscore  -verbose [name]
 
rompath              $HOME/.attract/mame/roms/
romext               .zip;.7z;<DIR>
system               Arcade
info_source          listxml
artwork    cabinet         $HOME/.attract/mame/cabinets
artwork    flyer           
artwork    marquee         $HOME/.attract/mame/marquees
artwork    snap            $HOME/.attract/mame/videos;$HOME/.attract/mame/snap
artwork    wheel           

When Attract Mode launches a mame ROM the command looks exactly like when I run it directly:

Code: [Select]
Config: /home/wrybread/.attract/attract.cfg

*** Initializing display: 'Every Cocktail Table Game'
 - Loaded master romlist 'cocktail_list' in 4 ms (790 entries kept, 0 discarded)
 - Constructed 2 filters in 0 ms (1580 comparisons)
 - Loaded layout: /home/wrybread/.attract/layouts/WryCadeVert/ (layout.nut)

Running: /home/wrybread/.attract/mame/mame64wry2 -rompath $HOME/.attract/mame/roms -skip_gameinfo -pluginspath /home/wrybread/.attract/mame/plugins -plugin hiscore  -verbose mspacman

But the hiscore plugin never finds any high scores. Every time I run it from AM it says:

Code: [Select]
Starting Ms. Pac-Man
hiscore: found hiscore.dat entry for mspacman
hiscore: scores read FAIL

Even though I can see it writing to the hiscore file during game play:

Code: [Select]
hiscore: write_scores
hiscore: write_scores output
hiscore: write_scores end

My theory is that it's an environmental variable that AM is setting? I tried setting the "workdir" variable in AM's mame.cfg file, but that didn't make any difference for me.

I don't imagine anyone has a theory?

(And on a sidenote, the hiscore plugin wouldn't even load until I put the full path to mame's plugin directory in AM's mame.cfg. In other words, this works: "-pluginspath /home/wrybread/.attract/mame/plugin" but this fails "-pluginspath $HOME/.attract/mame/plugin", even though they both translate to the same thing. )
« Last Edit: June 07, 2022, 09:36:20 PM by wrybread »

wrybread

  • Sr. Member
  • ****
  • Posts: 100
    • View Profile
Re: Problem running mame's hiscore plugin from attract mode
« Reply #1 on: June 07, 2022, 08:27:40 PM »
Aha, got it working by modifying the plugin. On my system that's ~/.attract/mame/plugins/hiscore/init.lua.

(And note that I'm using version 1.0.0 of the hiscore plugin, current version is 1.0.1 but that doesn't work with my version of MAME).

I had to hard code the "hiscore_path". The line was:

local hiscore_path = "hi";

I changed that to:
   
local hiscore_path = "/home/wrybread/.attract/mame/high";

And now all is well in the world.

And here's an odd one though: it doesn't work if I set that path to "/home/wrybread/.attract/mame/hi", which is the normal path it would be using, since that's the subfolder of mame. That was a tough one to figure out, since it made me think hard coding the path wasn't working. If I set it to any subfolder other than "hi" it works fine.

That was a bunch of tricky issues, but I'm super psyched to have high scores finally working on my cabinet. Previously I was using "save state", which kind of works but that means the games are already running when someone starts a game, which is clunky. And it often loses the high scores anyway.

« Last Edit: June 08, 2022, 09:13:49 AM by wrybread »

wrybread

  • Sr. Member
  • ****
  • Posts: 100
    • View Profile
Re: Problem running mame's hiscore plugin from attract mode
« Reply #2 on: June 07, 2022, 09:12:24 PM »
And it looks like another way to fix it could be to use the hiscore.ini file as described here:

http://forum.arcadecontrols.com/index.php?topic=156579.0

That's probably a better option, but I can't figure out where to put hiscore.ini. I tried the mame folder, the plugins folder, and the plugins/hiscore folder, but no joy.

Code: [Select]
hi_path /home/wrybread/test