|
| 1 | +# Willow 1 Mod Manager |
| 2 | +[](https://discord.gg/bXeqV8Ef9R) |
| 3 | +[](https://discord.gg/VJXtHvh) |
| 4 | + |
| 5 | +[For installation instructions / the mod database, see the project site.](https://bl-sdk.github.io/willow1-mod-db/) |
| 6 | + |
| 7 | +<br> |
| 8 | + |
| 9 | +The [pyunrealsdk](https://github.com/bl-sdk/pyunrealsdk) mod manager for: |
| 10 | +- Borderlands 1 |
| 11 | + |
| 12 | +Note Borderlands 1 *Enhanced* is not currently supported. |
| 13 | + |
| 14 | +# Development |
| 15 | +When developing, it's recommended to point pyunrealsdk directly at this repo. To do this: |
| 16 | + |
| 17 | +1. Navigate to the plugins folder - `<game>\Binaries\Plugins\` |
| 18 | + |
| 19 | +2. Create/edit `unrealsdk.user.toml`, adding the following: |
| 20 | + ```toml |
| 21 | + [pyunrealsdk] |
| 22 | + init_script = "<path to repo>\\src\\__main__.py" |
| 23 | + ``` |
| 24 | + |
| 25 | +3. (Optional) Update `pyunrealsdk.pyexec_root` to the same folder, to make sure pyexec commands go |
| 26 | + where you expect. |
| 27 | + |
| 28 | +4. (Optional) Add the path to your old `sdk_mods` folder to the `mod_manager.extra_folders` array, |
| 29 | + so they continue getting loaded. |
| 30 | + |
| 31 | +5. (Optional) Copy/symlink your original settings folder into `src\settings` - settings are only |
| 32 | + loaded from the base mods folder. |
| 33 | + |
| 34 | +Once you've done this, you can modify the python files in place. |
| 35 | + |
| 36 | +## Native code |
| 37 | +The mod manager currently doesn't rely on any native modules. You may however still want to |
| 38 | +edit/debug the base pyunrealsdk code while working on this project. The sdk supports five different |
| 39 | +toolchains: |
| 40 | + |
| 41 | +- MSVC |
| 42 | +- Clang (Windows) |
| 43 | +- Clang (Cross Compile) <sup>*</sup> |
| 44 | +- MinGW <sup>*</sup> |
| 45 | +- LLVM MinGW <sup>*</sup> |
| 46 | + |
| 47 | +The toolchains with an asterix are all cross compiling toolchains. These all also have an associated |
| 48 | +dev container, which is the recommended way of building them. The `clang-cross-*` presets in |
| 49 | +particular hardcode a path assuming they're running in the container. |
| 50 | + |
| 51 | +1. Initialize the git submodules. |
| 52 | + ```sh |
| 53 | + git submodule update --init --recursive |
| 54 | + ``` |
| 55 | + You can also clone and initialize the submodules in a single step. |
| 56 | + ```sh |
| 57 | + git clone --recursive https://github.com/bl-sdk/willow1-mod-manager.git |
| 58 | + ``` |
| 59 | + |
| 60 | +2. Make sure you have Python with requests on your PATH. This doesn't need to be the same version |
| 61 | + as what the SDK uses, it's just used by the script which downloads the correct one. |
| 62 | + ```sh |
| 63 | + pip install requests |
| 64 | + python -c 'import requests' |
| 65 | + ``` |
| 66 | + |
| 67 | + If cross compiling, and not using one of the dev containers, make sure `msiextract` is also on |
| 68 | + your PATH. This is typically part of an `msitools` package. |
| 69 | + ```sh |
| 70 | + apt install msitools # Or equivalent |
| 71 | + msiextract --version |
| 72 | + ``` |
| 73 | + |
| 74 | +3. Choose a preset, and run CMake. Most IDEs will be able to do this for you, |
| 75 | + ``` |
| 76 | + cmake . --preset msvc-debug |
| 77 | + cmake --build out/build/msvc-debug |
| 78 | + ``` |
| 79 | + |
| 80 | +4. (OPTIONAL) If you need to debug your module, and you own the game on Steam, add a |
| 81 | + `steam_appid.txt` in the same folder as the executable, containing the game's Steam App Id. |
| 82 | + |
| 83 | + Normally, games compiled with Steamworks will call |
| 84 | + [`SteamAPI_RestartAppIfNecessary`](https://partner.steamgames.com/doc/sdk/api#SteamAPI_RestartAppIfNecessary), |
| 85 | + which will drop your debugger session when launching the exe directly - adding this file prevents |
| 86 | + that. Not only does this let you debug from entry, it also unlocks some really useful debugger |
| 87 | + features which you can't access from just an attach (i.e. Visual Studio's Edit and Continue). |
0 commit comments