Class name written in Eastern characters

Hi,

I tried to use my own version of a navigation system by setting it up in a custom world settings file.

UNavigationSystem* NavigationSystemToSend = Cast< UNavigationSystem >(NavigationSystemClass);

if (NavigationSystemClass != NULL)
{
	//GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, NavigationSystemToSend->GetClass()->GetName());
	GetWorld()->SetNavigationSystem(NavigationSystemToSend);
}

But when I try to get the name of the class of my navigation system through AddOnScreenDebugMessage, to check if the correct one is use, the name is written in what appears to be asian characters.

Am I doing something wrong? I mean, I obviously must be, but how can i get the name of the class of my navigation system?

97483-unrealasianchara.jpg

Hey Rumpelstilskin-

Can you explain your setup after creating the custom WorldSettings class? Is the code provided from the WorldSettings.cpp or is this being added elsewhere in your code? Please provide detailed setup steps to help me investigate this issue on my end.

I’m surprised your code is even working! Assuming NavigationSystemClass is truly a UClass*, then you shouldn’t be casting it to a UNavigationSystem *. Instead, try NavigationSystemClass->GetFName(). If NavigationSystemClass is an instance of your custom class, use NavigationSystemClass->GetClass()->GetFName()

Hello -

Sorry for my delayed answer!
I tried to write it down, thought it would be easier…

Hope it’s enough and will gladly provide additional informations if needed…

Thanks a lot, I can now see the name of my NavigationSystem Class, I believe.
But apparently, I couldn’t get Unreal to use my NavSystem…

Your world should automatically instantiate your subclass of NavigationSystem when play begins (see UNavigationSystem::InitializeForWorld, and set a breakpoint there if you want to attach a debugger and watch it happen). To get the active navigation system instance, you can call World::GetNavigationSystem().

Putting it all together, once play has begun: GetWorld() -> GetNavigationSystem() -> GetClass() -> GetFName().

I still can’t get it to work…

My NavigationSystemClass is not instantiated, SetNavigationSystem() doesn’t do anything, probably because I don’t know where to call it from to be used properly…

And I tried rewriting InitializeForWorld(), but if my NavigationSysClass is not instantiated, I don’t see how it can be called.

Ok, I just managed to instantiate my NavigationSystem Class in the dirtiest, meanest way possible: Used

GEngine->NavigationSystemClass = NavigationSystemClass;

in the PostInitializeComponents() of my RSysWorldSettings. Can’t wait for it to completely crash on me, but it works for now. So I guess problem solved for now. Thanks for your help guys!