User Tools

Site Tools


gemus_script_reference:environment_variables

GEMUS Environment Variables

Environment Variable Description
%dbpath% The full path to your GameBase database folder. For example: C:\Program Files\GameBase\MyDatabase
%dbdriveletter% The drive letter of the path to your GameBase database folder. For example: C
%emupath% The full path to the active emulator. For example: C:\emulators\c64\ccs64
%gbgamepath% The full path to the GBGame folder (where GameBase extracts and runs game files). For example: c:\GBGame
%gamepathfile% The full path and filename of the game being run. For example: c:\games\s\sanxion.d64
%gamefile% The filename (without the path) of the game being run. For example: sanxion.d64
%gamepath% The path (without the filename) of the game being run. For example: c:\games\s
%gamefilenoext% The filename (without the path or filename extension) of the game being run. For example: sanxion
%gamepathfile(x)%
%gamefile(x)%
%gamepath(x)%
%gamefilenoext(x)%
Extra Game Files. If the game specified by the %game…% variables above has more than one game file (e.g. is a multi-disk game) then these variables will point to these extra game files. (x) is the index number (1 based, not zero-based) of the game file in question: %game…(1)% being the first extra game file, %game…(2)% being the second extra game file etc.. until there are no more game files. The number of extra game files is determined by the following rules: -

If the initial gamefile ends in a number, then extra gamefiles will be counted based on the incrementing last number. For example, if the initial %gamefile% is “REALMS0.D64” then %gamefile(1)% will be “REALMS1.D64”, %gamefile(2)% will be “REALMS2.D64” etc. until no more game files can be found.

If the initial gamefile ends in a letter, then extra gamefiles will be counted based on the incrementing last letter. For example, if the initial %gamefile% is “SUMGAMES1A.D64” then %gamefile(1)% will be “SUMGAMES1B.D64”, %gamefile(2)% will be “SUMGAMES1C.D64” etc. until no more game files can be found.
%numfiles% The total number of game files as defined in the rules for the %game…(x)% variables above. This number reflects ALL the game files for the game being run, not just the extra ones described above.
%crlf% The Carriage Return and Line Feed character pair. This can be used in the Show_Message function to start a new line of text.
%crlfx2% The Carriage Return and Line Feed character pair multiplied by 2. This can be used in the Show_Message function to insert a blank line in the text.
%tab% The Tab character. This can be used in the Show_Message function.
%commandline% The current contents of the emulator's command line. This can be used in the Show_Message function to help bug-test your own custom scripts.
%keyname_value% See the Key_Keyname comparison fields. To use the value of any of the GEMUS keys you specified for a game (set by pressing F2 or selecting the 'GEMUS' item from GameBase's 'Edit' menu), simply substitute keyname for the name of the key in the key=value pair. For example, if you have a key=value pair: fullscreen=yes, then the environment variable that contains the text “yes” would be %fullscreen_value%. There are two special key=value pairs. The first lets you point a specific game to use a specific emulator. To activate this feature, you need to add the key=value pair emu=xxx where xxx is the name of the emulator you wish to use (as specified in the GEMUS Emulator Properties window). The second is kvset=xxx where xxx is the name of a kvset (a way of grouping key=value pairs for convenience).
%storedgames(x)% Your Database's defined Game paths. Zero-indexed: %storedgames(0)% is your first defined Game path.
%storedpictures(x)% Your Database's defind Picture paths. Zero-indexed: %storedpictures(0)% is your first defined Picture path.
%storedextras(x)% Your Database's defined Extras paths. Zero-indexed: %storedextras(0)% is your first defined Extras path.
%storedgames(x)% Your Database's define games paths. Zero-indexed: %storedgames(0)% is your first defined games path.
%storedmusic% Your Database's defined Music path.
%storedphotos% Your Database's defined Photos path.
%imageindex% For D64 and T64 files (C64 file types), this will be set to the zero-based index of the game to run within the file. For all other game filetypes, this is always set to 0. For example: 0, 1, 2, 3, etc..
%imagename% Also see %c64imagename% (below). For D64 and T64 files (C64 file types), this will be set to the C64 image name that corresponds to the selected image index contained in %imageindex%. For a T64 file with no selectable image, it will be set to empty. For all other game filetypes this variable will be empty. For example: SANXION++, MONTY ON THE RUN etc..
%c64imagename% This differs to %imagename% (above) in that it converts the characters contained in it into C64 format (changing upper case to lower case). This variable was implemented to enable C64 emulators such as VICE to autoload images. For D64 and T64 files, this will be set to the C64 image name that corresponds to the selected image index contained in %imageindex%. For a T64 file with no selectable image, it will be set to empty. For all other game filetypes this variable will be empty. For example: SANXION++, MONTY ON THE RUN etc..
gemus_script_reference/environment_variables.txt · Last modified: 2023/10/04 14:15 by 127.0.0.1