Some fixes for quest and started making Trish and her first quest

This commit is contained in:
2026-10-06 23:05:57 +02:00
parent 3ba640ac53
commit adc5756866
13 changed files with 29 additions and 17 deletions

View File

@@ -82,7 +82,7 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Eleri|Event Requirment")
TArray<FEventRequirement> EventRequirements;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Eleri|Speech")
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Eleri|Speech", meta = (AllowedClasses = "/Script/ProjectEleri.NpcBaseCharacter"))
TSoftClassPtr<AActor> Npc;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Eleri|Speech", meta = (Categories = "Quests"))

View File

@@ -49,7 +49,7 @@ struct FNpcCharacterData
* is far away, the state machine walks it there and keeps it there, the inventory holds whatever it
* carries, and the interaction widget shows its prompt.
*/
UCLASS(BlueprintType)
UCLASS(BlueprintType, PrioritizeCategories = "Info")
class PROJECTELERI_API ANpcBaseCharacter : public APawn, public IInteractableActorInterface
{
GENERATED_BODY()
@@ -114,6 +114,6 @@ protected:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
TObjectPtr<UInteractionWidgetComponent> WidgetComponent;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Info")
FNpcCharacterData NpcCharacterData;
};

View File

@@ -1125,8 +1125,10 @@ bool UQuestSubsystem::DoesActorMatchObjective(const FQuestObjective& Objective,
// The actor the step names, when it names one. Asked both ways round: a resolved reference is the
// cheap path, and the path is what a step that points at an actor in a level which is not loaded
// right now can still be matched against.
if (!Objective.TargetActor.IsNull()
&& (Objective.TargetActor.Get() == Actor || Objective.TargetActor.ToSoftObjectPath() == FSoftObjectPath(Actor)))
if (Objective.TargetActors.ContainsByPredicate([Actor](const TSoftObjectPtr<AActor>& OtherActor)
{
return OtherActor.ToSoftObjectPath() == FSoftObjectPath(Actor);
}))
{
return true;
}
@@ -1151,7 +1153,7 @@ bool UQuestSubsystem::DoesActorMatchObjective(const FQuestObjective& Objective,
// A step that names nothing is satisfied by anything, which is how "use one of the wells" is
// written without having to list every well in the level.
return Objective.TargetActor.IsNull()
return Objective.TargetActors.IsEmpty()
&& Objective.TargetLocationMarker.IsNull()
&& !Objective.TargetNpcTag.IsValid();
}

View File

@@ -151,7 +151,7 @@ struct PROJECTELERI_API FQuestObjective
/** TalkToNpc / InteractWith / LocationArrival: the target, when it is not an NPC */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Step", meta = (EditCondition = "StepType==EQuestStepType::TalkToNpc || StepType==EQuestStepType::InteractWith || StepType==EQuestStepType::LocationArrival", EditConditionHides))
TSoftObjectPtr<AActor> TargetActor;
TArray<TSoftObjectPtr<AActor>> TargetActors;
/** DialogueEvent: the event a line has to fire. TalkToNpc accepts it too, which is how a
* conversation with several outcomes is made to count. */