I have a class inheriting from default GameMode. I would like to add additional MatchStates to my own CustomGameMode but doing it like default GameMode does not work.
CustomGameMode.h
namespace MatchState
{
extern ENGINE_API const FName CustomState;
}
CustomGameMode.cpp
namespace MatchState
{
const FName CustomState = FName(TEXT("CustomState"));
}
It fails to compile with “inconsistent dll linkage”.
Is there any way to implement custom match state so it works(for blueprint) the same way as the included ones by default.
.
Default GameMode.h
namespace MatchState
{
extern ENGINE_API const FName EnteringMap; // We are entering this map, actors are not yet ticking
extern ENGINE_API const FName WaitingToStart; // Actors are ticking, but the match has not yet started
extern ENGINE_API const FName InProgress; // Normal gameplay is occurring. Specific games will have their own state machine inside this state
extern ENGINE_API const FName WaitingPostMatch; // Match has ended so we aren't accepting new players, but actors are still ticking
extern ENGINE_API const FName LeavingMap; // We are transitioning out of the map to another location
extern ENGINE_API const FName Aborted; // Match has failed due to network issues or other problems, cannot continue
// If a game needs to add additional states, you may need to override HasMatchStarted and HasMatchEnded to deal with the new states
// Do not add any states before WaitingToStart or after WaitingPostMatch
}
Default GameMode.cpp
namespace MatchState
{
const FName EnteringMap = FName(TEXT("EnteringMap"));
const FName WaitingToStart = FName(TEXT("WaitingToStart"));
const FName InProgress = FName(TEXT("InProgress"));
const FName WaitingPostMatch = FName(TEXT("WaitingPostMatch"));
const FName LeavingMap = FName(TEXT("LeavingMap"));
const FName Aborted = FName(TEXT("Aborted"));
}