I’m getting the following error ONLY when launching the game in Standalone or from a packaged build.
I’m fairly confident this has to do with something with my array code, but I’m not certain why it works fine inside the editor. You’ll find the chunk of code that I think is causing the problem at the very bottom.
Assertion failed: Index >= 0 [File:d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\public\uobject\UObjectArray.h] [Line: 401]
UE4Editor_Core!FDebug::AssertFailed() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\misc\outputdevice.cpp:430]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1907]
UE4Editor_CoreUObject!UObject::execLetObj() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1751]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:781]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:686]
UE4Editor_CoreUObject!UObject::execVirtualFunction() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2022]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:781]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\class.cpp:4482]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1150]
UE4Editor_Engine!AActor::ProcessEvent() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\actor.cpp:611]
UE4Editor_Engine!FInputActionHandlerDynamicSignature::Execute() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\classes\components\inputcomponent.h:93]
UE4Editor_Engine!FInputActionUnifiedDelegate::Execute() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\classes\components\inputcomponent.h:189]
UE4Editor_Engine!UPlayerInput::ProcessInputStack() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\userinterface\playerinput.cpp:1211]
UE4Editor_Engine!APlayerController::ProcessPlayerInput() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\playercontroller.cpp:2310]
UE4Editor_Engine!APlayerController::TickPlayerInput() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\playercontroller.cpp:3878]
UE4Editor_Engine!APlayerController::PlayerTick() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\playercontroller.cpp:1980]
UE4Editor_Engine!APlayerController::TickActor() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\playercontroller.cpp:3954]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\actor.cpp:110]
UE4Editor_Engine!FTickFunctionTask::DoTask() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\ticktaskmanager.cpp:228]
UE4Editor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\public\async\taskgraphinterfaces.h:886]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\async\taskgraph.cpp:779]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\async\taskgraph.cpp:526]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\async\taskgraph.cpp:1534]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\ticktaskmanager.cpp:486]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\ticktaskmanager.cpp:1373]
UE4Editor_Engine!UWorld::RunTickGroup() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\leveltick.cpp:702]
UE4Editor_Engine!UWorld::Tick() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\leveltick.cpp:1187]
UE4Editor_Engine!UGameEngine::Tick() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\engine\private\gameengine.cpp:989]
UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\launch\private\launchengineloop.cpp:2643]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll
Here’s my array code, if you are curious I printed the count function in the same way I call GetRandomItem and it’s 2 in the case where this appears to be crashing:
UItem* UItemContainer::GetRandomItem()
{
TArray<UItem*> itemArray;
this->Items.GenerateValueArray(itemArray);
return itemArray[FMath::RandRange(0, this->Count() - 1)];
}