What is the command to use a completed quest as a boolean variable?

Hello! I’m having trouble using a quest that is complete as a boolean variable that unlocks the next one.

What command should I use for this? Can someone show me an example or where can I find this information in the doc?

What I need is: The quest has 2 objectives, each one is completed on a different button on the screen, when the 2 objectives are completed I execute a run command and it checks if the 2 objectives are completed, to complete the quest and release another quest on a third button, that was hidden and appears when this condition is met, starting the next quest.

Since I’m using non-linear logic, I don’t know what I have to type or do to make the completed quest work as a boolean variable of true or false. My solution would be to abandon the non-linear logic and control this with a simple counter token, but I would really like to keep this non-linear.

Can anyone help me?

main:
  var succeeded false
  complete_quest breadShopping $succeeded

Sorry, I think I misunderstood the doc or you misunderstood me.

This is just to control the dynamic text when a quest is successful or not in a quest with multiple endings.

I want to use the quest completion as an if condition.

Oh, I misunderstood.

You would want to use quest_succeeded? and quest_failed? mentioned on the same page.

English is my third language, I’m probably expressing myself badly, I apologize for any inconvenience. What’s on the Quests page didn’t help me, that’s why I came here. I don’t want to check if the quest is a success or change the text that appears in the quests tab, I want to use the completed quest itself, its state when I declare it complete with a command, as a true or false variable. Got it? For example:

XXXZ: (Quest File)
title: XXX
description: ABC
objectives:
X10:
hidden: false
description: Derp
X20:
hidden: false
description: Herp

quest1: (default button)
complete_objective XXXZ X10
run 3bt
set_screen default

quest2: (default button)
complete_objective XXXZ X20
run 3bt
set_screen default

quest3: (locked default button)
if (== $XXX complete):
start_quest ZXXX

3bt:
if (== XX10 and XX20 complete):
complete_quest XXZ
set_button quest3 true

Do you understand what I’m trying to do? I want to know how I use the objectives of a quest as a condition and the completed quest itself as a condition.

3bt:
  if (== (objective_completed? XXZ XX10) and (objective_completed? XXZ XX20) true):
  complete_quest XXZ
  set_button quest3 true

Like this you mean?

Yes, that’s the result I want, but I don’t know how to do it. This command specifically didn’t work, it doesn’t seem to be doing anything. You put true at the end because when I complete an objective it’s because I’m changing the quest from false to true? Me saying that something is boolean is my way of explaining what I want, I don’t have the skills or programming knowledge to give precise instructions.

I don’t even know if I got the syntax correct. I didn’t test it, and may have gotten the parenthesis incorrect too.

objective_completed? [Quest name] [Objective Name]

Should return true if an Objective under it’s Quest has been completed.

it might be easier to do something like this to test if it works initially:

3bt:
  if ( objective_complete? XXZ XX10 ):
    if ( objective_complete? XXZ XX20 ): 
      // Commands you want 
1 Like

Well my friend, thank you very much because there has been great progress. It was indeed a syntax error.

if (&& (objective_completed? XXZ XX10) (objective_completed? XXZ XX20)):

By testing more things while I was sending this message earlier, I managed to get it to work.

Thank you so much for your time and patience!

1 Like