Implemented Ring Module Gadget Tutorial
This commit is contained in:
		
							parent
							
								
									7ee592f1f0
								
							
						
					
					
						commit
						971e28bb61
					
				@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					version https://git-lfs.github.com/spec/v1
 | 
				
			||||||
 | 
					oid sha256:935f7575eb8438f8e3320206e83e54c726aacd8ba9dae894dcea2dfdeca4cb70
 | 
				
			||||||
 | 
					size 130514
 | 
				
			||||||
@ -1,3 +1,3 @@
 | 
				
			|||||||
version https://git-lfs.github.com/spec/v1
 | 
					version https://git-lfs.github.com/spec/v1
 | 
				
			||||||
oid sha256:4dfc52ea68790fe41a2183cebf9f3f1760c3cd066efe8459f7f116673f524040
 | 
					oid sha256:0caa776d680dfb23ead998fcd2fbc0c7a46ecf2ff4edff73e98c3e152a79088d
 | 
				
			||||||
size 212777
 | 
					size 213629
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@ -1,3 +1,3 @@
 | 
				
			|||||||
version https://git-lfs.github.com/spec/v1
 | 
					version https://git-lfs.github.com/spec/v1
 | 
				
			||||||
oid sha256:eccb9b1edb192ea701130918efac376eee57496ac65768f76a09f95c956d84e6
 | 
					oid sha256:4c448a399e03e820c5867766611f78910e2811b96a3370f79410574bbaaf7279
 | 
				
			||||||
size 607443
 | 
					size 607443
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@ -2,6 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "BaseGadgetTutorial.h"
 | 
					#include "BaseGadgetTutorial.h"
 | 
				
			||||||
 | 
					#include "EndlessVendetta/EndlessVendettaCharacter.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Sets default values
 | 
					// Sets default values
 | 
				
			||||||
ABaseGadgetTutorial::ABaseGadgetTutorial()
 | 
					ABaseGadgetTutorial::ABaseGadgetTutorial()
 | 
				
			||||||
@ -16,14 +17,8 @@ ABaseGadgetTutorial::ABaseGadgetTutorial()
 | 
				
			|||||||
void ABaseGadgetTutorial::BeginPlay()
 | 
					void ABaseGadgetTutorial::BeginPlay()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Super::BeginPlay();
 | 
						Super::BeginPlay();
 | 
				
			||||||
	
 | 
						SetupTutorial();
 | 
				
			||||||
}
 | 
						SetActorTickInterval(0.2);
 | 
				
			||||||
 | 
					 | 
				
			||||||
// Called every frame
 | 
					 | 
				
			||||||
void ABaseGadgetTutorial::Tick(float DeltaTime)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Super::Tick(DeltaTime);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ABaseGadgetTutorial::SpawnNewWaypoint(FVector Loc, FString Desc)
 | 
					void ABaseGadgetTutorial::SpawnNewWaypoint(FVector Loc, FString Desc)
 | 
				
			||||||
