Game Won't Launch

When I launch my game it gives me an error message: image
Here is what it says in Unreal:

LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error: === Critical error: ===
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error:
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:Runtime\Core\Public\Containers/Array.h] [Line: 611]
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error: Array index out of bounds: 0 from an array of size 0
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error:
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error:
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error:
LogPlayLevel: Error: [2020.05.11-14.41.48:503][  0]LogWindows: Error: end: stack for UAT
LogPlayLevel: Error: ERROR: Client exited with error code: 3

I have used the .txt trick to get the game to compile faster, but that may be causing this issue. I have no errors in my code.

Begin play looks like this:

void UBullCowCartridge::BeginPlay() // When the game starts
{
    Super::BeginPlay();
    const FString WordsPath = FPaths::ProjectContentDir() / TEXT("HiddenWordList.txt");
    FFileHelper::LoadFileToStringArray(Words, *WordsPath);

    Isograms = GetValidWords(Words);

    SetupGame();
}

Other than an exit function, it is the exact same as the instructor’s code. The exit function is not causing the issue because I have commented it out to try it. I have also deleted my Binaries, Saved, and Intermediate and refreshed them.

Could you try with the following logs added

void UBullCowCartridge::BeginPlay() // When the game starts
{
    Super::BeginPlay();
    const FString WordsPath = FPaths::ProjectContentDir() / TEXT("HiddenWordList.txt");
    FFileHelper::LoadFileToStringArray(Words, *WordsPath);
    UE_LOG(LogTemp, Warning, TEXT("Words has %i words", Words.Num()) 

    Isograms = GetValidWords(Words);
    UE_LOG(LogTemp, Warning, TEXT("Isograms has %i words", Isograms.Num()) 
    SetupGame();
}

I just did and compiled it. Here’s what it said when I went to launch:

LogPlayLevel: Warning: [2020.05.12-15.26.17:661][  0]LogTemp: Warning: Words has 0 words
LogPlayLevel: Warning: [2020.05.12-15.26.17:661][  0]LogTemp: Warning: Isograms has 0 words
LogPlayLevel: Warning: [2020.05.12-15.26.17:661][  0]LogOutputDevice: Warning:
LogPlayLevel: Script Stack (0 frames):
LogPlayLevel: Warning: [2020.05.12-15.26.23:254][  0]LogWindows: Warning: CreateProc failed: The system cannot find the file specified. (0x00000002)
LogPlayLevel: Warning: [2020.05.12-15.26.23:254][  0]LogWindows: Warning: URL: ../../../Engine/Binaries/Win64/CrashReportClient.exe "C:/Users/Caleb/Documents/repos/Unreal/BullCowGame-starter-kit/Saved/StagedBuilds/WindowsNoEditor/BullCowGame/Saved/Crashes/UE4CC-Windows-841E3B154B9D485A1C7DADA2DF1A9187_0000" -AppName=UE4-BullCowGame -CrashGUID=UE4CC-Windows-8
41E3B154B9D485A1C7DADA2DF1A9187_0000 -DebugSymbols=..\..\..\Engine\Intermediate\Symbols

Because it is saying it could not find the file in memory 0x00000002 does that mean that the FFileHelper::LoadFileToStringArray(Words, *WordsPath); is wrong because it has the pointer?

I think it’s the .txt file that’s causing the issue. I looked in the content browser, and I could not find the .txt file. When I went to import it, I could not find it becasue UE4 cannot import .txt files. The only thing relating to text is a .csv file, and I do not know how to import it.

You don’t import it you just put it there. What did you do with the text file?

It is still there in the Content folder where I saved it last. I reverted my code to the way it was before I did the .csv. I tested, and it works on play but not on launch.

Could you show me the directory and the contents of the .txt (the first page is enough)

The directory is C:\Users\Caleb\Documents\repos\Unreal\BullCowGame-starter-kit\Content and the contents are

a, 
ability, 
able, 
about, 
above, 
accept, 
according, 
account, 
across, 
act, 
action, 
activity, 
actually, 
add, 
address, 
administration, 
admit, 
adult, 
affect, 
after, 
again, 
against, 
age, 
agency, 
agent, 
ago, 
agree, 
agreement, 
ahead, 
air, 
all, 
allow, 
almost, 
alone, 
along, 
already, 

etc.

I was also going to check the spelling of the file against the code you have written.

It’s the same thing: “HiddenWordList.txt”.

The code says:
const FString WordsPath = FPaths::ProjectContentDir() / TEXT("HiddenWordList.txt");

And there’s definitely no typos?

I do note that you have commas in the file which need to be removed but that shouldn’t cause the array to not be populated.

Thank you about the commas, I forgot them in there from the csv thing. There are no typos. Like I said, it is working in the play tab, but not in the launch function in Windows. I might try to export it to HTML5 and see if that works, but it takes forever. I made sure that my Windows is updated though, so it should be fine. It also works in the PIE editor. Aaaand the standalone game mode.

I can send you the files if you want them.

Oh wait I missed that part where you said it worked in the editor.

When did you read the OP for FFileHelper? I recently updated it with information regarding packaging.

1 Like

That’s it! Thanks, it was able to launch. :grin:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms