Skip to content

Commit

Permalink
add some new faqs
Browse files Browse the repository at this point in the history
  • Loading branch information
apple1417 committed Aug 24, 2024
1 parent abdfb1f commit bcaf864
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem "jekyll", "~> 3.9.3"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.0"
gem "just-the-docs", "~> 0.6.2"
gem "just-the-docs", "~> 0.9.0"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
Expand Down
33 changes: 32 additions & 1 deletion developing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Work in progress

2. Open up `OakGame\Binaries\Win64\Plugins\unrealsdk.env`, and add the following lines:
- ```ini
OAK_MOD_MANAGER_EXTRA_FOLDERS=["C:\\path\\to\\new\\mod\\folder"]
MOD_MANAGER_EXTRA_FOLDERS=["C:\\path\\to\\new\\mod\\folder"]
```
This is a json list of paths to extra mod folders, you can append more - though note it must
stay on a single line.
Expand All @@ -25,6 +25,9 @@ Work in progress
This enables [debugpy](https://github.com/microsoft/debugpy) support, which will let you
properly attach a debugger.
You may also want to modify `PYUNREALSDK_PYEXEC_ROOT` to point at your mod folder. This will let
you run `C:\path\to\new\mod\folder\test.py` using simply `pyexec test.py`.
Note that the mod manager download contains this file, so when updating you need to be careful
not to overwrite it/to restore it afterwards.
Expand Down Expand Up @@ -60,6 +63,34 @@ After finishing setting up, try take a quick read through the base sdk mod files
are all filled with all sorts of type hints and docstrings, which should help explain a lot about
how the SDK works.

## Experimenting Using the Console
When you start experimenting with a concept, it's easier to work in console than it is to write a
full mod. The SDK registers two custom console commands:
`py` lets you run small snippets of python. By default, it executes one line at a time, stripping
any leading whitespace.
```py
py from mods_base import get_pc
py pc = get_pc()
py print(pc)
```
You can also use heredoc-like syntax to execute multiline queries. This happens if the first two
non-whitespace characters are `<<` (which is invalid python syntax for a single line).
```py
py << EOF
is_hostile = get_pc().GetTeamComponent().IsHostile
for pawn in unrealsdk.find_all("OakCharacter", exact=False):
if not is_hostile(pawn):
print(pawn)
EOF
```
`pyexec` is useful for more complex scripts - it executes an entire file, relative to the location
set in `PYUNREALSDK_PYEXEC_ROOT` previously. Note that this is *not* running a python script in the
traditional sense, it's instead more similar to something like `eval(open(file).read())`. The
interpreter is not restarted, and there's no way to accept arguments into `sys.argv`.
## Adding to the Mod DB
The DB primarily sources info from your mod's `pyproject.toml`. With a well configured pyproject,
all you need to do is point the DB at it, and everything will be extracted automatically. To do
Expand Down
7 changes: 6 additions & 1 deletion faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ UNREALSDK_CONSOLE_KEY=F1
```
Note that this file is bundled with the SDK, so updating will overwrite it.

## My game is crashing when...
### I open one of the entrys in the BL3 Mod Menu
Update the sdk, this was fixed in version 1.3. The BL3 update on 2024-08-08 caused older versions of
the BL3 Mod Menu to crash when creating a slider or keybind option.

## How do I use this with the plugin loader for OpenHotfixLoader/BL3HM/other dll mods?
For convenience, the SDK zip comes with a plugin loader pre-packaged, the sdk itself is a plugin
just like everything else. You can just throw these other mods into the `Plugins` folder, and
Expand Down Expand Up @@ -65,4 +70,4 @@ dlls a few times to try avoid them:

This has shipped since SDK version 1.2.

No known issues \o/
No known issues \o/

0 comments on commit bcaf864

Please sign in to comment.