AActor ACustomStartPlayer
Description
CustomPlayerStart Actor is a Spawn Point or Location. It has Spawn Group and Team Settings which can assign it to a specific team and spawn group. It also has spawn point occupying detection (blocking) and visualization feature.
What does it do?
It defines a spawn location for a team and spawn group.
How to use?
Drop the actor in level and use UGameplayStatics::GetAllActors. Once you have list of all CustomPlayerStart Actors of the level use Validate function to match the team and spawn group, then use IsBlocked to check if spawn point is occupied by a pawn. Once you have true from Validate and false from IsBlocked you can use the coordinates of the spawn point.
Public Member Functions
bool Validate (FSpawnQueue SpawnTarget)
bool IsBlocked ()
void Availible ()
void Occupied ()
void Hibernation ()
void Error ()
void ErrorEnd ()
virtual void Capsule_OnOverlapEnd (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
virtual void Capsule_OnOverlapBegin (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, FHitResult const &SweepResult)
virtual void Cube_OnOverlapEnd (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
virtual void Cube_OnOverlapBegin (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, FHitResult const &SweepResult)
virtual void OnRepVisualizationMaterial ()
virtual void Tick (float DeltaTime) override
virtual void OnConstruction (const FTransform &Transform)
void UserConstructionScript ()
void ForceInitCollision ()
Public Attributes
UCapsuleComponent * Capsule
UArrowComponent * Arrow
USceneComponent * DefaultSceneRoot
UStaticMeshComponent * Cube
EOccupiedStatus Status
Set which team this spawn point belongs to:
ETeams_SQ Team
Set which spawn group this spawn point belongs to:
ESpawnClass SpawnClass
Enable realtime Visualization:
bool Visualization
Time in seconds, how long this spawn point can be blocked by a pawn:
float UnOccupyForceDelay
Status of sleep mode, set by internally:
bool Hibernating
Time in seconds, how long till this actor dissappear:
float HibernationDelay
Set these with correct materials:
UMaterialInterface * Material_None
UMaterialInterface * Material_Green
UMaterialInterface * Material_Red
UMaterialInterface * Material_Yellow
Material for Cube, this will be set by SetMaterialXXX:
UMaterialInterface * VisualizationMaterial
Protected Member Functions
void GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const
virtual void BeginPlay () override
void StartTimers ()
void SetMaterialGreen ()
void SetMaterialNone ()
void SetMaterialRed ()
void SetMaterialYellow ()
void CubeSetMaterial (UMaterialInterface *Material)
Protected Attributes
bool IAmReady
Location in world of this actor. This is set in BeginPlay.
FTransform Location
Pawn occupying this spawn point right now.
FSpawnPointOccupier Occupier
Bugs
Future Features
Vehicle support.
Random Info
- Size is matched to UE4_Mannequin (Capsule and Cube).
- This Actor class was originally designed in Blueprint in Q4 2019 and it was named as CustomStartLocation. It is almost identical to its ancestor.
- You can override AGameModeBase::FindPlayerStart in Game Mode Base C++ Class and return this actor from FindPlayerStart.
AActor* AGameModeBase::FindPlayerStart() {
Super::FindPlayerStart();
}
- Remember to set visualization materials in c++ and blueprint.