Get Lenth of quests

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jrose1184
Posts: 62
Joined: Mon Jan 22, 2024 2:35 pm

Get Lenth of quests

Post by jrose1184 »

Hi tony,

Im trying to get the length of all active quests and all completed quests. I gave me 'QuestLog.GetAllQuests().Length' but wanted to track them individually if possible please.
User avatar
Tony Li
Posts: 22871
Joined: Thu Jul 18, 2013 1:27 pm

Re: Get Lenth of quests

Post by Tony Li »

Hi,

What do you mean by the length of quests? If you mean the amount/count, you can get a list of the names of the active quests using:

Code: Select all

var activeQuests = QuestLog.GetAllQuests();
foreach (var quest in activeQuests) { Debug.Log("Active quest: " + quest); }
To get a list of the names of success/failure quests:

Code: Select all

var completedQuests = QuestLog.GetAllQuests(QuestState.Success | QuestState.Failure);
jrose1184
Posts: 62
Joined: Mon Jan 22, 2024 2:35 pm

Re: Get Lenth of quests

Post by jrose1184 »

Thank you - wanted to add a controller 'A' image to show you can toggle the quest but i only want it to show if there is more then 1 active quest and if there is more then 1 complete quest. Get all quests would show all of it but i needed there lengths individually.

I have a few more questions and then i think im golden on this.

1) how can i disabble the top right active quest think it might be the quest hub

2) when i go to speak to the npc i currently have it set as space bar to start converstation can i also add a option for say Fire2 on the joystick?
User avatar
Tony Li
Posts: 22871
Joined: Thu Jul 18, 2013 1:27 pm

Re: Get Lenth of quests

Post by Tony Li »

jrose1184 wrote: Tue Mar 18, 2025 2:11 pm1) how can i disabble the top right active quest think it might be the quest hub
That's the quest HUD. Do you not want the HUD at all? If so, remove it from the Dialogue Manager's Instantiate Prefabs component > Prefabs list. If you just want to hide it, call its HideTracker() method.
jrose1184 wrote: Tue Mar 18, 2025 2:11 pm2) when i go to speak to the npc i currently have it set as space bar to start converstation can i also add a option for say Fire2 on the joystick?
Yes. If you're using a Selector or Proximity Selector, set the Use Button.

If you're using the built-in input manager, set it to "Fire2".

If you're using the Input System package, add your joystick input action to your input actions asset. Then add an Input Action Registry component to the Dialogue Manager. Assign your input action to it. Then enter the name of that input action (e.g., "Fire2") in the Use Button field.
jrose1184
Posts: 62
Joined: Mon Jan 22, 2024 2:35 pm

Re: Get Lenth of quests

Post by jrose1184 »

Thank you - that should be me sorted.
jrose1184
Posts: 62
Joined: Mon Jan 22, 2024 2:35 pm

Re: Get Lenth of quests

Post by jrose1184 »

https://postimg.cc/ftxPNMMp

Sorry seems to only be working with space bar not Y on my xbox controller
jrose1184
Posts: 62
Joined: Mon Jan 22, 2024 2:35 pm

Re: Get Lenth of quests

Post by jrose1184 »

Ignore i needed to change it to keyboard or keys
Post Reply