Page 1 of 1

How to check a quest state?

Posted: Tue Nov 08, 2022 11:40 am
by yo142
Hi, im currently working with multiple scenes using additive load and a parent (or central) scene which contains a quest machine and quest journal prefabs, it seems to work fine so far (ive only tested a simple collection quest), but i cant find a way to check a specific quest's state

Let me explain an example, all the additive scenes (rooms) have thier lights turned off (light component disabled) and one of the rooms has a "generator" (interaction) that sets the quest as completed once "activated" so when loading other rooms the lights must be turned on now

I was thinking about having a light controller script for each room that enables or disables the lights components based on the "generator quest" status (on the "void Start" Method) but i cant find a way the read quest's state from the journal

I would like to know how can i get the status of a specific quest and if there is a proper or recomended way to implement quest machine in this kind o scenarios

Thanks

Re: How to check a quest state?

Posted: Tue Nov 08, 2022 12:11 pm
by Tony Li
Hi,

The easiest way to check in a C# script is to use QuestMachine.GetQuestState().

Re: How to check a quest state?

Posted: Tue Nov 08, 2022 1:59 pm
by yo142
That was exactly what i needed

Thank you

Re: How to check a quest state?

Posted: Tue Nov 08, 2022 2:07 pm
by Tony Li
Glad to help!