Howto: game wizard scripts for one click installer

Here you find known solutions about the X-Sim software.
Do not post any questions, use the sections below instead!

Howto: game wizard scripts for one click installer

Postby sirnoname » Tue 9. Oct 2012, 11:24

Howto script the game wizard for autosetup games with a one click

X-Sim offers a automated game wizard which will search nearly the complete harddisk for games that are installed in common or not common directories. Only the trash folder and some system folders are ignored. If you open the game wizard with the left bottom "Add game / Wizard" Button all the script files in the plugin folder will be read. If you execute the scan this script files will be used to find game executable and change configuration files or do the needed things to enable the telemetry output of the game. The general documents of X-Sim explains that most of the games are using the same telemetry interface. If you like to add another game that is not autodetected then you can have a look to a game that is similar to your game and modify this script file.
This scripts will automate the steps that are documented inside the X-Sim manual. You will find there a list of the game plugins and the needed steps that must be configured to enable the telemetry interfaces.

Importand: If you have finished a script file and it is working, please send this to the author of X-Sim. We have to verify if this setup will not bother other scan scripts.

Now I start to explain what you have to insert in the script files.
The script files can:
- change a part of a configuration / ini file
- copy a plugin into the game folders (the plugin file must be inside the script directory)
- add parameter for steam games
- detect differences between demo games and full versions
- setup and insert the game into the extractor game listbox


We start with a example of Race07 as steam version which configuration steps are documented in the X-Sim manual:

//////////////////////////////////////////////////////////
// X-Sim 3 game configuration script
//////////////////////////////////////////////////////////

title: Race 07 (steam) script
games: Race 07 (steam)
search_executable: Race_Steam.exe
game_parameter: steam://rungameid/8600
mustdir1: steam
mustdir2: race 07
notdir1: demo
unicode: no
plugin: Race07Plugin.dll


Explanations:
The title will give the script a name.
The games tag will give the extractor game name in the game listbox.
The search_executable tag will carry the executable name of the game which will be searched in all directories.
Game_parameter are normally not used but if you have a steam game you have to rightclick the game in steam and make a shortcut to the desktop. Then rightclick this new icon on the desktop and go to the properties. There you find the steam ID which you have to insert like above in the script.
The mustdir will make your search script stable against other scripts. This means all the mustdirx have to be a part of the game path. If this mustdir ist not included in the game path the script will be not used. In the same manner the notdir will exclude names in the path of the game. If you do more exclusions you get closer to a good detection but more away from a find all over the harddisk. I assume you play around only with the highest directory near the game exectuable because this is normally a part that is not changed by the game installer.
Unicode is always no and a future part.
The plugin will carry the plugin file name in the plugin directory. This is not a plugin file that must be copied into the game folder, it is the compatible plugin for the extractor that will be automatically chosen of you select the game out of the game list with the fitting games tag name of the script file.

You can see this script will only add the found game to the game listbox. It will not change the configuration of the game itself because the configuration is not inside the Race_Steam.exe executable.
We need now a fitting script to change the game configuration files:

//////////////////////////////////////////////////////////
// X-Sim 3 game configuration script
//////////////////////////////////////////////////////////

title: simbin config
games: race, race07, gtr, gtr2, gtr evolution
filename: *.plr
max_file_size: 100000
search1: Write Shared Memory="0"
replace with1: Write Shared Memory="1"
unicode: no


We are lucky because all simbin games are using the same activation, so we have only to make one script for all this games. It must search for all .plr files and replace some stuff.

Explanations:
The title will carry a name for the script.
The games tag will carry some game names but is ignored in the software for * (future use)
The filename tag will now carry a shorten version for all .plr configuration files.
Max_file_size will exclude configuration files that are unrealistic.
Searchx will carry a phrase of the original game config file that is searched inside the file if a .plr file is found. Please note, it is not possible to change former changed search tags. It must be the search phrase of a fresh installed game that is not modified. Modified configuration files get not touched because we assume the person who has changed this file knows what he was doing. If you like to copy a predefined configuration file, you have to use the next described script option.
The "replace withx" is the exchange value for the search phrase.
Unicode is again no.

We have now sucessfully described two possibl script files, the game detection and the configuration file modification.
But there are much more possible setups.You have to open all the game wizard scripts to get more informations what is possible.
The following script will copy a plugin file to the game folders of the game rFactor 1:

//////////////////////////////////////////////////////////
// X-Sim 3 game configuration script
//////////////////////////////////////////////////////////

title: rfactor config
games: rfactor, rfactor2
pluginfile_to_copy: xsimplugin.dll
game_executable: rfactor.exe
relative_path_to_copy: \Plugins\
hint: If install a new X-Sim version you must copy the new xsimplugin.dll or delete this game out of the game database and redo this search for a update.
unicode: no


Explanations:
Title, games and unicode tags are as described above.
Pluginfile_to_copy is as the name says a file in the script folder that will be copied to the game folder.
The relative_path_to_copy tag will add the folder structure to the found game folder and copy there the plugin file.
The hint can be placed if you want a short notice for the user. This hint will not be displayed in the fast scan of X-Sim.
In the above case there is no directory searching parameter like a configuration file or a game executable. Instead all found game executables with the name "rfactor.exe" get a copy of this plugin.

If you have a game that will simple activate the telemetry interface with a executable parameter, you can do it with a very simple script:
//////////////////////////////////////////////////////////
// X-Sim 3 game configuration script
//////////////////////////////////////////////////////////

title: Seed Game config
games: Nitro Stund Racing Stage 1
game_executable: NSR_S1.exe
game_parameter: -config -FD_TYPE 1 -FD_ID 0xfebabece -FD_Host 127.0.0.1 -FD_Port 4123 -FD_Filter 0.95 0.95 0.95
unicode: no



General hints:
Try to give the scripts as much informations as possible. They are in concurency to each other. The demo versions of the games should be downloaded and tested against your new script, else the game listbox may carry i.e. dirt but it is the demo version which should be displayed as "dirt demo". It is possible to combine the script tags but you cannot use two search filenames. If a tag has a number behind it you can insert up to five of them.


Copyright 2012 Martin Wiedenbauer, X-Sim
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Return to X-Sim Q&A/FAQs

Who is online

Users browsing this forum: No registered users and 1 guest