Jump to content
LaunchBox Community Forums

Visual Pinball X – Top Scores (hiscore) Viewer


Recommended Posts

Visual Pinball X – Top Scores (hiscore) Viewer

View File

View the Top Scores for your Visual Pinball X Tables (LaunchBox only)

This plugin uses DNA Disturber’s PINemHi app to read a tables top scores that are stored in the nvram files created by VPinMAME.  PINemHi currently it supports 425 roms.

(Oct. 8, 2021 Updated to v1.1.  See change log for details)

Instead of scrolling through these (in game)

hs1_custom.png.5feb6fdd1a805c5e8e43b81186d1dbc8.png hs1a_custom.png.d170d79d76edcfe072a1ac501acaf227.png hs2_custom.png.972b3cc701b92dba58175508648bfb08.png

 hs3_custom.png.11e243afbc542967794908b6826c86e9.png hs4_custom.png.f936f7b942c8960b79d5a73b287e68b9.png

See this (in LaunchBox)

hs5.thumb.jpg.7ad2b7f37606549e6fe0a2d0065d6726.jpg

 

If you’ve signed up on the PINemHi Leaderboard site, this plugin will also let you view your Personal Top 10 Scores (these scores are tracked separately from the Tables’ top scores) as well as the Best Top 10 Scores on the Leaderboard.  Signing up is free and you only need to provide a username.  No email address, proof of citizenship nor vaccinations required.  (See Top 10 Scores below)

Requirements

  • This plugin downloaded and setup (see Setting up the plugin below).
    • PINemHi v3.3.1 (included with the plugin download)
  • The emulator the table uses needs to point to “VPinballX.exe”.  This is needed to get the rom info for the table(s).

Optional Requirements

  • Sign up for PINemHi Leaderboards. (see Top 10 Scores below)

Setting up the plugin

  1. Download and unblock the zip file. (right click the file, select properties and check the Unblock check box and click OK)
  2. Copy the VPXHiScores folder (from inside the zip) into your \LaunchBox\Plugins\ folder
  3. Edit the pinemhi.ini file (\LaunchBox\Plugins\VPXhiScores\PINemHi\pinemhi.ini)
    • Under [paths] (10th line down), edit the path to the Visual Pinball (VP) “nvram” folder located inside your Visual Pinball installation.  (example)
      • VP=D:\Emulators\Visual Pinball\VPinMAME\nvram\
    • The path MUST end with a slash!!
  4. (optional) Under [user] (line 25), type in your PINemHi Leaderboard name and code. (see Top 10 Scores below)
  5. Save and Close pinemhi.ini

Using the plugin

  1. Start LaunchBox.
  2. Right click on one of your VPX tables and select View VPX Table HiScores. (see What to expect below)
  3. Click anywhere on the popup window and drag to move it.
  4. Click a button at the top of the window to view the different Top Scores. (see Top 10 Scores below)
  5. Click the red “X” to close.

How it works
To get the top scores for a table, we 1st need to know which VPinMAME rom it’s using.  To get this, the plugin uses VPinballX.exe to extract the table’s script.  It then searches the script for the name of the rom that table uses.  The rom name is then passed to pinemhi.exe which extracts the top scores from the nvram file associated with the rom.

What to expect
The 1st time you run the plugin for a given table, you will see the Visual Pinball editor window appear, then close. This is where it extracts the tables’ script. The script gets saved to the same folder as the VPX table, using the exact same name as the table but with a .vbs file extension.  Depending on the table, the .vbs file will be somewhere between 20 KB and 150 KB in size.

The next time you go to view that tables’ top scores, the plugin will see the .vbs file and not extract it [again].  So you won’t see the VPX editor window unless you delete/move the tables’ .vbs file.

Top 10 Scores
To be able to view your Personal Top 10 and Best Top 10 scores, you need to sign up at http://pinemhi.com/hiscores.php.  This is where you’ll get your name and code to add to “pinemhi.ini “. (See note #4 under Setting up the plugin [above])

You will also need to have PINemHi’s Rom Monitor (“pinemhi_rom_monitor.exe”) running.  This is a tiny executable that runs in the background and detects when a VPX table is loaded and then keeps track of your Personal top scores as well as downloads the Best Top 10 scores for that table. 

Please read through “PINemHi LeaderBoard installation and config.txt” located in the plugin folder.

  • (\LaunchBox\Plugins\VPXhiScores\PINemHi\ PINemHi LeaderBoard installation and config.txt)

Some main points in the documentation (for use with this plugin):

  • Setup your Visual Pinball (VP) path and user (name) and code.
  • **Keys** Make note of which shortcut keys do which action. There are 5 different hotkeys.  Change them as necessary. Controller buttons are also supported.
  • Run “pinemhi_rom_monitor.exe”.

Other IMPORTANT notes: ****

  • “…set the pinemhi_rom_monitor file to always execute with administrator rights.” 
  • “The pinemhi_rom_monitor.exe was made with AHK (AutoHotkey).
    • Microsoft Defender will frequently call AHK executables to be a virus/trojan 
    • This is a false positive. Feel free to test it with other anti-virus programs
    • There is an option in Microsoft Defender to allow the program to still be used (make an exception for that file)”