@ -36,8 +31,15 @@ void ABaseGadgetTutorial::SpawnNewWaypoint(FVector Loc, FString Desc)
 | 
				
			|||||||
	WaypointActor->SetupWaypoint(WaypointIcon, Desc);
 | 
						WaypointActor->SetupWaypoint(WaypointIcon, Desc);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ABaseGadgetTutorial::FinishedTutorial()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (IsValid(WaypointActor)) WaypointActor->Destroy();
 | 
				
			||||||
 | 
						CompletedGadgetTutorial.Broadcast();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ABaseGadgetTutorial::DestroyTutorial()
 | 
					void ABaseGadgetTutorial::DestroyTutorial()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if (IsValid(WaypointActor)) WaypointActor->Destroy();
 | 
				
			||||||
 | 
						DespawnEnemies();
 | 
				
			||||||
	Destroy();
 | 
						Destroy();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -15,30 +15,37 @@ class ENDLESSVENDETTA_API ABaseGadgetTutorial : public AActor
 | 
				
			|||||||
	GENERATED_BODY()
 | 
						GENERATED_BODY()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
 | 
						AWaypointActor* WaypointActor;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	UPROPERTY(EditDefaultsOnly, Category = "Gadget Tutorial")
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Gadget Tutorial")
 | 
				
			||||||
	TSubclassOf<AWaypointActor> WaypointClass;
 | 
						TSubclassOf<AWaypointActor> WaypointClass;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	AWaypointActor* WaypointActor;
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	UPROPERTY(EditDefaultsOnly, Category = "Gadget Tutorial")
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Gadget Tutorial")
 | 
				
			||||||
	UTexture2D* WaypointIcon;
 | 
						UTexture2D* WaypointIcon;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void SpawnNewWaypoint(FVector Loc, FString Desc);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	// Called when the game starts or when spawned
 | 
						// Called when the game starts or when spawned
 | 
				
			||||||
	virtual void BeginPlay() override;
 | 
						virtual void BeginPlay() override;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						void SpawnNewWaypoint(FVector Loc, FString Desc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Stops tutorial clues from appearing and broadcasts completion
 | 
				
			||||||
 | 
						void FinishedTutorial();
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						// Spawns Enemies, sets waypoint locations, etc...
 | 
				
			||||||
 | 
						UFUNCTION(BlueprintImplementableEvent)
 | 
				
			||||||
 | 
						void SetupTutorial();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Destroy's enemies and other separate spawned in elements by this tutorial class
 | 
				
			||||||
 | 
						UFUNCTION(BlueprintImplementableEvent)
 | 
				
			||||||
 | 
						void DespawnEnemies();
 | 
				
			||||||
 | 
						
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
	// Sets default values for this actor's properties
 | 
						// Sets default values for this actor's properties
 | 
				
			||||||
	ABaseGadgetTutorial();
 | 
						ABaseGadgetTutorial();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FCompletedGadgetTutorial CompletedGadgetTutorial;
 | 
						FCompletedGadgetTutorial CompletedGadgetTutorial;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Called every frame
 | 
						void DestroyTutorial();
 | 
				
			||||||
	virtual void Tick(float DeltaTime) override;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	virtual void DestroyTutorial();
 | 
					 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					// Fill out your copyright notice in the Description page of Project Settings.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "RingModuleTutorial.h"
 | 
				
			||||||
 | 
					#include "EndlessVendetta/EndlessVendettaCharacter.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ARingModuleTutorial::BeginPlay()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						Super::BeginPlay();
 | 
				
			||||||
 | 
						GadgetManager = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->GadgetManager;
 | 
				
			||||||
 | 
						SpawnNewWaypoint(HackTargetWaypointLoc, HackTargetWaypointDesc);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ARingModuleTutorial::Tick(float DeltaSeconds)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						Super::Tick(DeltaSeconds);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!GadgetManager->ReconInUse()) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						SpawnNewWaypoint(ResultWaypointLoc, ResultWaypointDesc);
 | 
				
			||||||
 | 
						SetActorTickEnabled(false);
 | 
				
			||||||
 | 
						FTimerHandle TimerHandle;
 | 
				
			||||||
 | 
						GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &ARingModuleTutorial::FinishedTutorial, 7.5);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					// Fill out your copyright notice in the Description page of Project Settings.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "CoreMinimal.h"
 | 
				
			||||||
 | 
					#include "BaseGadgetTutorial.h"
 | 
				
			||||||
 | 
					#include "EndlessVendetta/GadgetSystem/GadgetManager.h"
 | 
				
			||||||
 | 
					#include "RingModuleTutorial.generated.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					UCLASS()
 | 
				
			||||||
 | 
					class ENDLESSVENDETTA_API ARingModuleTutorial : public ABaseGadgetTutorial
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						GENERATED_BODY()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						AGadgetManager* GadgetManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void BeginPlay() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void Tick(float DeltaSeconds) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					protected:
 | 
				
			||||||
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Gadget Tutorial")
 | 
				
			||||||
 | 
						FString HackTargetWaypointDesc;
 | 
				
			||||||
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Gadget Tutorial")
 | 
				
			||||||
 | 
						FString ResultWaypointDesc;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						UPROPERTY(BlueprintReadWrite, Category = "Gadget Tutorial")
 | 
				
			||||||
 | 
						FVector HackTargetWaypointLoc;
 | 
				
			||||||
 | 
						UPROPERTY(BlueprintReadWrite, Category = "Gadget Tutorial")
 | 
				
			||||||
 | 
						FVector ResultWaypointLoc;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@ -4,15 +4,13 @@
 | 
				
			|||||||
#include "VisionLinkTutorial.h"
 | 
					#include "VisionLinkTutorial.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "EndlessVendetta/EndlessVendettaCharacter.h"
 | 
					#include "EndlessVendetta/EndlessVendettaCharacter.h"
 | 
				
			||||||
#include "EndlessVendetta/GadgetSystem/GadgetManager.h"
 | 
					 | 
				
			||||||
#include "Kismet/KismetMathLibrary.h"
 | 
					#include "Kismet/KismetMathLibrary.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AVisionLinkTutorial::BeginPlay()
 | 
					void AVisionLinkTutorial::BeginPlay()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Super::BeginPlay();
 | 
						Super::BeginPlay();
 | 
				
			||||||
	SpawnEnemiesAndSetupDefaults();
 | 
						GadgetManager = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->GadgetManager;
 | 
				
			||||||
	SpawnNewWaypoint(GoToAreaWaypointLoc, GoToAreaWaypointDesc);
 | 
						SpawnNewWaypoint(GoToAreaWaypointLoc, GoToAreaWaypointDesc);
 | 
				
			||||||
	SetActorTickInterval(0.2);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AVisionLinkTutorial::Tick(float DeltaSeconds)
 | 
					void AVisionLinkTutorial::Tick(float DeltaSeconds)
 | 
				
			||||||
