Started working on Merchant Logic

Started to create the base merchant trigger box to start making the interaction between player and merchant npc
This commit is contained in:
MH261677 2022-11-10 01:09:02 +00:00
parent bfe2de2d5d
commit 25fa3d3414
4 changed files with 69 additions and 3 deletions

View File

@ -28,6 +28,6 @@ bOffsetPlayerGamepadIds=False
GameInstanceClass=/Script/Engine.GameInstance
GameDefaultMap=/Game/Levels/Main.Main
ServerDefaultMap=/Engine/Maps/Entry.Entry
GlobalDefaultGameMode=/Game/GameMode/MainGameMode.MainGameMode_C
GlobalDefaultGameMode=/Script/Engine.GameModeBase
GlobalDefaultServerGameMode=None

BIN
Content/Levels/MerchantPrototype.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -0,0 +1,39 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "MerchantTriggerBox.h"
//makes it so the component script is initialized when game starts
UMerchantTriggerBox::UMerchantTriggerBox()
{
PrimaryComponentTick.bCanEverTick = true;
}
void UMerchantTriggerBox::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("TRIGGER SPAWNED"));
}
void UMerchantTriggerBox::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}
void UMerchantTriggerBox::PlayerCheck()
{
/*
TODO:
UNCOMMENT THE UPRIMITECOMPONENT OUT
FILL OUT THE COMPONENTOVERLAP FUNCTION SO IT DISPLAYS THE PLAYERS NAME WHEN THEY ENTER IT
*/
//UPrimitiveComponent TriggerOverlap = BeginComponentOverlap();
}

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "Components/PrimitiveComponent.h"
#include "MerchantTriggerBox.generated.h"
/**
*
*/
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class THE_TWILIGHT_ABYSS_API UMerchantTriggerBox : public UBoxComponent
{
GENERATED_BODY()
protected:
virtual void BeginPlay() override;
public:
UMerchantTriggerBox();
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
private:
void PlayerCheck();
};