****For me, setting the Rom Monitor to run as Admin created issues.  As in it would not start.  I get the message “The requested operation requires elevation”.

The fix (what worked for me):

  • Follow step #1 in Setting up the plugin.  Specifically, unblock the zip file before extracting
  • Do not set pinemhi_rom_monitor.exe to “Run this program as an Administrator”.

With this, I would still get the UAC prompt when trying to run it from Windows Explorer.  However, when starting it from within LaunchBox. (See Starting/Stopping pinemhi_rom_monitor.exe below) it ran just fine.

Results may vary. This is what happened on both my main PC and on my cab. There’s a good chance both computers are slightly wonky, and that indeed you DO need to run the Rom Manager with admin rights.  So if one way doesn’t work, try the other.

Starting/Stopping pinemhi_rom_monitor.exe
You can toggle the Rom Monitor On/Off from the Tools menu.  Depending on its state, you’ll see this:
 not.png.59754b0b617e3f2551ffc45f0d5752f9.png
Or this:
 is.png.3c61a654c0b6eaa07c78245a18fe0056.png

When you launch a Table with PINemHi Rom Monitor running, you’ll get a popup after the table loads showing your Top 10 Scores. Press “L” on your keyboard to have it go away (unless you changed “key=L” in the pinemhi.ini file).  This is a nice indicator that the Rom Monitor is running and that your Personal Top Score will be saved.

PINemHi Leaderboard

Along with Personal Top Scores, PINemHi Leaderboard has some other cool features not directly accessible through this plugin like daily, weekly and 5-minute challenges. (These are accessible using the shortcut keys mentioned above.) It tracks Player 1 scores [aka Personal Top 10 Scores] as well as Special Scores (i.e. 20 loops [Back To the Future] or 50 martians killed [Attack From Mars]).  You can add up to 9 friends and view each other’s top scores.  There are also a number of Badges that can be earned on various tables.

Main Site:                       http://www.pinemhi.com/
Leaderboard:                 http://pinemhi.com/hiscores.php
VPForums discussion:  https://www.vpforums.org/index.php?showtopic=44580

 

Special thanks to DNA Disturber for creating PINemHi for the Visual Pinball community and allowing permission to use it here, making this plugin possible!!


 

  • Like 2
Link to comment
Share on other sites

  • 1 year later...
2 hours ago, carter8189 said:

is it possible to view the same windows on big box? maybe similar to achievements section, thanks!

EDIT: i've noticed that if i run a game through launchbox, my personal score is saved, running through Big Box NOT, maybe because plugin is for LB only? Thanks

Ya, it's in the fine print at the top of the page..

Quote

View the Top Scores for your Visual Pinball X Tables (LaunchBox only)

Though to be honest, I had to look around for it myself. ;) 

 

In order to make this work "properly"* in BigBox, I would need to rewrite some of the code and then 'you' would need to edit/modify the BigBox Theme you use.  Which if I recall correctly, the latter is just adding two lines to one of the xaml View files.

*By "properly", I mean being able to use a controller to navigate within the window and also close it.

That said, here's a 'Special Edition' that will show the option to view the table's hi scores in BigBox's game menu.  The option will be at the bottom of the game menu items and called VPX hiscore test.  When selected, this will show "the same window" as you see via LaunchBox.  The caveat is that you will have to use your computer mouse to navigate and close the window.  You won't be able to use a controller.  VPXhiScores (v1.2-SE).7z  It probably won't be an enjoyable experience, but it will work.  If you have a trackball and a button assigned to mouse-left-click on your cab, you could probably navigate it that way (mine actually does happen to have those).

 

Regarding your personal scores being saved, LaunchBox, BigBox nor the plugin have anything to do with that.  The high scores are read from the files that VPX saves.  So, if you launched a table from BigBox and finished a game to where you got to enter your initials, those scores should be saved by the emulator.  Now, whether the plugin reads the updated scores right away or not, I'd have to look at the code.  But if you restarted to LB after entering your initials, the score should for sure, show then.  And when you load that table again, it should show in there also.

 

Based on all the comments and reviews this plugin has received over the past 2 years, I most likely will not be making a controller compatible BigBox version of the plugin.

 

Link to comment
Share on other sites

Thank you for your kind reply and your effort for the big box edition! First, sorry i miss the lb only disclaimer, my fault. Secondly, regarding my question about not saving my personal best, i found what the problem was: killing at the same time vpx and pinemhi_rom_monitor, so the second had no time to create/copy/update the personal score txt file; i simply modify the exit script with a sleep of 5 seconds beetween vpx exit and rom_monitor closing. After that, everything fine. Regarding comments and reviews, i feel a bit confusing, definetely your plugin is very helpful because playing and chasing myself to reach a better score, is a strong part of every pinball game! The best would be give the opportunity to save personal score with a specific name (o initial), at least locally, i mean: if a friend comes to my house and we chase for the best scores, would be great if the score he reaches would be registred with a different nick, instead the same ID (editing manually ini file after every play crearly is not passable). Thanks!

