if statement for script
-
- Posts: 11
- Joined: Thu Jun 06, 2024 9:37 pm
if statement for script
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
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:
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
-
- Posts: 11
- Joined: Thu Jun 06, 2024 9:37 pm
Re: if statement for script
yupp this worked great. Thank you!