Unreal Engine 4.25.3 crushes when it is compiled and clicked play

I am using VS CODE. I am studying Udemy lessons of UNREAL C++. at 45th lesson(making a “Bull Cow Game”), I did as they say and tried to make unreal print “Hİ THERE” by using VS CODE. But UNREAL crushed. Error:

LoginId:418ab83d44c9d7a2f658178f337f9174
EpicAccountId:7aadca3dc68344419fd5e775294d71ad

Assertion failed: Terminal [File:C:\UnrealBullCow\BullCowGame-starter-kit\Source\BullCowGame\Console\Cartridge.cpp] [Line: 12] [BullCowCartridge]: No Terminal found

UE4Editor_Core
UE4Editor_Core
UE4Editor_BullCowGame_7145!DispatchCheckVerify >() [C:\Program Files\Epic Games\UE_4.25\Engine\Source\Runtime\Core\Public\Misc\AssertionMacros.h:161]
UE4Editor_BullCowGame_7145!UCartridge::BeginPlay() [C:\UnrealBullCow\BullCowGame-starter-kit\Source\BullCowGame\Console\Cartridge.cpp:12]
UE4Editor_BullCowGame_7145!UBullCowCartridge::BeginPlay() [C:\UnrealBullCow\BullCowGame-starter-kit\Source\BullCowGame\BullCowCartridge.cpp:7]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

How can I fix this?

I tried: adding in the terminal

cl BullCowCartridge.cpp/EHsc/Zi

Doing this gave this error:

Microsoft Windows [Version 10.0.18363.1016] (c) 2019 Microsoft Corporation. All rights reserved.

C:\UnrealBullCow\BullCowGame-starter-kit\Source\BullCowGame>cl BullCowCartridge.cpp/EHsc/Zi Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x86 Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line warning D9024 : unrecognized source file type ‘BullCowCartridge.cpp/EHsc/Zi’, object file assumed Microsoft (R) Incremental Linker Version 14.27.29111.0 Copyright (C) Microsoft Corporation. All rights reserved.

/out:Zi.exe BullCowCartridge.cpp/EHsc/Zi LINK : fatal error LNK1181: cannot open input file ‘BullCowCartridge.cpp\EHsc\Zi.obj’

C:\UnrealBullCow\BullCowGame-starter-kit\Source\BullCowGame>

Press F5 in the Terminal gave this error:

Executing task in folder BullCowGame: Engine\Build\BatchFiles\Build.bat BullCowGame Win64 Debug C:\UnrealBullCow\BullCowGame-starter-kit\BullCowGame.uproject -waitmutex <

Creating makefile for BullCowGame (no existing makefile) ERROR: Targets cannot be built in the Debug configuration with this engine distribution. The terminal process “C:\Windows\System32\cmd.exe /d /c Engine\Build\BatchFiles\Build.bat BullCowGame Win64 Debug C:\UnrealBullCow\BullCowGame-starter-kit\BullCowGame.uproject -waitmutex” terminated with exit code: 6.

Terminal will be reused by tasks, press any key to close it.

What can I do?

SOLUTION

Assertion failed: Terminal [File:C:\UnrealBullCow\BullCowGame-starter-kit\Source\BullCowGame\Console\Cartridge.cpp] [Line: 12] [BullCowCartridge]: No Terminal found

That means you attached the component to an actor without a Terminal component or you removed the Terminal component already on the actor.

If you go into Console > Cartridge and change this on line 12

*GetName()

to

*GetOwner()->GetName()

The crash should tell you what actor is missing it.

One of the cows occurred as “terminal” in the “world outliner” tab, and one of the other cow has already had a Cartridge attached to it. After I deleted the terminal cow and delete the Cartridge from other cow, it worked!

Thank you for finding the solution! I made the mistake of adding the BullCowCartrige to the cow actor instead of the terminal actor, which caused it to crash like this.