For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

StaticLoadClass()

Post Reply
User avatar
atrey
OldUnreal Member
Posts: 5
Joined: Wed Nov 07, 2018 12:47 pm

StaticLoadClass()

Post by atrey »

I have a native function that I am using to play new sound classes:

PlayHatchetSound(class sound, optional float newVolume);



In C++, I am using P_GET_OBJECT() to fetch the sound class parameter. I am trying to load that parameter into StaticLoadClass() Like this:

First, I get the parameter using: P_GET_OBJECT(UHatchetSound,ts)

Then I try loading it into StaticLoadClass(), using the String version of the class name:

UObject* objClass = StaticLoadObject(UObject::StaticClass(),NULL,ts.GetName(),NULL,LOAD_NoWarn,NULL);




NOW, here is the issue. objClass keeps returning NULL... I can't get this to load at all.


Any help would be appreciated.
User avatar
Smirftsch
Administrator
Posts: 8999
Joined: Wed Apr 29, 1998 10:00 pm
Location: NaPali
Contact:

Re: StaticLoadClass()

Post by Smirftsch »

Guess I need to see more to be able to say something about it. I'm not sure yet what you are trying to do ;)
Sometimes you have to lose a fight to win the war.
User avatar
.:..:
OldUnreal Member
Posts: 1634
Joined: Tue Aug 16, 2005 4:35 am

Re: StaticLoadClass()

Post by .:..: »

I'm not sure why you would load class even if its already loaded and passed as an object reference, but for starters you must include package name when loading, not just the name of object.

Code: Select all

UObject* objClass = StaticLoadObject(UObject::StaticClass(),NULL,ts->GetPathName(),NULL,LOAD_NoWarn,NULL);
Also do note that if you are aware of the metaclass type, you can use LoadClass macro function instead.

Code: Select all

UClass* objClass = LoadClass(NULL,ts->GetPathName(),NULL,LOAD_NoWarn,NULL);
1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD :P
(ಠ_ಠ)
Post Reply

Return to “C++ Native Mods for UE1”