@ -30,12 +28,10 @@ void AVisionLinkTutorial::Tick(float DeltaSeconds)
 | 
				
			|||||||
	PlayerWasInTutZone = true;
 | 
						PlayerWasInTutZone = true;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	// Check if players recon gadget (vision link) is in active
 | 
						// Check if players recon gadget (vision link) is in active
 | 
				
			||||||
	APawn* PlayerPawn = GetWorld()->GetFirstPlayerController()->GetPawn();
 | 
					 | 
				
			||||||
	AEndlessVendettaCharacter* EndlessVendettaCharacter = Cast<AEndlessVendettaCharacter>(PlayerPawn);
 | 
					 | 
				
			||||||
	AGadgetManager* GadgetManager = EndlessVendettaCharacter->GadgetManager;
 | 
					 | 
				
			||||||
	if (!GadgetManager->ReconInUse()) return;
 | 
						if (!GadgetManager->ReconInUse()) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Check if the player is roughly looking at their target
 | 
						// Check if the player is roughly looking at their target
 | 
				
			||||||
 | 
						APawn* PlayerPawn = GetWorld()->GetFirstPlayerController()->GetPawn();
 | 
				
			||||||
	FRotator LookAtRot = UKismetMathLibrary::FindLookAtRotation(PlayerPawn->GetActorLocation(), TargetLoc);
 | 
						FRotator LookAtRot = UKismetMathLibrary::FindLookAtRotation(PlayerPawn->GetActorLocation(), TargetLoc);
 | 
				
			||||||
	FRotator PlayersRotator = PlayerPawn->GetActorRotation();
 | 
						FRotator PlayersRotator = PlayerPawn->GetActorRotation();
 | 
				
			||||||
	// Keep all yaw values between -180 and 180 to simplify the comparison
 | 
						// Keep all yaw values between -180 and 180 to simplify the comparison
 | 
				
			||||||
@ -53,19 +49,5 @@ void AVisionLinkTutorial::Tick(float DeltaSeconds)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AVisionLinkTutorial::DestroyTutorial()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	if (IsValid(WaypointActor)) WaypointActor->Destroy();
 | 
					 | 
				
			||||||
	DespawnEnemies();
 | 
					 | 
				
			||||||
	Super::DestroyTutorial();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void AVisionLinkTutorial::FinishedTutorial()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	if (IsValid(WaypointActor)) WaypointActor->Destroy();
 | 
					 | 
				
			||||||
	CompletedGadgetTutorial.Broadcast();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -4,6 +4,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "CoreMinimal.h"
 | 
					#include "CoreMinimal.h"
 | 
				
			||||||
#include "BaseGadgetTutorial.h"
 | 
					#include "BaseGadgetTutorial.h"
 | 
				
			||||||
 | 
					#include "EndlessVendetta/GadgetSystem/GadgetManager.h"
 | 
				
			||||||
#include "VisionLinkTutorial.generated.h"
 | 
					#include "VisionLinkTutorial.generated.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
UCLASS()
 | 
					UCLASS()
 | 
				
			||||||
@ -11,16 +12,15 @@ class ENDLESSVENDETTA_API AVisionLinkTutorial : public ABaseGadgetTutorial
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	GENERATED_BODY()
 | 
						GENERATED_BODY()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool PlayerInTutorialZone = false;
 | 
						AGadgetManager* GadgetManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						bool PlayerInTutorialZone = false;
 | 
				
			||||||
	bool PlayerWasInTutZone = false;
 | 
						bool PlayerWasInTutZone = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void BeginPlay() override;
 | 
						void BeginPlay() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void Tick(float DeltaSeconds) override;
 | 
						void Tick(float DeltaSeconds) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void DestroyTutorial() override;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
	UPROPERTY(EditDefaultsOnly)
 | 
						UPROPERTY(EditDefaultsOnly)
 | 
				
			||||||
	FString GoToAreaWaypointDesc;
 | 
						FString GoToAreaWaypointDesc;
 | 
				
			||||||
@ -39,12 +39,6 @@ protected:
 | 
				
			|||||||
	UPROPERTY(BlueprintReadWrite)
 | 
						UPROPERTY(BlueprintReadWrite)
 | 
				
			||||||
	FVector TargetLoc;
 | 
						FVector TargetLoc;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	// Spawns enemies, sets up waypoint locs, and target loc
 | 
					 | 
				
			||||||
	UFUNCTION(BlueprintImplementableEvent)
 | 
					 | 
				
			||||||
	void SpawnEnemiesAndSetupDefaults();
 | 
					 | 
				
			||||||
	UFUNCTION(BlueprintImplementableEvent)
 | 
					 | 
				
			||||||
	void DespawnEnemies();
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	UFUNCTION(BlueprintCallable)
 | 
						UFUNCTION(BlueprintCallable)
 | 
				
			||||||
	void PlayerEnteredTutorialZone()
 | 
						void PlayerEnteredTutorialZone()
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@ -55,6 +49,4 @@ protected:
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		PlayerInTutorialZone = false;
 | 
							PlayerInTutorialZone = false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	void FinishedTutorial();
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user