PSUnreal

From PSwiki
Revision as of 14:23, 22 April 2015 by Talad (talk | contribs) (Created page with "== Import a level == In the FBX exporter set the Units to "Centimeters", this will scale the model up 100 times, as in UE the units are 1 unit = 1cm, while in CS they are 1 u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Import a level

In the FBX exporter set the Units to "Centimeters", this will scale the model up 100 times, as in UE the units are 1 unit = 1cm, while in CS they are 1 unit = 1 meter


Import a char

You cannot import a skeleton by itself, if you export only the skeleton from max with FBX, UE will import nothing, you need some geometry associated

OLD (Bake Animations fixes this problem): FBX export seems to have issues if the controllers or bones have a "orientation constraint" on the Motion panel under assign controller. With that it doesn't export, without it does

OLD (Bake Animations fixes this problem): UE doesn't import skeletons with multiple root bones, need to have one

You cannot import DDS files, unless they are specific format. Better to just import PNGs.

Only way I found to import a char is to hide all helpers, shapes, then select geometry and bones, and "Export Selected" to FBX with "Bake Animations" selected.


Engine inner working

> MyProjectServer.exe!UIpNetDriver::InitListen(FNetworkNotify * InNotify, FURL & LocalURL, bool bReuseAddressAndPort, FString & Error) Line 152 C++

	MyProjectServer.exe!UWorld::Listen(FURL & InURL) Line 3927	C++
	MyProjectServer.exe!UEngine::LoadMap(FWorldContext & WorldContext, FURL URL, UPendingNetGame * Pending, FString & Error) Line 8983	C++
	MyProjectServer.exe!UEngine::Browse(FWorldContext & WorldContext, FURL URL, FString & Error) Line 8144	C++
	MyProjectServer.exe!UGameInstance::StartGameInstance() Line 262	C++
	MyProjectServer.exe!UGameEngine::Init(IEngineLoop * InEngineLoop) Line 465	C++
	MyProjectServer.exe!FEngineLoop::Init() Line 1967	C++
	MyProjectServer.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 138	C++
	MyProjectServer.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 191	C++


Code convertion

Types

csString -> psString or FString

psStringArray with TArray<psString>

uint -> uint32

csHash<Value,Key> -> TMap<Key,Value> (notice the swap of Key and Value)

csArray<> -> TArray


Types conversion

FString to char* -> const char *myData = TCHAR_TO_ANSI(*NameString);

FString to TCHAR -> *myFString

char* to FString -> ANSI_TO_TCHAR(NameString);


Functions

Replace string.Format("hey %s", string) with string.Printf(TEXT("hey %s"), string)

csString.Truncate(5) -> FString.Left(5)

csString.DeleteAt(start,count) -> FString.RemoveAt(start,count)

csString.Downcase() -> FString.ToLower()

output.Insert(0, time_buffer) -> output.InsertAt(0, time_buffer)

output.GetAt(output.Length()-1) -> output [ output.Len()-1 ]

Cross platform types are defined in Platform.h , like uint32. Those can be included with #include "EngineMinimal.h"

CS_ASSERT() -> check()

strcasecmp and strcmp, I added those two defines, so the code can stay as it is

 #define strcasecmp(expr1,expr2) FCString::Strcmp( ANSI_TO_TCHAR(expr1), ANSI_TO_TCHAR(expr2)) == 0
 #define strcmp(expr1,expr2) FCString::Stricmp( ANSI_TO_TCHAR(expr1), ANSI_TO_TCHAR(expr2)) == 0

CPrintf(CON_CMDOUTPUT,str.GetDataSafe()); -> UE_LOG(LogTemp, Warning, TEXT("%s"), str);

time(NULL) -> FString buf = FDateTime().GetDate().ToString();