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.
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
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()
- Smirftsch
- Administrator
- Posts: 8999
- Joined: Wed Apr 29, 1998 10:00 pm
- Location: NaPali
- Contact:
Re: StaticLoadClass()
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.
- .:..:
- OldUnreal Member
- Posts: 1635
- Joined: Tue Aug 16, 2005 4:35 am
Re: StaticLoadClass()
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.
Also do note that if you are aware of the metaclass type, you can use LoadClass macro function instead.
Code: Select all
UObject* objClass = StaticLoadObject(UObject::StaticClass(),NULL,ts->GetPathName(),NULL,LOAD_NoWarn,NULL);
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