Metadata-Version: 2.1
Name: holopatcher
Version: 2.0.0a3
Summary: A faster, cross-platform alternative to TSLPatcher written in Python.
Author: NickHugi
Maintainer-email: th3w1zard1 <halomastar@gmail.com>
License: LGPL-3.0-or-later
Project-URL: Homepage, https://deadlystream.com/files/file/2243-holopatcher/
Project-URL: Documentation, https://github.com/OldRepublicDevs/PyKotor/wiki/Installing-Mods-with-HoloPatcher
Project-URL: Repository, https://github.com/OldRepublicDevs/PyKotor.git
Project-URL: Issues, https://github.com/OldRepublicDevs/PyKotor/issues
Project-URL: Changelog, https://github.com/OldRepublicDevs/PyKotor/releases
Keywords: kotor,kotor1,kotor2,tsl,star-wars,knights-of-the-old-republic,modding,patcher,installer,tslpatcher,holopatcher,pykotor
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Games/Entertainment :: Role-Playing
Classifier: Topic :: System :: Software Distribution
Classifier: Environment :: Console
Classifier: Environment :: X11 Applications :: Qt
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: pykotor>=2.0.2
Requires-Dist: charset-normalizer<3.4,>=2.0
Requires-Dist: pycryptodome
Requires-Dist: requests<2.32.0,>=2.25.0; python_version < "3.9"
Requires-Dist: requests>=2.25.0; python_version >= "3.9"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: gui
Requires-Dist: PyQt5>=5.15; platform_python_implementation == "CPython" and extra == "gui"
Requires-Dist: PySide6; platform_python_implementation == "PyPy" and extra == "gui"
Provides-Extra: rtf
Requires-Dist: pypandoc; extra == "rtf"
Requires-Dist: PyWebView; extra == "rtf"
Provides-Extra: updates
Requires-Dist: requests; extra == "updates"
Requires-Dist: pycryptodome; extra == "updates"

# PyKotor TSLPatcher

## Overview

HoloPatcher is a rewrite of TSLPatcher written in Python, utilizing the PyKotor library.

TSLPatcher is a Delphi utility designed for modifying game files for "Star Wars: Knights of the Old Republic" and its sequel. It allows for the seamless integration of mods, ensuring compatibility and minimizing conflicts between different mods.

You can find the [TSLPatcher official readme here.](https://github.com/OldRepublicDevs/PyKotor/wiki/TSLPatcher's-Official-Readme)

However, TSLPatcher is over 20 years old now and many qol features, bugs, and highly popular features were never added over the years.
TSLPatcher, additionally, is closed source, making it difficult to determine its logic or why it may be failing to install a specific mod.


## Goals

- **Backwards Compatibility**: Match TSLPatcher's output and behavior as closely as possible.
- **Cross-platform compatible**: Windows/Mac/Linux will all produce the same patch results. HoloPatcher provides case-insensitive pathing support for all operating systems.
- **Support the non-PC versions of the game**: Support and provide tools for kotor ports such as iOS, android, steamdeck, etc. This goal is largely still in progress.
- **Add new features**: Add highly-requested features while still ensuring backwards compatibility with TSLPatcher.

## Features

- **Configurable Patching**: Offers a flexible system for defining modifications through INI files, allowing for detailed control over file modifications, additions, and compilations.
- **Game File Support**: Supports a wide range of game file types, including GFF, 2DA, TLK, SSF, and NCS/NSS scripts, enabling comprehensive modding capabilities.
- **Memory Management**: Implements a memory system for tracking and reusing modifications across different files, optimizing patching processes and ensuring consistency.
- **Error Handling and Logging**: Provides robust error handling and detailed logging functionality, aiding in debugging and ensuring smooth patching operations.
- **User Interface**: Features a graphical user interface for easy mod installation and management.
- **Command-line support**: Offer a command line for tools such as [KOTORModSync](https://github.com/th3w1zard1/KOTORModSync)
- **Compiling NSS scripts into NCS bytecode without reliance on nwnnsscomp.**

## Usage

_End users should [download the latest release here](https://github.com/OldRepublicDevs/PyKotor/releases)_

HoloPatcher can be used both as a command-line tool and through its graphical user interface.

### Requirements

First, see the main readme.md for instructions on how to setup the python venv. You will need to first install PyKotor's requirements. The easiest way to do this is running the `install_python_venv.ps1` script at the top level of this repo.

Once your venv is setup for pykotor, install `requirements.txt`
```bash
pip install -r requirements.txt --prefer-binary
```

### Command-Line Interface

```bash
python src/__main__.py <path to game> <path to tslpatchdata> [options]
```
required arguments:

- **--game-dir**: Path to the KOTOR install folder. This will be `mtslrcm` folder or the unpackaged ipa if using one of the mobile games. This is implicit as first argument.
- **--tslpatchdata**: Path to the tslpatchdata folder of the TSLPatcher mod. Can be the parent of tslpatchdata optionally. This is implicit as the second argument.

Options:

- **--install**: Start an immediate install, and do not show a ui window.
- **--console**: Show a console window for extra debug output of HoloPatcher. Using this flag will run HoloPatcher in the current terminal.
- **--uninstall**: Start an uninstall using the most recent backup folder provided in the tslpatchdata argument.
- **--validate**: Validates the specified tslpatchdata mod. More specifically, this runs reader.py to determine if there's any errors in your ini files.


### Graphical User Interface

Simply run the [`src/__main__.py`](https://github.com/OldRepublicDevs/PyKotor/blob/master/Tools/HoloPatcher/src/__main__.py) file without any arguments to launch the GUI.

## Configuration

Modifications are defined in INI files, which specify the files to be patched, the changes to be made, and any additional instructions required for the patching process. The system supports a variety of operations, including:

- Adding or modifying fields in GFF files.
- Inserting or modifying rows in 2DA files.
- Adding or [modifying](https://github.com/OldRepublicDevs/PyKotor/wiki/HoloPatcher-README-for-mod-developers.#tlk-replacements) entries in TLK files.
- Compiling NSS scripts into NCS bytecode without reliance on nwnnsscomp.
- Modifying SSF sound files.

See the TSLPatcher readme for more information.

## Extending

HoloPatcher is designed with extensibility in mind. Developers can extend its functionality by adding new types of modifications or integrating additional game file formats.

## Contributing

Contributions to the PyKotor's HoloPatcher are welcome. Whether it's adding new features, improving existing functionality, or fixing bugs, your contributions are appreciated.

## Further Documentation

For more detailed guides and tutorials on using HoloPatcher, refer to the following resources:

- [Installing Mods with HoloPatcher](https://github.com/OldRepublicDevs/PyKotor/wiki/Installing-Mods-with-HoloPatcher): A step-by-step tutorial on setting up and running HoloPatcher.
- [Advanced Configuration Options](https://github.com/OldRepublicDevs/PyKotor/wiki/HoloPatcher-README-for-mod-developers.): Detailed descriptions of advanced features and how to use them.
- [Mod Creation Best Practices](https://github.com/OldRepublicDevs/PyKotor/wiki/Mod-Creation-Best-Practices): Guidelines and tips for creating mods with HoloPatcher.
- [Notes on Internal Workings](https://github.com/OldRepublicDevs/PyKotor/wiki/Explanations-on-HoloPatcher-Internal-Logic): Explanations on how HoloPatcher works internally and some key TSLPatcher logic.

## License

HoloPatcher is released under the [LGPL-3.0-or-later License](https://github.com/OldRepublicDevs/PyKotor/edit/master/Tools/HoloPatcher/LICENSE.txt).