Link to comment
Share on other sites

4 hours ago, carter8189 said:

regarding my question about not saving my personal best, i found what the problem was: killing at the same time vpx and pinemhi_rom_monitor, so the second had no time to create/copy/update the personal score txt file; i simply modify the exit script with a sleep of 5 seconds beetween vpx exit and rom_monitor closing.

Ah, ok.  The PINemHi Leaderboard high scores.  Nice fix.  Sounds a lot easier than going to the Tools menu and manually turning the monitor off there.  ;) 

 

4 hours ago, carter8189 said:

give the opportunity to save personal score with a specific name (o initial), at least locally, i mean: if a friend comes to my house and we chase for the best scores, would be great if the score he reaches would be registred with a different nick, instead the same ID (editing manually ini file after every play crearly is not passable).

I haven't done much with PINemHi beyond testing while writing the plugin 2 years ago.. are you able to change the "name" and still use the same "code" [in pinemhi.ini]?  Or does the friend need to have their own code as well?

Also, when you do change the name (and code?) in the ini file, do you need to stop and restart the pinemhi_rom_monitor?  Or does it seem to read the ini file each time when saving to TOP10_xxxx files?

If it needs to be changed before launching a table, you could create an AHK script (or batch file or PowerShell script) and set that as an Additional App to Run Before the game (table) launches and have it Wait For Exit.  The script would show a popup and have you select a player (or add a new player) and then write that players nickname ("name") to the ini file.  (Replacing the previous "name").  Ya, involves a little setup work, but once setup, it's easy-going from there.  What I'm getting at is that 'it is possible'. ;)  This also assumes you can modify the ini file on-the-fly without having to stop/restart the rom_monitor.  Actually, the script could do that too.

Link to comment
Share on other sites

On 8/14/2023 at 12:43 AM, carter8189 said:

would be great if the score he reaches would be registred with a different nick, instead the same ID (editing manually ini file after every play crearly is not passable)

When you edit the ini file (pinemhi.ini), if you ONLY need to change the "name" (and not the "code" also), here's an AutoHotkey script you can set as an Additional App that will let you change the "name" before launching the table.  If you have to change the "code" also, this won't work.  The only [other] caveat is that you need to turn off the Game Startup Screens.  Otherwise, the popup this script produces is behind the startup screen.

image.png.df7a5ee59f61d9f00b360d8d94758034.png

 

To make this work, create 2 files, add an Additional App and turn off the Startup Screens.  Easy peasy.

Create a new text file and paste the code below into it.  Change the 1st 2 lines to point to your PINemHi folder.  Save and close.  Rename the file to whatever you want and change the file extension to ".ahk".  i.e. ChangeUser.ahk  (make sure it doesn't get saved as ChangeUser.ahk.txt)

Next, in your PINemHi folder (same place as your pinemhi.ini file), create another new text file called "user" (user.txt).  In this file, list the different users' names you want to select from.  One name per line.

In LaunchBox, edit one of your tables and add a new Additional Application.  Give it a name.  Browse to the path \LaunchBox\ThirdParty\AutoHotkey\ and select the file AutoHotkey.exe.  For the Command Line Parameters, put, in "quotes", the full path to the .ahk file you created earlier.  Check Automatically Run Before... AND Wait For Exit.  Click OK to save.

image.thumb.png.c50b40a0d8d9591a4078cc366d4ca5c1.png

 

The script will read your pinemhi.ini for the current "name" and set that as the default name in the combo box.  It also reads the user.txt file and adds those names to the box.  Clicking Select will change the name value in pinemhi.ini to the name you have selected.

image.png.dcfadcf9f32db71f4fed3b2c4d95f61c.png

 

The script:

iniOne = D:\LaunchBox\Plugins\VPXhiScores\PINemHi\pinemhi.ini
iniTwo =  D:\LaunchBox\Plugins\VPXhiScores\PINemHi\users.txt

if not FileExist(iniOne)
{
   MsgBox, pinemhi.ini does not exist in this folder
   ExitApp
}
if not FileExist(iniTwo)
{
   MsgBox, users.txt does not exist in this folder
   ExitApp
}

IniRead, currName, %iniOne%, user, name

Loop, Read,  %iniTwo%
   usersNames = %usersNames%|%A_LoopReadLine%
usersNames = %usersNames%|%currName%||

Gui, Add, ComboBox, W180 vmyCombo, % SubStr(usersNames, 2)
Gui, Add, Button, y6 x200 gChangeUser, Select
Gui, Add, Button, y+75  gCancel, Cancel

Gui, Show,W250 h149, Select user
WinWaitClose, Select user
ExitApp

ChangeUser:
GuiControlGet, newName,,myCombo
IniWrite, %newName%, %iniOne%, user, name 
MsgBox,,Change Complete, User name has been changed to:`r`r`t%newName%

Cancel:
ExitApp

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...