Forged Alliance Trainer 1.0.0
by Gutwormy
=============================

An in-game trainer for Supreme Commander: Forged Alliance (single-player:
skirmish and campaign). Press Insert in the game to open it. There is no
extra program to run.


WHAT YOU NEED
-------------
- Supreme Commander: Forged Alliance. Made for the Steam version (the
  current one); other versions work when the trainer finds what it needs.
  The trainer looks for everything it needs in the game each time it
  starts; anything it cannot find stays off, and FATrainer.log names it.
- Windows 10 or 11.
- Not for Forged Alliance Forever (FAF): FAF runs its own game files and
  never loads this trainer.


HOW TO INSTALL
--------------
1. Close the game.

2. Open the game's folder: right-click the game in your Steam Library,
   then choose Manage > Browse local files. Then open the bin folder.
   You are in the right place if you can see SupremeCommander.exe.

3. Copy everything from this download into that bin folder:
       dsound.dll
       FATrainer   (folder)
   If Windows asks whether to replace files, choose Yes.

4. Start the game, start a skirmish or a campaign mission, and press
   Insert.

Updating from an older version: do the same and replace the files.


FEATURES (default keys)
-----------------------
Insert  Open or close the trainer (Esc also closes it)
Num 1   Unlimited Health     - your units and structures take no damage
                               and cannot be destroyed; shields stay full
Num 2   Unlimited Mass       - mass storage kept full
Num 3   Unlimited Energy     - energy storage raised to 100,000,000 and
                               kept full
Num 4   Instant Construction - everything you build, upgrade or repair
                               finishes at once, for free (Commander
                               enhancements and mex upgrades included)
Num 5   No Reload            - your weapons fire as fast as the game can
                               run them; energy shots, missiles and nukes
                               are free
Num 7   Reveal Map           - your army sees the whole map, cloaked and
                               stealthed units included
Num 8   Unlimited Unit Cap   - your unit cap is 10,000 while on

In the panel (no key):
- Selected Units: Heal (full health and shields), Vet 5 (veterancy level
  5) and Teleport (to the centre of your view; buildings stay where they
  are) for the units you have selected in the game, any army.
- Spawn Menu: any unit or building of the four factions, 1 to 50 at a
  time, finished, at the centre of your view, for you, an ally or an
  enemy. Filter by faction, tier (T1, T2, T3, Experimental) and type
  (Land, Air, Naval, Base) together, or search by name.
  Delete Selected removes the units you have selected in the game, any
  army (an army whose Commander is deleted loses the game).

The game keeps running while the panel is open, and keeps your keyboard
and mouse everywhere except over the panel. Drag the panel's title to
move it. Hover the mouse over a feature name for a short explanation.

To change a key, click its key box in the panel and press the new key
(Esc cancels). "Hotkeys: On/Off" at the top switches the feature keys off;
Insert always works. Switches start off each time the game starts. Keys
are saved in FATrainer\FATrainer.ini.


GOOD TO KNOW
------------
- Single-player only. In multiplayer and replays the trainer stays off,
  so the game cannot go out of sync.
- Back up your saves first. Spawned and deleted units are saved with your
  game. The switches' own changes are put back when a save is loaded, and
  the trainer then turns on again what the panel shows.
  Saves: Documents\My Games\Gas Powered Games\Supreme Commander Forged
  Alliance\savegames
- Only your own army is changed by the switches. Selected Units, Spawn
  and Delete Selected work on any army.
- Very large armies slow the game down (the game's own limit, not the
  trainer's).
- Unlimited Mass and Unlimited Energy: the game has one storage record
  for both, so with both on only energy gets the raised storage; mass is
  still kept full.


HOW TO UNINSTALL
----------------
Close the game, then delete these two from the game's bin folder:
    dsound.dll and FATrainer (the whole folder)
The trainer does not change any game files.


TROUBLESHOOTING
---------------
- Insert does nothing: check that dsound.dll and the FATrainer folder are
  both in the bin folder, next to SupremeCommander.exe.
- The panel says something was "not found in this game version": your
  version of the game differs from the Steam one there. Send FATrainer.log
  (from the FATrainer folder); the trainer needs a new search pattern for
  that version.
- Antivirus removed a file: this is a false positive. Add the game folder
  as an exception and copy the file again. The trainer does not connect
  to the internet and only runs inside the game.
- When reporting a problem, include FATrainer.log from the FATrainer
  folder.


CREDITS
-------
Forged Alliance Trainer by Gutwormy.
Uses Dear ImGui (MIT licence) and MinHook (BSD 2-Clause licence);
their licences are below.


LICENCES
--------
Dear ImGui

The MIT License (MIT)

Copyright (c) 2014-2026 Omar Cornut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


MinHook

MinHook - The Minimalistic API Hooking Library for x64/x86
Copyright (C) 2009-2017 Tsuda Kageyu.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================================================
Portions of this software are Copyright (c) 2008-2009, Vyacheslav Patkov.
================================================================================
Hacker Disassembler Engine 32 C
Copyright (c) 2008-2009, Vyacheslav Patkov.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-------------------------------------------------------------------------------
Hacker Disassembler Engine 64 C
Copyright (c) 2008-2009, Vyacheslav Patkov.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
