Marking Quest Complete

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jrose1184
Posts: 16
Joined: Mon Jan 22, 2024 2:35 pm

Marking Quest Complete

Post by jrose1184 »

Hi i have created a qeust where a number should be greater then 70. But i need to use it on a mini arcade game where i need to beat the high score. So how can i do this through code?

this is my quest entry
[var=Arcade_score]/69
jrose1184
Posts: 16
Joined: Mon Jan 22, 2024 2:35 pm

Re: Marking Quest Complete

Post by jrose1184 »

I tried to do this but it didnt work

float arcadeScore = DialogueLua.GetVariable("Arcade_score").AsFloat;
float playerScoreFloat = (float)score;

if (score >= arcadeScore)
{
arcadeScore = playerScoreFloat;
}
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Marking Quest Complete

Post by Tony Li »

Hi,

Are you trying to set the value of the "Arcade_score" Dialogue System variable in a C# script? If so, use DialogueLua.SetVariable(). Example:

Code: Select all

DialogueLua.SetVariable("Arcade_score", 70);
DialogueManager.SendUpdateTracker();
The second line (SendUpdateTracker) sends an "UpdateTracker" message to the Dialogue System that tells the quest tracker HUD to update itself with any new values.
Post Reply