Start and complete
const bool bStarted = QuestComp->StartQuestById(FName(TEXT("BrokerContract")));
const bool bProgressed = QuestComp->CompleteObjective(FName(TEXT("KillRaiders")), 1);
const bool bFailed = QuestComp->FailObjective(FName(TEXT("EscortDied")));
QuestComp->AbandonQuestById(FName(TEXT("BrokerContract")));
Do not use the bool on the owning client to update the HUD. The bool is false after the RPC is sent. On the server, true means the change applied.
Client pattern:
QuestComp->CompleteObjective(FName(TEXT("KillRaiders")), 1);
// Then refresh UI from GetQuestsByStatus / events, not from bProgressed
On dedicated, call from server gameplay (for example OnDeath on the server):
if (APlayerState* PS = Killer->GetPlayerState())
{
if (UQuestComponent* QC = PS->FindComponentByClass<UQuestComponent>())
{
QC->CompleteObjective(FName(TEXT("KillRaiders")), 1);
}
}
Fail and abandon are valid only from Active. The quest then becomes Available.
float Remaining = 0.f;
QuestComp->GetObjectiveFailTimeRemaining(
FName(TEXT("BrokerContract")),
FName(TEXT("KillRaiders")),
Remaining);
// Live on authority. Last replicated snapshot on the owning client.
Time To Fail ticks on authority only.