From 6f9a8717f82276c4283c70217c8024db3531e252 Mon Sep 17 00:00:00 2001 From: apple1417 Date: Sat, 18 May 2024 20:21:46 +1200 Subject: [PATCH] improve explict python version downloads now be done during configuration this also lets mods include this repo to automatically get the exact same python and pyunrealsdk versions --- CMakeLists.txt | 5 +++++ CMakePresets.json | 4 ---- Readme.md | 28 +++++++++++++++++++--------- libs/pyunrealsdk | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d64902..37be48d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.24) project(oak_mod_manager) +set(UNREALSDK_ARCH x64) +set(UNREALSDK_UE_VERSION UE4) +set(EXPLICIT_PYTHON_ARCH amd64) +set(EXPLICIT_PYTHON_VERSION 3.12.3) + add_subdirectory(libs/pyunrealsdk) add_subdirectory(libs/pluginloader EXCLUDE_FROM_ALL) diff --git a/CMakePresets.json b/CMakePresets.json index a5f96ff..c46ca2a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,10 +9,6 @@ "architecture": { "value": "x64", "strategy": "external" - }, - "cacheVariables": { - "UNREALSDK_ARCH": "x64", - "UNREALSDK_UE_VERSION": "UE4" } }, { diff --git a/Readme.md b/Readme.md index 5852019..eb6119c 100644 --- a/Readme.md +++ b/Readme.md @@ -20,7 +20,13 @@ When developing, it's recommended to point pyunrealsdk directly at this repo. To 3. Edit `unrealsdk.env`, setting `PYUNREALSDK_INIT_SCRIPT=\src\__main__.py`. -4. (Optional) Copy any mods you were using and their settings into the `src` folder, and setup gitignores for them. +4. (Optional) Edit `unrealsdk.env`, adding/updating + `OAK_MOD_MANAGER_EXTRA_FOLDERS=["C:\\path\\to\\new\\mod\\folder"]`, pointing at your old + `sdk_mods` folder. This is a json list of paths to folders to load, though note it must stay on + one line. + +5. (Optional) Copy/symlink your original settings folder into `src\settings` - settings are only + loaded from the base mods folder. Once you've done this, you can modify the python files in place. @@ -35,18 +41,22 @@ To build the native modules: git clone --recursive https://github.com/bl-sdk/oak-mod-manager.git ``` -2. Setup the python dev files. The simplest way is as follows: +2. Make sure you have Python with requests on your PATH. This doesn't need to be the same version + as what the SDK uses, it's just used by the script which downloads the correct one. ```sh - apt install msitools # Or equivalent for other package managers, not required on Windows - - cd libs/pyunrealsdk/common_cmake/explicit_python pip install requests - python download.py 3.11.5 amd64 + python -c 'import requests' + ``` + + If not running on Windows, make sure `msiextract` is also on your PATH. This is typically part + of an `msitools` package. + ```sh + apt install msitools # Or equivalent + msiextract --version ``` - Make sure to copy the same python version as your install is already using. - See the [readme](https://github.com/bl-sdk/common_cmake/blob/master/explicit_python/Readme.md) - for more advanced details. + See the explicit python [readme](https://github.com/bl-sdk/common_cmake/blob/master/explicit_python/Readme.md) + for a few extra details. 3. Choose a preset, and run CMake. Most IDEs will be able to do this for you, ``` diff --git a/libs/pyunrealsdk b/libs/pyunrealsdk index d18a05c..e5643bd 160000 --- a/libs/pyunrealsdk +++ b/libs/pyunrealsdk @@ -1 +1 @@ -Subproject commit d18a05c7f1d026fab87b7752e1940f88f600698e +Subproject commit e5643bd8216e84488afe84d346b2598e009aa043