Skip to content

Commit

Permalink
docs: add new example, add warning to notifyonnewobject, update configs
Browse files Browse the repository at this point in the history
fix: apparently github lies about allowing multiple PR templates

Revert deleting a bunch of configs as I got mixed up with sigs

use generic example in notifyonnewobject
  • Loading branch information
Buckminsterfullerene02 committed Feb 13, 2024
1 parent 40fd010 commit 953c8f1
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 96 deletions.
File renamed without changes.

This file was deleted.

2 changes: 2 additions & 0 deletions assets/CustomGameConfigs/Readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
These settings are for games that have altered the engine in ways that make UE4SS not work out of the box.
The folder structure in each game folder is the same as the regular UE4SS structure, meaning that files in the root directory go in the UE4SS root directory.

IMPORTANT: Some of these files may be out of date as the games/UE4ss updates. If you find that a game's custom game config is out of date, please open an issue on the UE4SS-RE/RE-UE4SS repository. Make sure that you first test if the game works without the custom game config, as it may have been fixed in the latest version of UE4SS.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions assets/CustomGameConfigs/cyubeVR/UE4SS_Signatures/GMalloc.lua

This file was deleted.

This file was deleted.

This file was deleted.

46 changes: 18 additions & 28 deletions docs/custom-game-configs.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
# Custom Game Configs

These settings are for games that have altered the engine in ways that make UE4SS not work out of the box.

The folder structure in each game folder is the same as the regular UE4SS structure, meaning that files in the root directory goes in the UE4SS root directory.

[cyubeVR](https://github.com/UE4SS-RE/RE-UE4SS/files/9932937/cyubeVR.zip)


[Kingdom Hearts 3](https://github.com/UE4SS-RE/RE-UE4SS/files/9932938/Kingdom.Hearts.3.zip)


[Satisfactory](https://github.com/UE4SS-RE/RE-UE4SS/files/9932939/Satisfactory.zip)

> IMPORTANT: Some of these files may be out of date as the games/UE4SS updates. If you find that a game's custom game config is out of date, please open an issue on the UE4SS-RE/RE-UE4SS repository. Make sure that you first test if the game works without the custom game config, as it may have been fixed in the latest version of UE4SS.
[The Outer Worlds](https://github.com/UE4SS-RE/RE-UE4SS/files/9932940/The.Outer.Worlds.zip)

[Returnal](https://github.com/UE4SS-RE/RE-UE4SS/tree/Release/CustomGameConfigs/Returnal/)


[Borderlands 3](https://github.com/UE4SS-RE/RE-UE4SS/files/9932941/Borderlands.3.zip)


[Final Fantasy 7 Remake](https://github.com/UE4SS-RE/RE-UE4SS/files/10053322/Final.Fantasy.7.Remake.zip)


[Walking Dead Saints & Sinners](https://github.com/UE4SS-RE/RE-UE4SS/files/9932942/Walking.Dead.Saints.Sinners.zip)
These settings are for games that have altered the engine in ways that make UE4SS not work out of the box.

You need to download the files from each folder for your game and place them in the same folder in your UE4SS installation. For example, downloading the configs for Kingdom Hearts 3 should result in your files being in the following structure:

[Fuser](https://github.com/UE4SS-RE/RE-UE4SS/tree/Release/CustomGameConfigs/Fuser)
```
Binaries/Win64/
├── CustomGameConfigs/
│ └── Kingdom Hearts 3/
│ ├── UE4SS_Signatures/
│ │ ├── FName_Constructor.lua
│ │ ├── FName_ToString.lua
│ │ ├── StaticConstructObject.lua
│ ├── MemberVariableLayout.ini
│ ├── UE4SS-settings.ini
│ ├── VTableLayout.ini
```

[Ghost Wire Tokyo](https://github.com/UE4SS-RE/RE-UE4SS/tree/Release/CustomGameConfigs/Ghost%20Wire%20Tokyo)
... but obviously the file structure will change depending on the game's configs.

[Like a Dragon Ishin!](https://github.com/UE4SS-RE/RE-UE4SS/tree/Release/CustomGameConfigs/Like%20a%20Dragon%20Ishin!)
If you download the zDEV version, all these files are already included in the zip file.

[Star Wars Jedi Fallen Order](https://github.com/UE4SS-RE/RE-UE4SS/tree/Release/CustomGameConfigs/Star%20Wars%20Jedi%20Fallen%20Order)
[You can find them here](https://github.com/UE4SS-RE/RE-UE4SS/tree/main/assets/CustomGameConfigs)
1 change: 1 addition & 0 deletions docs/lua-api/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Check the code snippets at the bottom of the individual pages in the Lua API section and [tutorials](../guides/creating-a-lua-mod.md) in this repository.
* Hogwarts Legacy modding uses UE4SS' Lua API for its primary logic mods. This [website](https://modding.wiki/en/hogwartslegacy/developers/luaexamples) contains example code for some of the mods.
* You can search for interesting code in that page, the collapsed sections of the webpage will auto-expand when the text is found.
* The [Palworld modding wiki](https://pwmodding.wiki/docs/category/lua-modding) has some decent docs and examples on how to develop Lua mods for new learners.
* Search GitHub for any Lua code calling reasonably uniquely-named UE4SS API functions, excluding the actual UE4SS repository from the search:
* https://github.com/search?q=language%3ALua+StaticFindObject+NOT+repo%3AUE4SS-RE%2FRE-UE4SS&type=code
* https://github.com/search?q=language%3ALua+FindFirstOf+NOT+repo%3AUE4SS-RE%2FRE-UE4SS&type=code
Expand Down
34 changes: 34 additions & 0 deletions docs/lua-api/global-functions/notifyonnewobject.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,38 @@ Inheritance is taken into account, so if you provide `"/Script/Engine.Actor"` as
NotifyOnNewObject("/Script/Engine.Actor", function(ConstructedObject)
print(string.format("Constructed: %s\n", ConstructedObject:GetFullName()))
end)
```

## What NOT to do

Please don't duplicate the `NotifyOnNewObject` call for the same class multiple times, as it could cause performance issues if multiple mods are doing it (which has been seen in the wild).

For example, this:
```lua
NotifyOnNewObject("/Script/Engine.PlayerController", function(PlayerController)
PlayerController.bShowMouseCursor = true
end)
NotifyOnNewObject("/Script/Engine.PlayerController", function(PlayerController)
PlayerController.bForceFeedbackEnabled = false
end)
NotifyOnNewObject("/Script/Engine.PlayerController", function(PlayerController)
PlayerController.InputYawScale = 2.5
end)
NotifyOnNewObject("/Script/Engine.PlayerController", function(PlayerController)
PlayerController.InputPitchScale = -2.5
end)
NotifyOnNewObject("/Script/Engine.PlayerController", function(PlayerController)
PlayerController.InputRollScale = 1.0
end)
```

should just be this:
```lua
NotifyOnNewObject("/Script/Engine.PlayerController", function(PlayerController)
PlayerController.bShowMouseCursor = true
PlayerController.bForceFeedbackEnabled = false
PlayerController.InputYawScale = 2.5
PlayerController.InputPitchScale = -2.5
PlayerController.InputRollScale = 1.0
end)
```

0 comments on commit 953c8f1

Please sign in to comment.