STAR WARS™ Empire at War – Gold Pack Guide

Poweruser Guide: FoC Windows start, Parameters, Launch Sets for STAR WARS™ Empire at War: Gold Pack

Poweruser Guide: FoC Windows start, Parameters, Launch Sets

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:

SET VariableName=VariableValue

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:

cd <folder which contains runme2.exe>

If it’s on a different drive:

cd /d <folder which contains runme2.exe>

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:

steam.exe -applaunch 32470 <custom_launch_parameters>

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:

corruptionswfoc.exe LANGUAGE=ENGLISH

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.

Parameter
Possible Values
effect
LANGUAGE=
ENGLISH | FRENCH | GERMAN | etc.
Sets the language. Only works when set in config file and with installed languages
SCREENHEIGHT=
at least 600
sets height in pixels
SCREENWIDTH=
at least 800
sets width in pixels
MODPATH=
valid relative path
sets a mod path relative to the normal path. When using a mod, it is usually set to MODPATH=ModsModname.
FULLSCREEN
FULLSCREEN
sets game to fullscreen mode. Should not be used with WINDOWED
WINDOWED
WINDOWED
sets the game to windowed mode. Should not be used with FULLSCREEN
MONITOR=
0,1, etc.
sets the display if you have multiple displays.
LOWRAM
LOWRAM
Unknown effect, probably for low-ram devices, reduced frame rate on my system
SAFEMODE
SAFEMODE
unknown, but game and mods still worked when set
FALLBACKPATH=
probably like MODPATH=
unknown
LOCALPORT=
unused port number
set the local port

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):

sweaw.exe LANGUAGE=ENGLISH SCREENHEIGHT=1040 SCREENWIDTH=1920 WINDOWED

Play EaW in fullscreen on a second monitor in german:

sweaw.exe LANGUAGE=GERMAN MONITOR=1 FULLSCREEN

Works with Steam as well (without the language Parameter, which is set in game properties):

steam.exe -applaunch 32470 MONITOR=1 FULLSCREEN

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

fsutil fsinfo volumeinfo C:

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:

SteamsteamappscommonStar Wars Empire at War _______________________| | | x– GameData | | | x– Data <– potential problems if a mod writes here | | | x– Mods <– The base game mod folder | x– corruption | x– Data <– potential problems if a mod writes here | x– Mods <– The FoC mod folder

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:

@echo off cd /d D:AppDataSteamsteamappscommonStar Wars Empire at WarGameData rmdir Data mklink /J Data Data_modname cd /d C:Program Files (x86)Steam steam.exe -applaunch 32740 MODPATH=ModsModname

The corresponding script to start the vanilla game:

@echo off cd /d D:AppDataSteamsteamappscommonStar Wars Empire at WarGameData rmdir Data mklink /J Data Data_original cd /d C:Program Files (x86)Steam steam.exe -applaunch 32740

Each line explained (The REM command marks the line as comment):

REM Suppresses command output @echo off REM change the working directory to the GameData folder cd /d D:AppDataSteamsteamappscommonStar Wars Empire at WarGameData REM Remove an old junction if it exists. Warning: Do not use this on the original folder. rmdir Data REM create a junction between the original folder and the folder where the game will look for it’s files mklink /J Data Data_modname REM change working directory to the steam folder cd /d C:Program Files (x86)Steam REM Launch the game with a Mod as specified: steam.exe -applaunch 32740 MODPATH=ModsModname

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:

@echo off cd /d D:AppDataSteamsteamappscommonStar Wars Empire at Warcorruption rmdir Data mklink /J Data Data_modname cd D:AppDataSteamsteamappscommonStar Wars Empire at War DEL runm2.dat mklink /H runm2.dat runm2_modNameConfig.dat SET SteamAppId=32470 SET SteamGameId=32470 … (more variables ommited) runme2.exe
SteamSolo.com