Skip to content

Commit

Permalink
improve explict python version downloads
Browse files Browse the repository at this point in the history
now be done during configuration
this also lets mods include this repo to automatically get the exact same python and pyunrealsdk versions
  • Loading branch information
apple1417 committed May 18, 2024
1 parent a756fbf commit 6f9a871
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"UNREALSDK_ARCH": "x64",
"UNREALSDK_UE_VERSION": "UE4"
}
},
{
Expand Down
28 changes: 19 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<path to repo>\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.

Expand All @@ -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,
```
Expand Down
2 changes: 1 addition & 1 deletion libs/pyunrealsdk

0 comments on commit 6f9a871

Please sign in to comment.