I’m not sure if this is the best way to ask this. But I have a DLC plug-in that will register itself with the main game.
Basically I have a main character class that is a child of ACharacter. Call this as AMainCharacter. The DLC will have a child of AMainCharacter called ADLCCharacter.
So what I want to happen is that when the plug-in gets loaded, it needs to register an interface with the main game. And when a new game is started the main game will call this interface in the registered DLC and it will then go off and do all the changes that need to be done.
This way the main game is not dependent on the plug-in but if an interface is registered it can call it. (nullptr checks of course).
I’m assuming that the gamemode defined in the main game is the proper place to register the DLC with, with a register function. But how do I get the game mode from the plugins StartupModule function?
I was thinking of using UGameplayStatics::GetGameMode() but that needs a WorldContextObject. GetWorld() is part of AActor, which isn’t in the hierarchy for the IModuleInterface.
Do I need to multi-parent the FDLCModule class to have AActor as another parent?
Should I approach this another way?
Thanks for any help. I’m probably missing something very simple here.