Fix Skyfire (you have to destroytarget the doors)

This commit is contained in:
Gray
2025-03-23 18:21:42 -04:00
parent 74c588d51e
commit 228240101d
5 changed files with 65 additions and 15 deletions

View File

@@ -28,6 +28,8 @@ struct FGuid
} }
}; };
// #define PE_SAFETY
class UObject class UObject
{ {
public: public:
@@ -42,12 +44,28 @@ public:
/* virtual */ void ProcessEvent(UFunction* Function, void* Parms = nullptr) /* virtual */ void ProcessEvent(UFunction* Function, void* Parms = nullptr)
{ {
#ifdef PE_SAFETY
if (!Function)
{
LOG_INFO(LogDev, "TRIED CALLING INVALID PE FUNC! Ignoring.");
return;
}
#endif
// LOG_INFO(LogDev, "PE: 0x{:x}", __int64(ProcessEventOriginal) - __int64(GetModuleHandleW(0))); // LOG_INFO(LogDev, "PE: 0x{:x}", __int64(ProcessEventOriginal) - __int64(GetModuleHandleW(0)));
ProcessEventOriginal(this, Function, Parms); ProcessEventOriginal(this, Function, Parms);
} }
/* virtual */ void ProcessEvent(UFunction* Function, void* Parms = nullptr) const /* virtual */ void ProcessEvent(UFunction* Function, void* Parms = nullptr) const
{ {
#ifdef PE_SAFETY
if (!Function)
{
LOG_INFO(LogDev, "TRIED CALLING INVALID PE FUNC! Ignoring.");
return;
}
#endif
// LOG_INFO(LogDev, "PE: 0x{:x}", __int64(ProcessEventOriginal) - __int64(GetModuleHandleW(0))); // LOG_INFO(LogDev, "PE: 0x{:x}", __int64(ProcessEventOriginal) - __int64(GetModuleHandleW(0)));
ProcessEventOriginal(this, Function, Parms); ProcessEventOriginal(this, Function, Parms);
} }

View File

@@ -669,6 +669,8 @@ void ChangeLevels()
// auto bruh = std::wstring(CustomMapName.begin(), CustomMapName.end()); // auto bruh = std::wstring(CustomMapName.begin(), CustomMapName.end());
// auto bruhh = (L"open " + bruh); // auto bruhh = (L"open " + bruh);
bool bShouldUseMoleMap = PlaylistName == "/MoleGame/Playlists/Playlist_MoleGame.Playlist_MoleGame";
FString LevelB = /* bUseCustomMap ? bruhh.c_str() : */ (Engine_Version < 424 FString LevelB = /* bUseCustomMap ? bruhh.c_str() : */ (Engine_Version < 424
? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501 ? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501
? L"open Asteria_Terrain" ? L"open Asteria_Terrain"
@@ -685,7 +687,16 @@ void ChangeLevels()
: Globals::bCreative ? L"Creative_NoApollo_Terrain" : Globals::bCreative ? L"Creative_NoApollo_Terrain"
: L"Apollo_Terrain"); : L"Apollo_Terrain");
LOG_INFO(LogDev, "Using {}.", bUseSwitchLevel ? Level.ToString() : LevelB.ToString()); /* i think im dumb
if (bShouldUseMoleMap)
{
// FString MoleMap = L"/MoleGame/Maps/MoleGame_Layout.MoleGame_Layout";
LevelB = L"open MoleGame_Layout";
Level = L"MoleGame_Layout";
}
*/
LOG_INFO(LogDev, "Using \"{}\" as our map.", bUseSwitchLevel ? Level.ToString() : LevelB.ToString());
auto LocalPC = GetLocalPlayerController(); auto LocalPC = GetLocalPlayerController();
@@ -1062,7 +1073,7 @@ DWORD WINAPI Main(LPVOID)
ChangeLevels(); ChangeLevels();
LOG_INFO(LogDev, "Switch levels."); LOG_INFO(LogDev, "Switched levels.");
if (Fortnite_Version < 20 && Fortnite_Version != 12) if (Fortnite_Version < 20 && Fortnite_Version != 12)
ApplyNullAndRetTrues(); ApplyNullAndRetTrues();

View File

@@ -796,6 +796,8 @@ static inline void StartEvent()
CallOnReadys(); CallOnReadys();
LOG_INFO(LogDev, "Called the on readys!");
if (Fortnite_Version >= 17.30) if (Fortnite_Version >= 17.30)
{ {
static auto OnRep_RootStartTimeFn = FindObject<UFunction>(L"/Script/SpecialEventGameplayRuntime.SpecialEventScriptMeshActor.OnRep_RootStartTime"); static auto OnRep_RootStartTimeFn = FindObject<UFunction>(L"/Script/SpecialEventGameplayRuntime.SpecialEventScriptMeshActor.OnRep_RootStartTime");
@@ -805,7 +807,8 @@ static inline void StartEvent()
if (Fortnite_Version == 17.50) if (Fortnite_Version == 17.50)
{ {
auto Scripting = FindObject<UObject>(L"/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.BP_Kiwi_Master_Scripting_2"); auto KiwiMasterScripting = FindObject<UObject>(L"/Kiwi/Levels/Kiwi_P.Kiwi_P.PersistentLevel.BP_Kiwi_Master_Scripting_2");
LOG_INFO(LogDev, "KiwiMasterScripting: {}", __int64(KiwiMasterScripting));
float SecondsSinceEventBegan = 0; float SecondsSinceEventBegan = 0;
@@ -821,22 +824,33 @@ static inline void StartEvent()
{ {
OnReadyParams.PlaylistContextTags = FGameplayTagContainer(); OnReadyParams.PlaylistContextTags = FGameplayTagContainer();
} }
auto BB = FindObject<UFunction>(L"/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.OnReady_F1A32853487CB7603278E6847A5F2625");
Scripting->ProcessEvent(BB, &OnReadyParams);
auto eventscript = FindObject("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.Kiwi_EventScript_2"); auto KiwiMasterScriptingOnReady = FindObject<UFunction>(L"/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.OnReady_F1A32853487CB7603278E6847A5F2625");
auto CC = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.OnReady_F51BF8E143832CE6C552938B26BEFA93"); LOG_INFO(LogDev, "KiwiMasterScriptingOnReady: {}", __int64(KiwiMasterScriptingOnReady));
auto DD = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.LoadKiwiAssets"); KiwiMasterScripting->ProcessEvent(KiwiMasterScriptingOnReady, &OnReadyParams);
// auto eventscript = FindObject("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.Kiwi_EventScript_2");
auto KiwiOnReadyIdk = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.OnReady_F51BF8E143832CE6C552938B26BEFA93");
auto KiwiLoadAssets = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.LoadKiwiAssets");
auto StartEventAtIndex = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.StartEventAtIndex"); auto StartEventAtIndex = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.StartEventAtIndex");
auto BP_OnScriptReady = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.BP_OnScriptReady"); auto BP_OnScriptReady = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.BP_OnScriptReady");
// eventscript->ProcessEvent(CC, &bbparms); LOG_INFO(LogDev, "KiwiLoadAssets: {}", __int64(KiwiLoadAssets));
eventscript->ProcessEvent(DD, &OnReadyParams); LOG_INFO(LogDev, "BP_OnScriptReady: {}", __int64(BP_OnScriptReady));
eventscript->ProcessEvent(BP_OnScriptReady, &OnReadyParams); LOG_INFO(LogDev, "StartEventAtIndex: {}", __int64(StartEventAtIndex));
eventscript->ProcessEvent(StartEventAtIndex, &SecondsSinceEventBegan);
static auto StartEvent = FindObject<UFunction>("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.startevent"); // EventScripting->ProcessEvent(KiwiOnReadyIdk, &bbparms);
Scripting->ProcessEvent(StartEvent, &SecondsSinceEventBegan); EventScripting->ProcessEvent(KiwiLoadAssets, &OnReadyParams);
LOG_INFO(LogDev, "CAlled KiwiLoadAssets!");
EventScripting->ProcessEvent(BP_OnScriptReady, &OnReadyParams);
LOG_INFO(LogDev, "CAlled BP_OnScriptReady!");
int InStartingIndex = 0;
// EventScripting->ProcessEvent(StartEventAtIndex, &InStartingIndex);
LOG_INFO(LogDev, "CAlled StartEventAtIndex!");
auto KiwiStartEvent = FindObject<UFunction>("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.startevent");
LOG_INFO(LogDev, "KiwiStartEvent: {}", __int64(KiwiStartEvent));
KiwiMasterScripting->ProcessEvent(KiwiStartEvent, &SecondsSinceEventBegan);
} }
if (AllSpecialEventScriptMeshActors.Num() > 0) if (AllSpecialEventScriptMeshActors.Num() > 0)

View File

@@ -868,7 +868,7 @@ static inline uint64 FindNoMCP()
if (noMcpIthink.Get()) if (noMcpIthink.Get())
{ {
if (*noMcpIthink.GetAs<uint8_t*>() == 0xE8 || *noMcpIthink.GetAs<uint8_t*>() == 0xE9) // ex 7.20 if (*noMcpIthink.GetAs<uint8_t*>() == 0xE8 || *noMcpIthink.GetAs<uint8_t*>() == 0xE9) // ex 7.20 (14.60 maybe too?)
{ {
LOG_INFO(LogDev, "Weird MCP thing!"); LOG_INFO(LogDev, "Weird MCP thing!");
noMcpIthink.RelativeOffset(1); // we are in the weird thing that compiler does when the func is just in a jmp noMcpIthink.RelativeOffset(1); // we are in the weird thing that compiler does when the func is just in a jmp

View File

@@ -24,6 +24,13 @@ template <typename T = UObject>
static inline T* FindObject(const TCHAR* Name, UClass* Class = nullptr, UObject* Outer = nullptr) static inline T* FindObject(const TCHAR* Name, UClass* Class = nullptr, UObject* Outer = nullptr)
{ {
auto res = (T*)StaticFindObject/*<T>*/(Class, Outer, Name); auto res = (T*)StaticFindObject/*<T>*/(Class, Outer, Name);
/*
if (!res)
{
std::wstring NameWStr = std::wstring(Name);
LOG_WARN(LogDev, "Failed to find object: {}", std::string(NameWStr.begin(), NameWStr.end()));
}
*/
return res; return res;
} }