Quest Journal add quest using custom script

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Killertakiyo24333
Posts: 6
Joined: Sat Mar 22, 2025 12:44 pm

Quest Journal add quest using custom script

Post by Killertakiyo24333 »

Anyone, how to add the list of quests in quest journall script attached to the character Using custom script?
Attachments
questJournal.png
questJournal.png (66.73 KiB) Viewed 7724 times
User avatar
Tony Li
Posts: 22983
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Journal add quest using custom script

Post by Tony Li »

Killertakiyo24333
Posts: 6
Joined: Sat Mar 22, 2025 12:44 pm

Re: Quest Journal add quest using custom script

Post by Killertakiyo24333 »

But how to add multiple quest using that custom script?
User avatar
Tony Li
Posts: 22983
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Journal add quest using custom script

Post by Tony Li »

Hi,

The simplest way is to use the QuestGiver setup described in the first part of that post. Simply call QuestGiver.GiveAllQuestsToQuester().

If you don't want to do that, you can use the code in the second part of the post for each of the quests.
Killertakiyo24333
Posts: 6
Joined: Sat Mar 22, 2025 12:44 pm

Re: Quest Journal add quest using custom script

Post by Killertakiyo24333 »

Here my problem Sir
Attachments
Screenshot_82.png
Screenshot_82.png (99.9 KiB) Viewed 6399 times
User avatar
Tony Li
Posts: 22983
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Journal add quest using custom script

Post by Tony Li »

Loop through the list.

Code: Select all

[SerializeField] private List<Quest> questAssets;
 ...
 foreach (var questAsset in questAssets)
 {
     var questInstance = questAsset.Clone();
     ...
Killertakiyo24333
Posts: 6
Joined: Sat Mar 22, 2025 12:44 pm

Re: Quest Journal add quest using custom script

Post by Killertakiyo24333 »

Thankyou Sir, but another problem is all the Quest I put into the List is active state and show to the HUD UI
User avatar
Tony Li
Posts: 22983
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Journal add quest using custom script

Post by Tony Li »

Hi,

Isn't that what you want? What do you want to happen? The code above gives the quests to the player's Quest Journal and activates the quests.
Killertakiyo24333
Posts: 6
Joined: Sat Mar 22, 2025 12:44 pm

Re: Quest Journal add quest using custom script

Post by Killertakiyo24333 »

I want to have an Controller for the Quest if Active state or not
Post Reply