Skip to content

Instantly share code, notes, and snippets.

View dorgonman's full-sized avatar
☯️
inner peace

dorgon chang dorgonman

☯️
inner peace
View GitHub Profile
<a href="Seg1ClickMessage" bgColor="#555555FF" hoverColor="#FFFF0055" filePath="Blueprint'/Game/UMG/DialogueMsgTextTest/ButtonStyle/BP_DialogueBackgroundButtonStyle1.BP_DialogueBackgroundButtonStyle1'">
<text color="#FF0000FF"> Test Click Seg1 </text>
</a>
<br />
<a href="Seg2ClickMessage" bgColor="#FF0000FF" hoverColor="#FFFF0055" filePath="Blueprint'/Game/UMG/DialogueMsgTextTest/ButtonStyle/BP_DialogueBackgroundButtonStyle2'">
<text color="#00FF00FF"> Test Click Seg2 </text>
</a>
<br />
@dorgonman
dorgonman / pgo_build_script.sh
Last active July 9, 2020 02:05
PGO Build Script
Engine/Build/BatchFiles/RunUAT.bat
-ScriptsForProject="/Path/To/YourProjec/YourProject.uproject" BuildCookRun -NoCompileEditor
-Verbose -UTF8Output -CrashReporter -nop4 -ue4exe="/Path/To/Engine/Binaries/Win64/UE4Editor-Cmd.exe"
-ScriptsForProject="/Path/To/YourProjec/YourProject.uproject" -cook -unversionedcookedcontent -pak -stage
-package -clientconfig="Shipping" -prereqs -targetplatform="Switch" -distribution -nodebuginfo
-build -UbtArgs="-LTCG -PGOOptimize"
@dorgonman
dorgonman / run_pgi_build.sh
Created July 8, 2020 13:57
Run PGI Build with GauntletScript
${UE4_ENGINE_ROOT}/Engine/Build/BatchFiles/RunUAT.bat
RunUnreal -ScriptsForProject="/Path/To/YourProjec/YourProject.uproject"
-nop4 -nocompile -ScriptsForProject="/Path/To/YourProjec/YourProject.uproject"
-platform="Switch" -configuration="Development"
-test="YourProjectPGONode" -build="local"
-ProfileOutputDirectory="/Path/To/YourProject/Saved/PGO/Profile/Switch/"
@dorgonman
dorgonman / CompileMyProject.Automation.sh
Created July 8, 2020 13:56
Compile MyProject.Automation.csproj
'MSBuild.exe'
'/Path/To/MyPorject/Build/Script/MyProject.Automation/MyProject.Automation.csproj'
/verbosity:quiet /nologo //target:Build /property:Configuration=Development /property:Platform=AnyCPU
/p:TreatWarningsAsErrors=false /p:BuildProjectReferences=true
@dorgonman
dorgonman / YourProjectPGONode.cs
Created July 8, 2020 13:54
UE4 YourProjectPGONode
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using AutomationTool;
using Gauntlet;
using UnrealBuildTool;
using System.Text.RegularExpressions;
namespace UE4Game
${UE4_ENGINE_ROOT}/Engine/Build/BatchFiles/RunUAT.bat
-ScriptsForProject="/Path/To/YourProjec/YourProject.uproject" BuildCookRun -NoCompileEditor
-Verbose -UTF8Output -CrashReporter -nop4 -ue4exe="/Path/To/Engine/Binaries/Win64/UE4Editor-Cmd.exe"
-ScriptsForProject="/Path/To/YourProjec/YourProject.uproject" -cook -unversionedcookedcontent -pak -stage
-package -clientconfig="Development" -prereqs -targetplatform=${BUILD_PLATFORM} -build-UbtArgs="-LTCG -PGOProfile"
@dorgonman
dorgonman / AutoDeleteAsyncTask.cpp
Created August 30, 2018 13:56
FAutoDeleteAsyncTask
class FMyWorldAsyncChecker : public FNonAbandonableTask
{
public:
/**
* Constructor for async task
* @param InDataDeriver plugin to produce cache key and in the event of a miss, return the data.
* @param InCacheKey Complete cache key for this data.
**/
FMyWorldAsyncChecker()
@dorgonman
dorgonman / wordpress_post1583_06.cpp
Created June 30, 2018 16:24
wordpress_post1583_06.cpp
void AMyGameModeBase::OnSpectatorReady()
{
++NumReadySpectator;
UE_LOG(LogTemp, Log, TEXT("OnSpectatorReady NumReadySpectator: %d"), NumReadySpectator);
}
void AMyGameModeBase::OnSpectatorLeave()
{
--NumReadySpectator;
@dorgonman
dorgonman / wordpress_post1583_05.cpp
Created June 30, 2018 16:23
wordpress_post1583_05.cpp
// Statically bind to the specified player controller
UClass* PCClass = PendingLevelPlayerControllerClass;
// The PlayerController gets replicated from the client though the engine assumes that every Player always has
// a valid PlayerController so we spawn a dummy one that is going to be replaced later.
//
// Look at APlayerController::OnActorChannelOpen + UNetConnection::HandleClientPlayer for the code the
// replaces this fake player controller with the real replicated one from the server
//
@dorgonman
dorgonman / wordpress_post1583_04.cpp
Created June 30, 2018 16:22
wordpress_post1583_04.cpp
void APlayerController::ReceivedSpectatorClass(TSubclassOf<ASpectatorPawn> SpectatorClass)
{
if (IsInState(NAME_Spectating))
{
if (GetSpectatorPawn() == NULL)
{
BeginSpectatingState();
}
}
}