Page 1 of 1

Get Lenth of quests

Posted: Mon Mar 17, 2025 5:48 pm
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.

Re: Get Lenth of quests

Posted: Mon Mar 17, 2025 7:18 pm
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);

Re: Get Lenth of quests

Posted: Tue Mar 18, 2025 2:11 pm
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?

Re: Get Lenth of quests

Posted: Tue Mar 18, 2025 2:15 pm
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.

Re: Get Lenth of quests

Posted: Tue Mar 18, 2025 3:02 pm
by jrose1184
Thank you - that should be me sorted.

Re: Get Lenth of quests

Posted: Tue Mar 18, 2025 4:08 pm
by jrose1184
https://postimg.cc/ftxPNMMp

Sorry seems to only be working with space bar not Y on my xbox controller

Re: Get Lenth of quests

Posted: Tue Mar 18, 2025 4:12 pm
by jrose1184
Ignore i needed to change it to keyboard or keys