Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit dfbb08b

Browse files
authored
All the things (#5)
* No waiting * Enable all objects * update prune script * Prune 1 * Prune 2 * Prune 3 * Nuke particles and materials * Clean * less files * Remove most files * Sync * Add bitfields back * Stage
1 parent 99a8130 commit dfbb08b

File tree

4,795 files changed

+57782
-100409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,795 files changed

+57782
-100409
lines changed

Python/commander.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import bl2sdk
2+
import math
3+
4+
def convert_rotation(rotation):
5+
conversion = 65535.0 / math.pi / 2.0
6+
degree_pitch = rotation.Pitch / conversion
7+
degree_yaw = rotation.Yaw / conversion
8+
return degree_pitch, degree_yaw
9+
10+
def move_forward_backward(distance):
11+
pawn = engine.GamePlayers[0].Actor.AcknowledgedPawn
12+
position = pawn.Location
13+
pitch, yaw = convert_rotation(pawn.Rotation)
14+
position.Z += math.sin(pitch) * distance
15+
position.X += math.cos(yaw) * math.cos(pitch) * distance
16+
position.Y += math.sin(yaw) * math.cos(pitch) * distance
17+
18+
def noclip():
19+
pc = engine.GamePlayers[0].Actor
20+
pawn = pc.AcknowledgedPawn
21+
pc.WorldInfo.Game.AllowCheats(pc)
22+
if pc.bCheatFlying:
23+
pawn.Physics = 0x1
24+
pawn.PhysicsVolume.FluidFriction = 0.3
25+
pawn.MovementSpeedModifier = 1.0
26+
print("Disabling noclip")
27+
pc.bCheatFlying = False
28+
pawn.CheatWalk()
29+
pc.Restart(False)
30+
pawn.AccelRate = 2048
31+
pawn.AirSpeed = 440
32+
else:
33+
print("Enabling noclip")
34+
pawn.Physics = 0x4
35+
pawn.PhysicsVolume.FluidFriction = 2.0
36+
pawn.MovementSpeedModifier = 40
37+
pawn.CheatFly()
38+
pc.bCheatFlying = True
39+
pc.ClientGotoState(bl2sdk.FName("PlayerFlying"), bl2sdk.FName())
40+
pawn.AccelRate = 20000
41+
pawn.AirSpeed = 3000
42+
pawn.CheatGhost()
43+
44+
45+
def process_input(caller, function, parms, result):
46+
ControllerId = parms.popInt()
47+
Key = parms.popFName()
48+
EventType = parms.popByte()
49+
if EventType == 0:
50+
name = Key.GetName()
51+
if name == 'NumPadEight':
52+
move_forward_backward(100)
53+
if name == 'NumPadFive':
54+
noclip()
55+
56+
57+
engine = bl2sdk.UObject.FindObjectByFullName("WillowGameEngine Transient.WillowGameEngine")
58+
bl2sdk.RemoveEngineHook("Function WillowGame.WillowGameViewportClient.InputKey", "DoCommanderThings")
59+
bl2sdk.RegisterEngineHook("Function WillowGame.WillowGameViewportClient.InputKey", "DoCommanderThings", process_input)

Python/hooktest.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

bl2-sdk.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.27428.2037
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Loader", "bl2-sdk\bl2-sdk.vcxproj", "{32794345-2BB2-45E0-A461-914D13B0279F}"
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Borderlands 2 SDK", "bl2-sdk\bl2-sdk.vcxproj", "{32794345-2BB2-45E0-A461-914D13B0279F}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|x86 = Debug|x86
11-
Release|x86 = Release|x86
10+
Debug|x32 = Debug|x32
11+
Release|x32 = Release|x32
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{32794345-2BB2-45E0-A461-914D13B0279F}.Debug|x86.ActiveCfg = Debug|Win32
15-
{32794345-2BB2-45E0-A461-914D13B0279F}.Debug|x86.Build.0 = Debug|Win32
16-
{32794345-2BB2-45E0-A461-914D13B0279F}.Release|x86.ActiveCfg = Release|Win32
17-
{32794345-2BB2-45E0-A461-914D13B0279F}.Release|x86.Build.0 = Release|Win32
14+
{32794345-2BB2-45E0-A461-914D13B0279F}.Debug|x32.ActiveCfg = Debug|Win32
15+
{32794345-2BB2-45E0-A461-914D13B0279F}.Debug|x32.Build.0 = Debug|Win32
16+
{32794345-2BB2-45E0-A461-914D13B0279F}.Release|x32.ActiveCfg = Release|Win32
17+
{32794345-2BB2-45E0-A461-914D13B0279F}.Release|x32.Build.0 = Release|Win32
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

bl2-sdk/CPythonInterface.cpp

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,39 +50,37 @@ namespace py = pybind11;
5050

5151
PYBIND11_EMBEDDED_MODULE(bl2sdk, m)
5252
{
53-
Export_pystes_UObject(m);
54-
Export_pystes_UClass(m);
55-
Export_pystes_UInteraction(m);
56-
Export_pystes_UConsole(m);
57-
Export_pystes_UWillowConsole(m);
58-
Export_pystes_FString(m);
59-
Export_pystes_UGBXDefinition(m);
60-
Export_pystes_USkillTreeBranchDefinition(m);
61-
Export_pystes_USkillTreeBranchLayoutDefinition(m);
62-
Export_pystes_USkillDefinition(m);
63-
Export_pystes_FTier(m);
64-
Export_pystes_TArray(m);
65-
Export_pystes_UPlayer(m);
66-
Export_pystes_ULocalPlayer(m);
67-
Export_pystes_USubsystem(m);
68-
Export_pystes_UEngine(m);
69-
Export_pystes_UGameEngine(m);
70-
Export_pystes_UGearboxEngine(m);
71-
Export_pystes_UWillowGameEngine(m);
72-
Export_pystes_AActor(m);
73-
Export_pystes_AController(m);
74-
Export_pystes_APlayerController(m);
75-
Export_pystes_AGamePlayerController(m);
76-
Export_pystes_AGearboxPlayerController(m);
77-
Export_pystes_AWillowPlayerController(m);
78-
Export_pystes_FQWord(m);
7953
Export_pystes_gamedefines(m);
80-
Export_pystes_UStruct(m);
81-
Export_pystes_UFunction(m);
54+
Export_pystes_Core_structs(m);
55+
Export_pystes_Core_classes(m);
56+
Export_pystes_Engine_structs(m);
57+
Export_pystes_Engine_classes(m);
58+
Export_pystes_GameFramework_structs(m);
59+
Export_pystes_GameFramework_classes(m);
60+
Export_pystes_GFxUI_structs(m);
61+
Export_pystes_GFxUI_classes(m);
62+
Export_pystes_GearboxFramework_structs(m);
63+
Export_pystes_GearboxFramework_classes(m);
64+
Export_pystes_WillowGame_structs(m);
65+
Export_pystes_WillowGame_classes(m);
66+
Export_pystes_AkAudio_structs(m);
67+
Export_pystes_AkAudio_classes(m);
68+
Export_pystes_IpDrv_structs(m);
69+
Export_pystes_IpDrv_classes(m);
70+
Export_pystes_WinDrv_structs(m);
71+
Export_pystes_WinDrv_classes(m);
72+
Export_pystes_XAudio2_structs(m);
73+
Export_pystes_XAudio2_classes(m);
74+
Export_pystes_OnlineSubsystemSteamworks_structs(m);
75+
Export_pystes_OnlineSubsystemSteamworks_classes(m);
76+
Export_pystes_TArray(m);
8277
m.def("Log", [](std::string in) { Logging::Log(in.c_str(), in.length()); });
8378
m.def("LoadPackage", &BL2SDK::LoadPackage);
8479
m.def("RegisterEngineHook", &RegisterEngineHook);
8580
m.def("RegisterScriptHook", &RegisterScriptHook);
81+
m.def("RemoveEngineHook", [](const std::string& funcName, const std::string& hookName) {GameHooks::EngineHookManager->Remove(funcName, hookName); });
82+
m.def("RemoveScriptHook", [](const std::string& funcName, const std::string& hookName) {GameHooks::UnrealScriptHookManager->Remove(funcName, hookName); });
83+
m.def("DoInjectedCallNext", &BL2SDK::doInjectedCallNext);
8684
}
8785

8886
bool PythonGCTick(UObject* caller, UFunction* function, void* parms, void* result)

0 commit comments

Comments
 (0)