Overview
This guide shows how to create custom launch scripts, change the game’s behavior through advanced parameters or create your own script to start Forces of Corruption directly from your desktop.If you found this guide useful please rate it accordingly.If you encountered any problems, the guide was to complex or contained errors please leave me a message before you rate it so that I can correct that.
FoC direct and scriptable access
Due to Steam’s unfortunate move to categorize Forces of Corruption as DLC it is not startable by using a Desktop link or the -applaunch parameter. This section shows you a workaround which is a bit complex for beginners, but you only need to do it once. The only permanent downside is loosing the Steam Overlay (does not apply when started over Steam), so if you want to keep it, this guide is not for you.
Basic procedure of starting FoC
The steam version of Forces of Corruption is launched by running the executable runme2.exe. This exe is found in the EaW installlation directory which should be inside the Steam library folder, e.g. C:Program Files (x86)SteamsteamappscommonStar Wars Empire at War.
However, just double-clicking on runme2.exe does not work. The Steam DRM expects a few environment variables and will give an error message if they are not set. They are individual for each account and purchase, so I can’t just give you mine.
The environment variables can be extracted with Process Explorer from Microsoft[technet.microsoft.com]. Download and extract Process Explorer if haven’t got it already and launch it with admin rights.
Start FoC with Steam and switch back to the desktop (Do not terminate FoC, press [Win]+[D] to get back to your Desktop). Switch to Process Explorer and search for runme2.exe. Right-click on it and open the entry Properties. Switch to the tab Environment.
.
These are all environment variables of runme2.exe, not just the ones you need. Create a new batch file and set all steam-related variables with the command like this:
You can copy the environt variables from Process Explorer by selecting all of them with [CTRL]+[A], and copy (with [CTRL]+[C]).
Keep the batch file in a secure place, it contains your game key, profile id, profile name, windows user name and other data you might want to keep private.
Then, add a cd command to change the directory to the location of runme2.exe. If this folder is located on a different drive, add the /d switch:
If it’s on a different drive:
Now, on a new line, call runme2.exe. The batch file is finished and should look similar, though not exactly like mine:
As last step, right-click on the desktop and create a new Link. Browse to the created batch file and enter a name. You can even change the symbol so that it looks like a legititmate Link (Hint: swfoc.exe in the corruption sub-directory contains three game icons).
You should now have a working Link to FoC.
Advanced Parameters
The Forces of Corruption executable supports some useful paramters to set the screen resolution or enable mods.
These parameters overwrite the “normal” settings (which are saved in the registry) and need to be specified at each Launch (this can be automated with Links/Scripts).
In drm-free versions of the game (like the one from GOG), these parameters can directly be passed to the executable. In the steam version, you have two options: specify the parameters in the lauch options or by editing config files.
If you use the launch options, automating only works with the base game, not FoC.
You can launch the base game by launching steam with an additional parameter:
I tried using FoC’s app id, but that doesn’t work. To edit the swfoc.exe launch parameters, edit the corresponding config file. This file is named runme2.dat and should be located somewhere around SteamsteamappscommonStar Wars Empire at War. By default, the file should look like this:
Any parameter can be added or removed, and will be used if the game is started through steam or runme2.exe. The same goes for runme.exe and runme.dat which are used for the base game.
If you lanch an app with steam, either through the -applaunch parameter or by setting custom launch properties, the LANGUAGE-parameter will always be set. If you want to change that, you will need to use a config file.
Availible Parameters
The game has to types of parameters: Some, like FULLSCREEN, are set without a value, others, like SCREENHEIGHT=1080, need a value.
If you know one of the unknown parameters, send me a message.
Examples
Play EaW in english in a window with a resolution of 1040×1920 (to keep the task bar):
Play EaW in fullscreen on a second monitor in german:
Works with Steam as well (without the language Parameter, which is set in game properties):
See the documentation from Valve for more parameters of Steam.
Launch sets with Scripting
Introduction
Most of the possibilities I’ve covered in the first two sections are especially useful when combined with batch scripting. A batch file, (under pre-NT-Windows, the extension was .bat) is a list of commands which are executed by an interpreter, cmd.exe.
This section assumes that you run at least Windows 7/ 8 / 8.1 (10 has it’s own problems). Vista might work, but is untested. XP and lower lacks the mklink utility.
Additionally, the game needs to be installed on a NTFS-formatted volume. You can check that by opening a command prompt and entering
Replace C: with the corresponding drive letter if you have it installed elsewhere.
If you only want to execute a single command, like launching EaW with a special parameter, a simple Link does usually suffice. If you however want to execute multiple commands, you should use a batch file.
A common use case for a batch file is to prepare the file structure when switching between mods or mods a vanilla game. Some EaW / FoC mods do not only add content to the Mod-directory but also change files in the Data-directory, which can cause incompatibilities because it’s shared between valla game and each mod.
The relevant game folder structure:
To prevent a mod from interfering with the base game or other, incompatible mods, copy the original Data folder into a new Data folder. This folder should have different, identifying name like Data_modname. Rename the original folder to, to something like Data_original.
If you this, your Data-folder is protected from change through mods, but you won’t be able to change between mods without a script. The two folders need to be relinked every time you choose to switch between mods and/or vanilla game.
A batch script to switch to a mod-modified data folder could look like this:
The corresponding script to start the vanilla game:
Each line explained (The REM command marks the line as comment):
This works can be combined with the workaround from the first section to enable this for Forces of Corruption. Set the environment variables before you call runme2.exe or it won’t work.
For FoC, the only possibility to change parameters (and therefore use mods) programmatic is to create multiple runm2.dat for each mod and hardlink them: