1.Run external .exe file
TCHAR* url = TEXT("C:\\windows\\system32\\calc.exe"); FPlatformProcess::CreateProc(url, nullptr, , nullptr, nullptr);
//If you want to open .exe file with some params
FPlatformProcess::CreateProc(url, TEXT("-MyFlag -FULLSCREEN"), true, false, false, nullptr, 0, nullptr, nullptr);
external:
Check Runtime Params, infomation source url: https://answers.unrealengine.com/questions/123559/can-we-make-command-line-arguments.html
if (FParse::Param(FCommandLine::Get(), TEXT("MyFlag"))) { return true; } else { return false; }
2.Create UMG widget and AddToView
if (!IsValid(MainMenuRef)) { MainMenuRef = CreateWidget<UUserWidget>(this, MainMenuWB); } MainMenuRef->AddToViewport(); APlayerController* LocalPlayerController = UGameplayStatics::GetPlayerController(GetWorld(),); LocalPlayerController->bShowMouseCursor = true;
3.C++ PrintString On Screen
GEngine->AddOnScreenDebugMessage()
4.FString Conver to TCHAR
FString testStr = TEXT("Hello World"); const TCHAR* MyTchar= *testStr;
5.Get Runtime Path, more infomation, https://answers.unrealengine.com/questions/514739/get-the-abolute-game-path.html
FString pathPart1 = FPlatformProcess::BaseDir(); FString appPath = pathPart1 + "/MySteamOnlineC.exe"; //The 'SteamOnlineC.exe' is my project entry file after package.
6.OnlineSystem DefaultEngine.ini config, found the file with path, UnrealProjectDirectory/ProjectName/Config/DefaultEngine.ini
LAN and Normal
[OnlineSubsystem] DefaultPlatformService=Null
Run on Steam
[/Script/Engine.GameEngine] +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver") [OnlineSubsystem] DefaultPlatformService=Steam [OnlineSubsystemSteam] bEnabled=true SteamDevAppId= bVACEnabled= [/Script/OnlineSubsystemSteam.SteamNetDriver] NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
7. How to get TSubclassOf<AActor> type from class instance, for example ,GetAllActorsOfClass
TArray<AActor*> cameraArray; UGameplayStatics::GetAllActorsOfClass(GetWorld(), ACameraManager::StaticClass(), cameraArray);
8. Collision box add event bind, add beginOverlap Event.
BoxCollision->OnComponentBeginOverlap.AddDynamic(this, &ABossRunCharacter::LaunchEnemy);