C++ hook attach code in Mod Module not running
I have been trying to get this simple function hook to work but I can't figure out why it isn't working.
I've tried putting logs everywhere and they're not coming through... I put the Declare log category extern and the define log category in the files that the documentation told me to... Anyone got some more insight?
Solution:Jump to solution
```cpp
UTPRRootGameWorldModule::UTPRRootGameWorldModule()
{
bRootModule = true;
}...
27 Replies
Where do you declare your logger?
Verbose
may not be logged by defaultI would try using a different log level
If you use Error, you should clearly see the messages (and they should also result in an error when running Alpakit)
I haven't worked with the ue logging before... so what would I change to make it a different log level? just the verbose everywhere to error?
Still not getting anything...
Ah, do you have any Blueprint game instance modules?
You mean like the game instance module I used in my code but in blueprint form? no... Only bp I've got is a Subsytem that was used for testing but never actually used...
I mean any game instance modules in your mod
ye... my main one?
That doesn't do anything on its own
I don't know, I can't see your mod from here 😄
That's a game world module
Oh, no
It's just named like so, but is a game instance module
no... it was... I changed it but not the name...
In any case... No mod modules in Blueprints?
Then you probably don't have a root module
nope
>docsearch mod modules
This is the best result I got from the SMD :
https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/ModModules.html
Mod Modules :: Satisfactory Modding Documentation
Mod Modules are a system provided by SML that allows for simple hooking into the engine life-cycle at key locations important for Satisfacto...
In order to make a C++ mod module be a root module, you have to set
bRootModule
to true in the constructorSolution
Alrighty! let me give that a go!
I usually make the C++ mod module class abstract, and then make a Blueprint child class that is marked as root module. This way I can use things from C++ and Blueprints
that's not a bad idea...
e.g. I use this approach in ScrewIt to pass references to Blueprint assets to use them in C++
btw... thanks for all the help already today... I know I've been in here a lot...
IT WORKS!!!! Thanks!!!