Page 1 of 1

Quest Journal add quest using custom script

Posted: Tue Mar 25, 2025 6:43 am
by Killertakiyo24333
Anyone, how to add the list of quests in quest journall script attached to the character Using custom script?

Re: Quest Journal add quest using custom script

Posted: Tue Mar 25, 2025 6:55 am
by Tony Li

Re: Quest Journal add quest using custom script

Posted: Sat Mar 29, 2025 1:47 pm
by Killertakiyo24333
But how to add multiple quest using that custom script?

Re: Quest Journal add quest using custom script

Posted: Sat Mar 29, 2025 1:50 pm
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.

Re: Quest Journal add quest using custom script

Posted: Sat Mar 29, 2025 2:06 pm
by Killertakiyo24333
Here my problem Sir

Re: Quest Journal add quest using custom script

Posted: Sat Mar 29, 2025 2:14 pm
by Tony Li
Loop through the list.

Code: Select all

[SerializeField] private List<Quest> questAssets;
 ...
 foreach (var questAsset in questAssets)
 {
     var questInstance = questAsset.Clone();
     ...

Re: Quest Journal add quest using custom script

Posted: Tue Apr 15, 2025 12:55 pm
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

Re: Quest Journal add quest using custom script

Posted: Tue Apr 15, 2025 3:59 pm
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.

Re: Quest Journal add quest using custom script

Posted: Wed Apr 16, 2025 12:57 am
by Killertakiyo24333
I want to have an Controller for the Quest if Active state or not

Re: Quest Journal add quest using custom script

Posted: Wed Apr 16, 2025 8:12 am
by Tony Li
If you're using the code I suggested in this post, then just remove this line:

Code: Select all

questInstance.SetState(QuestState.Active);
You can set the quest active later in this case.