Tweaks to the quests system and dialogue system bugfix, talking to npcs now triggers dialogue, questing UI made and some test quests and dialogue
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "SpeechDataAsset.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "ProjectEleri/GameEventSystem/GameEventSubsystem.h"
|
||||
#include "QuestSystem/QuestSubsystem.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "DialogueSystem"
|
||||
|
||||
@@ -195,7 +196,15 @@ void UDialogueComponent::AdvanceDialogue()
|
||||
}
|
||||
}
|
||||
|
||||
if (!CurrentActiveDialogue->RandomizeLines && (CurrentLineIndex <= CurrentActiveDialogue->DialogueLines.Num() - 1))
|
||||
if (!CurrentActiveDialogue->StartQuests.IsEmpty())
|
||||
{
|
||||
for (const FGameplayTag& QuestTag : CurrentActiveDialogue->StartQuests)
|
||||
{
|
||||
UQuestSubsystem::Get(this)->OfferQuest(QuestTag);
|
||||
}
|
||||
}
|
||||
|
||||
if (!CurrentActiveDialogue->RandomizeLines && (CurrentLineIndex < CurrentActiveDialogue->DialogueLines.Num() - 1))
|
||||
{
|
||||
CurrentLineIndex++;
|
||||
DialogueWidget->AdvanceDialogue(CurrentActiveDialogue->DialogueLines[CurrentLineIndex].DialogueLine, CurrentActiveDialogue->DialogueLines[CurrentLineIndex].SpeakerName);
|
||||
|
||||
@@ -56,6 +56,9 @@ public:
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Eleri|Speech")
|
||||
TSoftClassPtr<AActor> Npc;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Eleri|Speech", meta = (Categories = "Quests"))
|
||||
FGameplayTagContainer StartQuests;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Eleri|Speech")
|
||||
FText PlayerAsk;
|
||||
|
||||
@@ -91,6 +91,8 @@ void ATimeOfDayManager::BeginPlay()
|
||||
WeatherObjectPath.Value);
|
||||
} }));
|
||||
}
|
||||
|
||||
CloudsLightMaterial = CloudsLightMaterial.LoadSynchronous();
|
||||
}
|
||||
|
||||
void ATimeOfDayManager::PostLoad()
|
||||
@@ -283,7 +285,18 @@ void ATimeOfDayManager::UpdateLightning()
|
||||
CurrentWeaterFadeAlpha)
|
||||
: static_cast<float>(CurrentWeatherPreset->bIsRain));
|
||||
}
|
||||
|
||||
|
||||
//Set clouds
|
||||
if (sunLight && !sunLight->LightFunctionMaterial)
|
||||
{
|
||||
sunLight->SetLightFunctionMaterial(CloudsLightMaterial.Get());
|
||||
}
|
||||
|
||||
if (moonLight && !moonLight->LightFunctionMaterial)
|
||||
{
|
||||
moonLight->SetLightFunctionMaterial(CloudsLightMaterial.Get());
|
||||
}
|
||||
|
||||
UpdateMajorLightning();
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,9 @@ public:
|
||||
UPROPERTY(EditAnywhere)
|
||||
bool enableDebugLogs;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Time of Day - Lightning Setting")
|
||||
TSoftObjectPtr<UMaterialInstance> CloudsLightMaterial;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Time of Day - Lightning Setting",
|
||||
meta = (AllowedClasses = "/Script/ProjectEleri.GameEventDataAsset"))
|
||||
TMap<FGameplayTag, FSoftObjectPath> WeatherEventDataAssetMap;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "QuestDataAsset.h"
|
||||
|
||||
#include "Items/ItemDatabase.h"
|
||||
#include "ProjectEleri/GameEventSystem/GameEventRequirements.h"
|
||||
#include "ProjectEleri/Items/DataAssets/ItemDataAsset.h"
|
||||
|
||||
@@ -124,17 +125,13 @@ void UQuestDataAsset::CollectDeliverables(const FQuestRuntimeState& State, TArra
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const FPrimaryAssetId ItemId = Objective.TargetItem.LoadSynchronous()
|
||||
? Objective.TargetItem->GetPrimaryAssetId()
|
||||
: FPrimaryAssetId();
|
||||
|
||||
if (!ItemId.IsValid())
|
||||
|
||||
if (!Objective.TargetItem.IsValid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
OutItems.Emplace(ItemId, FMath::Max(1, Objective.RequiredCount));
|
||||
OutItems.Emplace(Objective.TargetItem, FMath::Max(1, Objective.RequiredCount));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -925,8 +925,7 @@ bool UQuestSubsystem::RecountInventoryObjectives(FQuestRuntimeState& State)
|
||||
continue;
|
||||
}
|
||||
|
||||
const UItemDataAsset* ItemAsset = Objective.TargetItem.LoadSynchronous();
|
||||
const FPrimaryAssetId ItemId = ItemAsset != nullptr ? ItemAsset->GetPrimaryAssetId() : FPrimaryAssetId();
|
||||
const FPrimaryAssetId ItemId = Objective.TargetItem;
|
||||
if (!ItemId.IsValid())
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("Quest '%s' step '%s' asks for an item that could not be resolved, so it can never be done."),
|
||||
|
||||
@@ -134,7 +134,7 @@ struct PROJECTELERI_API FQuestObjective
|
||||
|
||||
/** How many times the step has to happen. Ignored by AcquireItems and DeliverItems, which count
|
||||
* what the inventory holds rather than how often something occurred. */
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Step", meta = (ClampMin = 1, EditCondition = "StepType!=EQuestStepType::AcquireItems && StepType!=EQuestStepType::DeliverItems"))
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Step", meta = (ClampMin = 1))
|
||||
int32 RequiredCount = 1;
|
||||
|
||||
/** Counted, but not required: the quest can be handed in without it */
|
||||
@@ -168,8 +168,8 @@ struct PROJECTELERI_API FQuestObjective
|
||||
float ArrivalRadius = 0.f;
|
||||
|
||||
/** AcquireItems / DeliverItems: the item that has to be carried */
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Step", meta = (EditCondition = "StepType==EQuestStepType::AcquireItems || StepType==EQuestStepType::DeliverItems", EditConditionHides))
|
||||
TSoftObjectPtr<UItemDataAsset> TargetItem;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Step", meta = (EditCondition = "StepType==EQuestStepType::AcquireItems || StepType==EQuestStepType::DeliverItems", EditConditionHides, Categories = "Items"))
|
||||
FPrimaryAssetId TargetItem;
|
||||
|
||||
/** AcquireItems / DeliverItems: count only the high quality stack */
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Step", meta = (EditCondition = "StepType==EQuestStepType::AcquireItems || StepType==EQuestStepType::DeliverItems", EditConditionHides))
|
||||
|
||||
Reference in New Issue
Block a user