Menu

Tree [6bf8bb] default tip /
 History

Read Only access


File Date Author Commit
 .hgignore 2019-07-12 Derek Derek [0daa9e] Began GUI implementation and refactoring of top...
 README.md 2019-07-23 Derek Derek [b63edd] -Updated README.
 XCOM LW Respec.py 2023-07-21 Derek Derek [1c175f] -Added KIA status.
 cli_main.py 2023-07-21 Derek Derek [1c175f] -Added KIA status.
 color_registry.py 2019-04-18 Derek Derek [a03571] -Refactoring Window and SoldierMenu.
 curses_util.py 2019-07-17 Derek Derek [18f289] -Moved TextBox and subclasses to curses_util an...
 json_utils.py 2019-06-19 Derek Derek [c70076] Finished SoldierEdit.
 menu.py 2019-06-19 Derek Derek [c70076] Finished SoldierEdit.
 perks.csv 2019-06-19 Derek Derek [c70076] Finished SoldierEdit.
 perks.py 2019-07-23 Derek Derek [b63edd] -Updated README.
 scrollable.py 2019-06-19 Derek Derek [c70076] Finished SoldierEdit.
 soldier.py 2023-07-21 Derek Derek [6bf8bb] Removed debug print statements.
 soldier_edit_curses_view.py 2023-07-21 Derek Derek [1c175f] -Added KIA status.
 soldier_edit_presenter.py 2019-07-21 Derek Derek [d460d1] -Implemented most of TK edit view functionality.
 soldier_edit_tk_view.py 2023-07-21 Derek Derek [1c175f] -Added KIA status.
 soldier_menu_curses_view.py 2023-07-21 Derek Derek [442db8] Add soldier status support to TK.
 soldier_menu_presenter.py 2023-07-21 Derek Derek [fbd256] Update menu after editing a soldier.
 soldier_menu_tk_view.py 2023-07-21 Derek Derek [442db8] Add soldier status support to TK.
 tk_main.py 2023-07-21 Derek Derek [442db8] Add soldier status support to TK.
 tk_util.py 2019-07-21 Derek Derek [d460d1] -Implemented most of TK edit view functionality.
 utils.py 2021-05-27 Derek Derek [c788ff] -Fix error writing binary save file.

Read Me

About

This script allows you to modify perks and stats of soldier for XCOM Long War by
modifying a Geoscape save (it will not work on tactical map saves). This
probably works for Enemy Within as well, but the perk IDs are different, so
you're own your own there.

This script performs NO validation, and I don't know what will happen if you add
invalid perks. So probably don't do that.

This script also does not adjust for stat changes as a result of adding perks.

Installation

This script requires the use of the xcom2json and json2xcom programs. If you are
on Windows and you downloaded the .zip file, you should have everything you
need.

The interactive terminal interface requires Curses. On Mac or Linux this should
be available by default. On Windows you can install it with
pip install windows-curses. The GUI interface requires that Tkinter is
installed.

If you downloaded the source code then you can get xcom2json and json2xcom as
either Windows binaries or source code from here.

Usage

usage: XCOM LW Respec.py [-h] [-G] [-n NAME] [-o OUTPUT] [-l]
                         [--perk_info PERK_INFO] [--health HEALTH] [--aim AIM]
                         [--defense DEFENSE] [--mobility MOBILITY]
                         [--will WILL] [--add_perk [ADD_PERK [ADD_PERK ...]]]
                         [--remove_perk [REMOVE_PERK [REMOVE_PERK ...]]]
                         [save_file]

Modify the perks and specs for soldiers in XCOM Long War. This probably works
for Enemy Within as well, but the perk IDs are different, so you're own your
own there. This script performs NO validation, and I don't know what will
happen if you add invalid perks. So don't do that. This script also does not
adjust for stat changes as a result of adding perks.

positional arguments:
  save_file             Save game file. If the file name ends in .json then it
                        will be read as a json file as output by xcom2json.
                        Otherwise it will be read as a binary file. Required
                        if not in GUI mode.

optional arguments:
  -h, --help            show this help message and exit
  -G, --gui             Use GUI interface.
  -n NAME, --name NAME  Soldier's name. Only used in non-interactive mode. Can
                        be any combination of first name, last name, or
                        nickname. Order does not matter, but all provided
                        names must match.
  -o OUTPUT, --output OUTPUT
                        Output save file. If the file name ends in .json it
                        will be written as a json file compatible with
                        json2xcom. Otherwise it will be written as a binary
                        file. This can overwrite save_file if they are the
                        same, so care should be taken. The default is
                        "[save_file].new and has the same format as the
                        save_file.".
  -l, --list            List the soldier's perks, the save will not be
                        modified even if perks are provided.
  --perk_info PERK_INFO
                        CSV file containing perk information. Default
                        "perks.csv".
  --health HEALTH, --hp HEALTH
                        Set soldier health.
  --aim AIM             Set soldier aim.
  --defense DEFENSE, --def DEFENSE
                        Set soldier defense.
  --mobility MOBILITY, --mob MOBILITY
                        Set soldier mobility.
  --will WILL           Set soldier will.
  --add_perk [ADD_PERK [ADD_PERK ...]]
                        A list of perk IDs, names, or console names to add to
                        the selected soldier.
  --remove_perk [REMOVE_PERK [REMOVE_PERK ...]]
                        A list of perk IDs, names, or console names to remove
                        from the selected soldier.

Examples

Interactive mode

To run in interactive GUI mode:

python "XCOM LW Respec.py" -G save71

To run in interactive terminal mode:

python "XCOM LW Respec.py" save71

To edit the soldier named Shaojie interactively in the terminal:

python "XCOM LW Respec.py" -n "Shaojie" save71

Non-interactive mode

This will display all the perks on the soldier named Shaojie:

python "XCOM LW Respec.py" -l -n "Shaojie" save71

The output looks like:

Shaojie 'Chilong' Zhang:
XP: 3444     Psi XP: 100
HP: 5   Aim: 81   Def: -2   Mob: 12   Will: 65
(10) Opportunist
(47) Covering Fire
(94) Ranger
(110) Pistol (Foundry Pistol I upgrade)
(123) Shaped Armor (Foundry Upgrade)
(126) Light 'Em Up

This will remove the Opportunist perk and add the Will To Survive perk:

python "XCOM LW Respec.py" -n "Shaojie" --remove_perk=Opportunist --add_perk="Will To Survive" save71

Or:

python "XCOM LW Respec.py" -n "Shaojie" save71 --remove_perk=10 --add_perk=17

This will modify the soldier's stats:

python "XCOM LW Respec.py" -n "Shaojie" --health=5 --aim=90 save71

Thanks

I would like to thank tracktwo, whose XCOM save utilities made this possible.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.