How to check a quest state?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
yo142
Posts: 3
Joined: Fri Sep 30, 2022 10:20 am

How to check a quest state?

Post 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
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to check a quest state?

Post by Tony Li »

Hi,

The easiest way to check in a C# script is to use QuestMachine.GetQuestState().
yo142
Posts: 3
Joined: Fri Sep 30, 2022 10:20 am

Re: How to check a quest state?

Post by yo142 »

That was exactly what i needed

Thank you
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to check a quest state?

Post by Tony Li »

Glad to help!
Post Reply