Page 1 of 1
if statement for script
Posted: Tue Feb 25, 2025 4:35 pm
by pizzadelivery3
I'm working on conditions and scripts for a quest. I want one of the dialogue nodes to set a quest active ONLY IF the quest is currently inactive. The use case of this is if a player picks up a key item to complete a quest before the quest has even started I don't want the dialogue node of the previous conversation to start the quet since it's already been completed. Let me know thanks!
Re: if statement for script
Posted: Tue Feb 25, 2025 6:59 pm
by Tony Li
Hi,
While you could use two nearly-identical dialogue entry nodes -- one with Conditions that check if the quest is active and one with Conditions that check if the quest is inactive -- this isn't necessary. You can use a single dialogue entry node and set the Script field to something like:
Code: Select all
if (CurrentQuestState("Your Quest") == unassigned) then
SetQuestState("Your Quest", active)
end
Re: if statement for script
Posted: Tue Feb 25, 2025 7:26 pm
by pizzadelivery3
yupp this worked great. Thank you!
Re: if statement for script
Posted: Tue Feb 25, 2025 7:54 pm
by Tony Li
Glad to help!