i probably broke the whole projecvt

This commit is contained in:
Milxnor
2023-03-07 11:09:26 -05:00
parent ae259f97eb
commit eb3685c070
20 changed files with 543 additions and 182 deletions

View File

@@ -73,6 +73,12 @@ static void StreamLevel(std::string LevelName, FVector Location = {})
Transform.Translation = Location;
auto BuildingFoundation = GetWorld()->SpawnActor<ABuildingSMActor>(BuildingFoundation3x3Class, Transform);
if (!BuildingFoundation)
{
LOG_ERROR(LogGame, "Failed to spawn BuildingFoundation for streaming!");
return;
}
BuildingFoundation->InitializeBuildingActor(BuildingFoundation, nullptr, false);
static auto FoundationNameOffset = FindOffsetStruct("/Script/FortniteGame.BuildingFoundationStreamingData", "FoundationName");
@@ -150,150 +156,160 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
{
LastNum2 = AmountOfRestarts;
LOG_INFO(LogDev, "Presetup!");
GameMode->Get<int>("WarmupRequiredPlayerCount") = 1;
SetPlaylist(GetPlaylistToUse());
{
SetPlaylist(GetPlaylistToUse());
LOG_INFO(LogDev, "Set playlist!");
}
auto Fortnite_Season = std::floor(Fortnite_Version);
if (Fortnite_Season == 6)
// if (false)
{
if (Fortnite_Version != 6.10)
auto Fortnite_Season = std::floor(Fortnite_Version);
if (Fortnite_Season == 6)
{
auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake1"));
auto Lake2 = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake2");
Fortnite_Version <= 6.21 ? ShowFoundation(Lake) : ShowFoundation(Lake2);
// ^ This shows the lake after or before the event i dont know if this is needed.
}
else
{
auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest12"));
ShowFoundation(Lake);
}
auto FloatingIsland = Fortnite_Version == 6.10 ? FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest13")) :
FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_FloatingIsland"));
ShowFoundation(FloatingIsland);
}
if (Fortnite_Season >= 7 && Fortnite_Season <= 10)
{
if (Fortnite_Season == 7)
{
if (Fortnite_Version == 7.30)
if (Fortnite_Version != 6.10)
{
auto PleasantParkIdk = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkFestivus"));
ShowFoundation(PleasantParkIdk);
auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake1"));
auto Lake2 = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake2");
auto PleasantParkGround = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkDefault");
ShowFoundation(PleasantParkGround);
Fortnite_Version <= 6.21 ? ShowFoundation(Lake) : ShowFoundation(Lake2);
// ^ This shows the lake after or before the event i dont know if this is needed.
}
else
{
auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest12"));
ShowFoundation(Lake);
}
auto PolarPeak = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_25x36"));
ShowFoundation(PolarPeak);
auto FloatingIsland = Fortnite_Version == 6.10 ? FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest13")) :
FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_FloatingIsland"));
auto tiltedtower = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.ShopsNew");
ShowFoundation(tiltedtower); // 7.40 specific?
ShowFoundation(FloatingIsland);
}
else if (Fortnite_Season == 8)
if (Fortnite_Season >= 7 && Fortnite_Season <= 10)
{
auto Volcano = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_50x53_Volcano"));
ShowFoundation(Volcano);
}
else if (Fortnite_Season == 10)
{
if (Fortnite_Version >= 10.20)
if (Fortnite_Season == 7)
{
auto Island = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest16");
ShowFoundation(Island);
if (Fortnite_Version == 7.30)
{
auto PleasantParkIdk = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkFestivus"));
ShowFoundation(PleasantParkIdk);
auto PleasantParkGround = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkDefault");
ShowFoundation(PleasantParkGround);
}
auto PolarPeak = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_25x36"));
ShowFoundation(PolarPeak);
auto tiltedtower = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.ShopsNew");
ShowFoundation(tiltedtower); // 7.40 specific?
}
else if (Fortnite_Season == 8)
{
auto Volcano = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_50x53_Volcano"));
ShowFoundation(Volcano);
}
else if (Fortnite_Season == 10)
{
if (Fortnite_Version >= 10.20)
{
auto Island = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest16");
ShowFoundation(Island);
}
}
auto TheBlock = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank
ShowFoundation(TheBlock);
}
auto TheBlock = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank
ShowFoundation(TheBlock);
}
if (Fortnite_Version == 17.50f) {
auto FarmAfter = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.farmbase_2"));
ShowFoundation(FarmAfter);
if (Fortnite_Version == 17.50f) {
auto FarmAfter = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.farmbase_2"));
ShowFoundation(FarmAfter);
auto FarmPhase = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Farm_Phase_03")); // Farm Phases (Farm_Phase_01, Farm_Phase_02 and Farm_Phase_03)
ShowFoundation(FarmPhase);
}
auto FarmPhase = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Farm_Phase_03")); // Farm Phases (Farm_Phase_01, Farm_Phase_02 and Farm_Phase_03)
ShowFoundation(FarmPhase);
}
if (Fortnite_Version == 17.40f) {
auto AbductedCoral = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.CoralPhase_02")); // Coral Castle Phases (CoralPhase_01, CoralPhase_02 and CoralPhase_03)
ShowFoundation(AbductedCoral);
if (Fortnite_Version == 17.40f) {
auto AbductedCoral = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.CoralPhase_02")); // Coral Castle Phases (CoralPhase_01, CoralPhase_02 and CoralPhase_03)
ShowFoundation(AbductedCoral);
auto CoralFoundation_01 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation_0"));
ShowFoundation(CoralFoundation_01);
auto CoralFoundation_01 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation_0"));
ShowFoundation(CoralFoundation_01);
auto CoralFoundation_05 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation6"));
ShowFoundation(CoralFoundation_05);
auto CoralFoundation_05 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation6"));
ShowFoundation(CoralFoundation_05);
auto CoralFoundation_07 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation3"));
ShowFoundation(CoralFoundation_07);
auto CoralFoundation_07 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation3"));
ShowFoundation(CoralFoundation_07);
auto CoralFoundation_10 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation2_1"));
ShowFoundation(CoralFoundation_10);
auto CoralFoundation_10 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation2_1"));
ShowFoundation(CoralFoundation_10);
auto CoralFoundation_13 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation4"));
ShowFoundation(CoralFoundation_13);
auto CoralFoundation_13 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation4"));
ShowFoundation(CoralFoundation_13);
auto CoralFoundation_17 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation5"));
ShowFoundation(CoralFoundation_17);
}
auto CoralFoundation_17 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation5"));
ShowFoundation(CoralFoundation_17);
}
if (Fortnite_Version == 17.30f) {
auto AbductedSlurpy = FindObject(("LF_Athena_POI_50x50_C /Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Slurpy_Phase03")); // Slurpy Swamp Phases (Slurpy_Phase01, Slurpy_Phase02 and Slurpy_Phase03)
ShowFoundation(AbductedSlurpy);
}
if (Fortnite_Version == 17.30f) {
auto AbductedSlurpy = FindObject(("LF_Athena_POI_50x50_C /Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Slurpy_Phase03")); // Slurpy Swamp Phases (Slurpy_Phase01, Slurpy_Phase02 and Slurpy_Phase03)
ShowFoundation(AbductedSlurpy);
}
if (Fortnite_Season == 13)
{
auto SpawnIsland = FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation");
ShowFoundation(SpawnIsland);
// SpawnIsland->RepData->Soemthing = FoundationSetup->LobbyLocation;
}
if (Fortnite_Version == 12.41)
{
auto JS03 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_Athena_POI_19x19_2"));
ShowFoundation(JS03);
auto JH00 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head6_18"));
ShowFoundation(JH00);
auto JH01 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head5_14"));
ShowFoundation(JH01);
auto JH02 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head3_8"));
ShowFoundation(JH02);
auto JH03 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head_2"));
ShowFoundation(JH03);
auto JH04 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head4_11"));
ShowFoundation(JH04);
}
auto PlaylistToUse = GetPlaylistToUse();
if (PlaylistToUse)
{
static auto AdditionalLevelsOffset = PlaylistToUse->GetOffset("AdditionalLevels");
auto& AdditionalLevels = PlaylistToUse->Get<TArray<TSoftObjectPtr<UClass>>>(AdditionalLevelsOffset);
for (int i = 0; i < AdditionalLevels.Num(); i++)
if (Fortnite_Season == 13)
{
// auto World = Cast<UWorld>(Playlist->AdditionalLevels[i].Get());
// StreamLevel(UKismetSystemLibrary::GetPathName(World->PersistentLevel).ToString());
StreamLevel(AdditionalLevels.at(i).SoftObjectPtr.ObjectID.AssetPathName.ToString());
auto SpawnIsland = FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation");
ShowFoundation(SpawnIsland);
// SpawnIsland->RepData->Soemthing = FoundationSetup->LobbyLocation;
}
if (Fortnite_Version == 12.41)
{
auto JS03 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_Athena_POI_19x19_2"));
ShowFoundation(JS03);
auto JH00 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head6_18"));
ShowFoundation(JH00);
auto JH01 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head5_14"));
ShowFoundation(JH01);
auto JH02 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head3_8"));
ShowFoundation(JH02);
auto JH03 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head_2"));
ShowFoundation(JH03);
auto JH04 = FindObject(("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head4_11"));
ShowFoundation(JH04);
}
auto PlaylistToUse = GetPlaylistToUse();
if (PlaylistToUse)
{
static auto AdditionalLevelsOffset = PlaylistToUse->GetOffset("AdditionalLevels");
auto& AdditionalLevels = PlaylistToUse->Get<TArray<TSoftObjectPtr<UClass>>>(AdditionalLevelsOffset);
LOG_INFO(LogPlaylist, "Loading {} playlist levels.", AdditionalLevels.Num());
for (int i = 0; i < AdditionalLevels.Num(); i++)
{
// auto World = Cast<UWorld>(Playlist->AdditionalLevels[i].Get());
// StreamLevel(UKismetSystemLibrary::GetPathName(World->PersistentLevel).ToString());
StreamLevel(AdditionalLevels.at(i).SoftObjectPtr.ObjectID.AssetPathName.ToString());
}
}
}
}
@@ -320,14 +336,18 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
{
LastNum5 = AmountOfRestarts;
bool bb;
CallOnReadys(&bb);
if (Globals::bGoingToPlayEvent)
{
bool bb;
CallOnReadys(&bb);
if (!bb)
LastNum5 = -1;
if (!bb)
LastNum5 = -1;
}
}
/* static auto FortPlayerStartWarmupClass = FindObject<UClass>("/Script/FortniteGame.FortPlayerStartWarmup");
/*
static auto FortPlayerStartWarmupClass = FindObject<UClass>("/Script/FortniteGame.FortPlayerStartWarmup");
TArray<AActor*> Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortPlayerStartWarmupClass);
int ActorsNum = Actors.Num();
@@ -335,7 +355,15 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
Actors.Free();
if (ActorsNum == 0)
return false; */
return false;
*/
static int LastNum9 = 1;
if (AmountOfRestarts != LastNum9)
{
LastNum9 = AmountOfRestarts;
}
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
auto MapInfo = GameState->Get(MapInfoOffset);
@@ -351,6 +379,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
{
LastNum3 = AmountOfRestarts;
LOG_INFO(LogNet, "Attempting to listen!");
GetWorld()->Listen();
SetBitfield(GameMode->GetPtr<PlaceholderBitfield>("bWorldIsReady"), 1, true);
@@ -374,11 +404,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
float TimeSeconds = 35.f; // UGameplayStatics::GetTimeSeconds(GetWorld());
if (Engine_Version >= 424)
{
GameState->GetGamePhase() = EAthenaGamePhase::Warmup;
GameState->OnRep_GamePhase();
}
LOG_INFO(LogDev, "Initializing!");
GameState->Get<float>("WarmupCountdownEndTime") = TimeSeconds + Duration;
GameMode->Get<float>("WarmupCountdownDuration") = Duration;
@@ -386,7 +412,9 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
GameState->Get<float>("WarmupCountdownStartTime") = TimeSeconds;
GameMode->Get<float>("WarmupEarlyCountdownDuration") = EarlyDuration;
GameState->OnRep_CurrentPlaylistInfo();
// GameState->Get<bool>("bGameModeWillSkipAircraft") = Globals::bGoingToPlayEvent && Fortnite_Version == 17.30;
// GameState->OnRep_CurrentPlaylistInfo();
LOG_INFO(LogDev, "Initialized!");
}
@@ -426,6 +454,18 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
if (!NewPlayerActor)
return;
static bool bFirst = Engine_Version >= 424;
auto GameState = GameMode->GetGameStateAthena();
if (bFirst)
{
bFirst = false;
GameState->GetGamePhase() = EAthenaGamePhase::Warmup;
GameState->OnRep_GamePhase();
}
auto SpawnIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C");
auto BRIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_01.Tiered_Athena_FloorLoot_01_C");
@@ -493,8 +533,6 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
}
}
auto GameState = GameMode->GetGameStateAthena();
auto NewPlayer = (AFortPlayerControllerAthena*)NewPlayerActor;
auto WorldInventory = NewPlayer->GetWorldInventory();
@@ -557,7 +595,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
PlayerStateAthena->ProcessEvent(OnRep_bHasStartedPlayingFn);
}
// if (false)
if (false)
{
static auto GameplayAbilitySet = LoadObject<UObject>(L"/Game/Abilities/Player/Generic/Traits/DefaultPlayer/GAS_AthenaPlayer.GAS_AthenaPlayer") ?
LoadObject<UObject>(L"/Game/Abilities/Player/Generic/Traits/DefaultPlayer/GAS_AthenaPlayer.GAS_AthenaPlayer") :