Access Transformers problems
I am trying to allow access to FWwiseSoundBankManagerImpl from a mod, and I thought that I added the access transformer correctly, but I keep getting that "Unused friend access transformer" message--what could I be doing wrong?
My access transformer config is like this:
Where MyModName's class is FMyModName, prefix removed per the instructions in documentation--although I have also tried with the four combinations including FWwiseSoundBankManagerImpl and FMyModName
(It is still possible to edit headers to make it work, however)
40 Replies
For Friend you do need the raw c++ class names, including the prefix
Were you still getting the unused error when using the full names?
Ah
FWwiseSoundBankManagerImpl
is not an UStruct, so Access Transformers can't reach it
What are you trying to achieve?Well in the end, I am trying to load an external soundbank file (included with the mod), basing work off of an existing mod that does that but in Update 8, I figure it may have changed in the full release
Nothing should have changed, but that mod didn't use access transformers for this same reason
Also, soon ™️ (when I'm done with uni assignments) SML will have proper wwise support, so that hook won't be necessary
Oooh okay, nice! At the moment with the header edits, I have the mod built and loading, but actually trying to play a sound is crashing--so that is less great, but I'm not giving up yet. I don't suppose you have any idea why? The soundbank is included in the .pak in Content/WwiseAudio if I unpack it and the event can play sound if I run it in the editor, it just seems not to ever be loaded based on logging (from logging each soundbank name that is loaded in the hook), and crashes on a null reference when playing it
CSS has some patches made to Wwise, so PostEvent and functions like that don't exist at runtime. This is also part of the :soon:
Fair enough, I'll keep trying to see if I can get it to work for this at least. The hooked function is definitely called, but I only see it loading banks like these that are clearly base game
Yes, I had, thank you for checking though--and that is what I'm currently doing, it was just surprising that Access Transformers would not work
I wonder if this might be the source of this trouble
in which case one could imagine the solution of replicating all the base soundbanks in a library along with the project used to create it, that modders could then use to generate soundbanks--or something like that
I'm not sure what trouble you're referring to
That everything seems to be set up correctly, but the hooked function never runs for the Play_ event for this sound, and then on trying to play it an exception is thrown on a nullptr
:thistbh:
Well it is called for the base game sounds, so is it wrong to be a little skeptical of that? I'm hooking other functions along the line to see where it does get and with what data
How do you play the sound?
Which exception do you get? (with callstack)
Do you have a full log?
Through the boombox, so right now I'm at the point of the tape change function--hang on, I'll grab a fresh one
I can send my version of your code too, if that helps, I haven't added much though--mostly just logging and updating SML, besides the assets for the tape I'm adding
Okay. For now I'd like a log, then I'll see if I need the code
For sure, I appreciate your help
Okay, it's crashing in the boombox code
:thistbh:
sure, I can get that too
What is your sound(bank) called?
not the actual name (because it is for something I'm keeping secret until it's time) but all references in that log are changed to ANONYMIZED
Something seems to be invalid in there
I'm logging a pointer directly there, it is fine
Why?
If it's a UObject, use
GetName
I was figuring out how to work with the CDO, it was just part of discovering it
What I mean is that I don't see your soundbank getting remapped anywhere
since it didn't work how I originally intuited, I wanted to make sure that it had some kind of value
So if you added any custom sounds through Wwise, they're not there for some reason
yeah, that is the problem, but my tape asset does reference an event that can play it in the editor and my mod packages the soundbank, so that is what I'm trying to find out now--why it doesn't load and how to get it to
What is your soundbank named? Does it get processed by the hook in my code?
I couldn't even find an error about failing to find a soundbank
https://github.com/Th3Fanbus/Th3Tunes/blob/master/Source/Th3Tunes/Private/Th3Tunes.cpp#L27
Mods MUST name their sound banks `Mod_MODREFERENCE.bnk` for them to be remapped properly
it is named Mod_Th3Tunes_ANONYMIZED.bnk, the mod reference is Th3Tunes_ANONYMIZED
from that logging I can tell that CreateOp is never called, it isn't missing the prefix-suffix condition
Okay, then it's not packaged for some reason. Could you please confirm by looking into the mod's pak files using FModel?
I unpacked with UnrealPak and it is included there at least, in Content/WwiseAudio
Interesting, so it's not getting loaded it seems
this is why I got suspicious about that note about the initialization bank, but then again that may have been one of those things that CSS patched so it may not be relevant. Either way, it seemed to me like the next step was to hook the rest of that call chain and see what happens in those
The things being patched happen much later
If you try using "Post Event" in the game, it'll crash because the function doesn't exist
That seems convenient and intuitive 😁 I had heard that, but yeah I don't think it's relevant to this
What I see so far is that UFGTapeData::GetSongs() for that tape does return elements, but the first one at least is null, and it's the same story looking at the tape CDO at mPlaylist, it has the song name but a nullptr at Song
None of my intellisense is working yet, I didn't originally think I would be digging in this much to it so it didn't seem important but... it's slowing things down at this point, I'm gonna fix that lol
It was not worth it to attempt that--the problem here was that my tape pointed to the original event file and not to the one included in my mod--I'm glad I was just being dumb and that this is still possible
original meaning like the one the Wwise extension created, don't be like me if you're reading this sometime from the future lol
good news for you @Rex [they/them] is that your mod still works just fine, it only needs the SML update
I thought as much but I know there's a better way to go about this (fix the paths when packaging the mod)