Unreal Engine : Debugging a Shipping Packaged Build, with -waitforattach option (based on UE4 4.26)

Prerequisite

You need the Engine built from source.
You can not do this with the Launcher version engine.

To make -waitforattach option available in shipping build

Ref: https://unrealcommunity.wiki/debugging-a-packaged-build-o9c2ta8f

You have to commentate these preprocesser directives like below:
(Please ignore very long comment of mine, in the end of line.)

Engine/Source/Runtime/Core/Public/Windows/WindowsPlatformMisc.h

Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMisc.h

Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformMisc.cpp

Engine/Source/Runtime/Launch/Private/Launch.cpp

Bonus: To make log available in shipping build

Ref: https://forums.unrealengine.com/t/how-to-log-in-shipping-build-win/349171/26

Engine/Source/Runtime/Core/Public/Misc/Build.h

In addition, You have to add “bUseloggingInShipping = true;” into target cs file like this:

“Skipping dirty area creation because of empty bounds” Warning

From https://forums.unrealengine.com/t/skipping-dirty-area-creation-because-of-empty-bounds-warning/477474

This is liitle hard to find.

WorldSettings->World->Show Advanced

Navigation System Config

Change it to “Null Nav Sys Config”

Don’t forget to save level 🙂

In Blueprint For loop, set nodes for TMap or TSet works like Add node.

Do I have to understand this intended?

You can download project files from :
https://github.com/cutycutyhyaline/UE4TMapAndTSetWithForLoop

Problem:

Here is a function. just Add number to TSet.

void ARep02GameModeBase::TSetTest(int32 InNumber, TSet<int32>& OutSet)
{
	OutSet.Add(InNumber);
}

With this, I made :

And run.

But, with TArray?

void ARep02GameModeBase::TArrayTest(int32 InNumber, TArray<int32>& OutArray)
{
	OutArray.Add(InNumber);
}

This frustrates me. Expecting consistency is too much?

Let’s dig more deeper.

This is Header:

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "Rep02GameModeBase.generated.h"

/**
 * 
 */
UCLASS()
class REP02_API ARep02GameModeBase : public AGameModeBase
{
	GENERATED_BODY()

	public:

	UFUNCTION(BlueprintCallable, Category = "Reproduce")
	void TArrayTest(int32 InNumber, TArray<int32>& OutArray);

	UFUNCTION(BlueprintCallable, Category = "Reproduce")
	void TMapTest(int32 InNumber, TMap<int32, int32>& OutMap);

	UFUNCTION(BlueprintCallable, Category = "Reproduce")
	void TSetTest(int32 InNumber, TSet<int32>& OutSet);	
};

And CPP:

// Copyright Epic Games, Inc. All Rights Reserved.


#include "Rep02GameModeBase.h"

void ARep02GameModeBase::TArrayTest(int32 InNumber, TArray<int32>& OutArray)
{
	OutArray.Add(InNumber);
}

void ARep02GameModeBase::TMapTest(int32 InNumber, TMap<int32, int32>& OutMap)
{
	OutMap.Add(InNumber, InNumber);
}

void ARep02GameModeBase::TSetTest(int32 InNumber, TSet<int32>& OutSet)
{
	OutSet.Add(InNumber);
}

And BP:

I know what “&” symbol means in cpp.
But… this is ridiculus because it works too honestly:(

Workaround?

What I could think is to make new local variable, and assign it to reference parameter.
(And I have to be careful to not forget this -_-)

void ARep02GameModeBase::TMapTestFixed(int32 InNumber, TMap<int32, int32>& OutMap)
{
	TMap<int32, int32> NewMap;
	NewMap.Add(InNumber, InNumber);
	OutMap = NewMap;
}

void ARep02GameModeBase::TSetTestFixed(int32 InNumber, TSet<int32>& OutSet)
{
	TSet<int32> NewSet;
	NewSet.Add(InNumber);
	OutSet = NewSet;
}