Calling up Quest Log screen with Playmaker

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
somewhatsoftware
Posts: 4
Joined: Fri May 28, 2021 11:37 am

Calling up Quest Log screen with Playmaker

Post by somewhatsoftware »

Hey! First of all, I have to establish I am not a technical person, like, at all. Your Dialog System solution is perfect for someone like me, since it's mostly ready-made. I have basically no coding knowledge so I use PlayMaker to get around.

I started customizing Dialog System to integrate it in my game, mostly doing cosmetic changes, but I wanted to be able to open the Quest Log using my own Unity UI button through a PlayMaker FSM (like the rest of my UI is already set up), and I'm having a hard time figuring the best way to do it with my limited technical knowledge.

I figure I could use the custom PlayMaker action Run Lua in order to run a line of code to show the Quest Log UI on command (and another to make it disappear) but then I cannot figure out what line of Lua to write (if it is at all possible).

Any suggestions on how I could go about opening the Quest Log UI from PlayMaker? Explain it to me like I'm 5 years old, please. :D
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Calling up Quest Log screen with Playmaker

Post by Tony Li »

Hi,

You can configure your UI Button to call the quest log window's Open() method:

uiButtonQuestLogWindowOpen.png
uiButtonQuestLogWindowOpen.png (7.54 KiB) Viewed 722 times

Or you can add a Quest Log Window Hotkey component to map an input button or key code to toggle the quest log window's visibility.

If you want to use a PlayMaker FSM, then, assuming you have a reference to the quest log window, you can use PlayMaker's Send Message action to send the message "Open" to it.
somewhatsoftware
Posts: 4
Joined: Fri May 28, 2021 11:37 am

Re: Calling up Quest Log screen with Playmaker

Post by somewhatsoftware »

Thank you very much for such a quick reply.
Your suggestions work well, both assigning the .open function to the OnClick in the button and in a PlayMaker FSM with the Send Message action.

But the Quest Log UI opens with the Abandon Quest Confirmation panel opened already when I do that. Any suggestion on why that would be?

For additional information, if it helps: I basically took the Basic Standard UI Quest Log Window prefab and just dropped it in my own custom Canvas and then deactivated the prefab game object. Then, the button I created opens the prefab using either method described above (OnClick or FSM Send Message), and it opens with the Abandon Quest Confirmation panel opened.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Calling up Quest Log screen with Playmaker

Post by Tony Li »

If you use one of the prefab quest log windows, does the abandon quest confirmation panel start open?

If not, make sure your abandon quest confirmation panel is assigned to the StandardUIQuestLogWindow component so it knows about it and can make sure it's closed.
somewhatsoftware
Posts: 4
Joined: Fri May 28, 2021 11:37 am

Re: Calling up Quest Log screen with Playmaker

Post by somewhatsoftware »

I did use a prefab quest log window, but I completely unpacked it (in preparation of customizing it later), and as suggested, the Abandon Quest Confirmation panel and Abandon Quest Title were NOT assigned. I did assign them to the elements of the same name inside the prefab itself,

And still, the same thing happens, the Abandon Quest Confirmation panel is already opened when the Quest Log UI is opened. I'm at a loss as to why.

Alternately, I don't think I will need the Abandon Quest option in the final game (there ain't no quittin' in my game!) so perhaps I could just disable or unassign the Abandon Quest features? Would that cause an issue somewhere else in the asset?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Calling up Quest Log screen with Playmaker

Post by Tony Li »

Hi,

Are those UI elements assigned in the instance of the prefab in your scene?

Are there any errors or warnings in the Console window?

If not, then technically you can just delete the Abandon Quest Confirmation panel, or deactivate the panel GameObject. If you delete the panel, you'll get a helpful runtime warning "Dialogue System: Abandon Quest Panel is unassigned" but you can ignore it.
somewhatsoftware
Posts: 4
Joined: Fri May 28, 2021 11:37 am

Re: Calling up Quest Log screen with Playmaker

Post by somewhatsoftware »

I did not phrase it clearly earlier, my apologies.
I meant that when I dragged and dropped the Prefab, the Abandon Quest Confirmation Panel and Abandon Quest Title were NOT assigned in the Prefab itself. I unpacked the Prefab and assigned them correctly, but it did not fix the issue.

Deactivating all Abandon Quest related game objects did not fix the issue either. Whenever the Quest Log panel was called with 'Open' message, the Abandon Quest panel was somehow forcibly re-enabled and appeared over the Quest Log panel.

Deleting the Abandon Quest related game objects fixed the issue, with the negligible caveat that the console has a warning message every time the panel is opened, as you stated.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Calling up Quest Log screen with Playmaker

Post by Tony Li »

In which prefab are Abandon Quest Confirmation Panel and Abandon Quest Title not assigned?

I just checked both quest log window prefabs that ship with the Dialogue System -- Basic Standard UI Quest Log Window and Wheel Standard UI Quest Log Window -- and they're assigned.
Post Reply