
This is liitle hard to find.



Don’t forget to save level 🙂
This is liitle hard to find.
Don’t forget to save level 🙂
Do I have to understand this intended?
You can download project files from :
https://github.com/cutycutyhyaline/UE4TMapAndTSetWithForLoop
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?
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:(
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;
}
ProcessResult.StdOut: LogOutputDevice: Error: begin: stack for UAT
ProcessResult.StdOut: LogOutputDevice: Error: === Handled ensure: ===
ProcessResult.StdOut: LogOutputDevice: Error:
ProcessResult.StdOut: LogOutputDevice: Error: Ensure condition failed: !FPackageName::IsShortPackageName(Path) [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/SoftObjectPath.cpp] [Line: 79]
ProcessResult.StdOut: LogOutputDevice: Error: Cannot create SoftObjectPath with short package name 'NoneNone'! You must pass in fully qualified package names
ProcessResult.StdOut: LogOutputDevice: Error: Stack:
ProcessResult.StdOut: LogOutputDevice: Error: [Callstack] 0x00007ffc46d818a9 UE4Editor-CoreUObject.dll!DispatchCheckVerify >() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Public\Misc\AssertionMacros.h:164]
…
What I found in searching:
Specially, from https://answers.unrealengine.com/questions/944064/view.html :
“Hi! I encountered this issue today, and fixed it about 5 minutes ago, so my solution is fresh and will probably work for everyone. Although for those who do not have coding knowledge, I feel sorry, because I don’t see any other way to properly track it down without debugger attached. So:
It’s possible to fix that without compiler, but UE callstack doesn’t give you any info about what asset and variable this is all about. So tracking down which asset causes that might take much longer.”
Fixed. Usually problem like this spend few days, but in this case, it was 30 min.