Selected Game Filter Variables Panel - mmattner/vPinBackupManagerApp GitHub Wiki

Overview

The Selected Game Filter Variables panel allows users to override the value of variables extracted from game scripts in the case where the extraction panel was unsuccessful in extracting the values.

When viewing backup content, the Selected Game Filter Variables panel becomes a read-only panel and values cannot be updated as shown in the following example.

Various game filters make use of common game values representing items such as the games filename, or the game name itself (often its ROM name in VPX), or associated text files.

To save the user having to manually enter these values, a series of variables are provided that can be included in either the Path or File Filter values on the Selected Game Custom Filters panel.

Because these variables are extracted from game scripts, and game scripts are completely freeform, at times it is not possible to automatically extract values. The Selected Game Filter Variables Panel addresses this issue by providing a facility to allow some filter variables to be manually overridden.

This panel serves two purposes - to display the current extracted values of various variables and provide context to users modifying custom file filters, and to allow users to override specific variables when appropriate.

When modifying custom filters, double clicking on a variable label (such as [GAMENAME]) will copy the text and allow it to be pasted into filter text fields.

Filter Variable Summary

Not all filter variables can be edited by the user (for instance [GAMENAME]). Additionally, some variables are only valid for specific emulators. Only filter variables valid for the currently selected games emulator are displayed.

Not all games contain all filter variables. When no evidence can be found in game scripts of a variable being required, it is greyed out in the File Variables Panel. An example of this is [VPREGCODE] in the provided image. Even when a variable is greyed out, should the user detect that it is required, an override can still be applied by ticking the associated checkbox.

A summary of available filter variables is provided below:

[GAMEFOLDER] - (All emulators)

This value is calculated based on several values. Firstly, the configured GameDir Pinup System setting for the selected games emulator forms the base of the folder. If the game exists ina sub-path of this folder then this sub-path is stored within the GameFilename value stored within the Pinup System database. This value is appended to the initial GameDir value. So for a VPX game with a filename called myTables/myFirstGame.vpx, assuming the default value of Tables set for the VPX emulator in Pinup, system, the expected value of [GAMEFOLDER] would be Tables/myTables.

[GAMENAME] - (All emulators)

This value is taken straight from the Pinup System database. As such it cannot be overridden, as this a fundamental element of how Pinup System works. This will usually be the game filename minus the file extension.

[GAMECODE] - (All emulators)

This value is used by Pinup System as the name of the Pup Pack associated with a table. In VPX, this value corresponds to the value of cGameName. For VPX games that use a ROM this will also be the name of the ROM, unless an alias has been defined in VPinMAME\VPMAlias.txt. This value is used to identify content such as altcolor and altsound folders and NVRAM entries. In Future Pinball the value corresponds to the value of cPuPPack.

[ALIASEDGAMECODE] - (VPX)

This value is used only by VPX. The file VPinMAME\VPMAlias.txt is used to map cGameName values to aliased ROM files. This caters for cases where a single ROM is used for multiple games, however each game requires different related data (ie Pup Packs, altcolor/altsound folders). This value is automatically calculated based on content of VPinMAME\VPMAlias.txt so cannot be overridden. In the (usual) case where no VPinMAME\VPMAlias.txt entry exists, the value will match the value of [GAMECODE]. ROM searches will always use this value.

[VPREGCODE] - (VPX)

Some VPX games make use of the User\VPReg.stg file. This file is a Microsoft compound file which allows games to store blocks of storage (often high scores or game settings) in a block of storage identified by a key string. The value of the key string is set by a call within the table script to the SaveValue function. It is expected that this variable will not be required for user entered filters as VPReg filters are already setup by default.

[NVRAMOFFSET] - (VPX)

Some VPX games share ROMS and hence cGameName values. As such they would usually share the same NVRAM file. This is not always desired - think of the case where the same table has multiple versions, high scores and settings for one version may not be wanted to be shared by other versions. To avoid this, users are able to call the function NVOffset which allows a unique value to be specified for a particular table instance. In practice VPX when loading a game with an NVOffset copies in a new version of NVRAM which it stores with a name that makes use of the value passed to the NVOffset function. It is expected that this variable will not be required for user entered filters as NVRAM Offset filters are already setup by default.

[USERTXT] - (VPX)

This filter captures cases where VPX tables load custom text files and parse values out of these. In the script, this will be identified by a call to createTextFile and almost always use the User directory. While this variable is not expected to be used for custom filters as the default filter already consider it, however it is possible that multiple custom user text files could be used, in which case custom filters may be required.

Overriding Filter Variables

Variables that can be overridden have a checkbox available to mark them as being overridden. When initially enabling an override, the value used for the override matches the current extracted value. Users are then able to modify the value in the text field.

Color coding is used to highlight missing expected values (red) and values that need to be committed (yellow) by pressing the Update button.

Color coding is used to highlight missing expected values (red) and values that need to be committed (yellow) by pressing the Update button.

Changes applied to filter variables are immediately reflected in other panels.

The following example shows an override being applied to the [GAMECODE] variable initially which results in files previously matched to the [GAMECODE] value no longer being matched to the game. This is reflected in both the Installed Games panel which shows the game no longer matches the backup and provides a tooltip highlighting the differences, and in the Selected Game Content panel which shows the files are no longer matched to the game.

Backup and Restore of Filter Variables

When filter variables are found to contain differences between the system and the backup, it is possible to perform a backup or restore of just the filter variables configuration - saving the need to perform another full game backup or restore.

When differences have been detected, the Selected Game Filter Variables panel border and the individual Variable Name/Code names of any variables with differences are highlighted in an error colour. The examples below shows the case where the [USERTXT] variable is out of synch.

Depending on whether the current or backup filter variables are being displayed, a Backup Values or Restore Values button is provided in the top right corner of the panel to allow the selected games filter variables to be backed up or restored - as seen below.

Pressing Backup Values or Restore Values button will backup or restore the selected games filter variables.

Custom filter variables must be in synch prior to performing any individual file backups or restores in the Selected Game Content panel.