Download

[Feature] Allow GetSeamlessTravelActorList to be hooked in blueprint GameMode

I’m currently using this as my base class for my gamemode, and all works well. I just add actors to this list that I need to persist during seamless travel


#include "GM_CODE_Base.h"

void AGM_CODE_Base::GetSeamlessTravelActorList(bool bToTransition, TArray<AActor*>& ActorList)
{
    ActorList = K2_OnGetSeamlessTravelActorList(bToTransition, ActorList);
    Super::GetSeamlessTravelActorList(bToTransition, ActorList);
}

Note: If you want to know what the server wants to save, apart from what you are adding, you would move the call to Super above my call. However, this would be unsafe, as we should be trusting the engine and not messing with it.

Can I see the associated header code required to make this blueprint accessible?


#include "CoreMinimal.h"
#include "GameFramework/GameMode.h"
#include "GM_CODE_Base.generated.h"

/**
 *
 */
UCLASS()
class PROJECTX2150_API AGM_CODE_Base : public AGameMode
{
    GENERATED_BODY()
public:

    void GetSeamlessTravelActorList(bool bToTransition, TArray<AActor*>& ActorList);

    /**
    * Overridable event for GameMode blueprint to respond to a change name call
    * @param bToTransition    How are we transitioning
    * @param ActorList        Add actors to this list to seamless travel with.
    */
    UFUNCTION(BlueprintImplementableEvent, Category = Game, meta = (DisplayName = "GetSeamlessTravelActorList", ScriptName = "GetSeamlessTravelActorList"))
        TArray<AActor*> K2_OnGetSeamlessTravelActorList(bool bToTransitionOut, UPARAM(ref)TArray<AActor*>& ActorListOut);


};