Page 1 of 2
Update quest log after acquired quest item
Posted: Sat Oct 12, 2024 6:13 pm
by aragu0529
Hello,
I have a quest that npc asking for something from the store. And my items are scriptable objects that only load in inventory or the shop. I figured out how to let get the item count in the conversation with custom Lua codes. But the quest log is not updating after I acquired quest item in the inventory. Is there a way let the system check the quest item in the inventory?
Thank you
Re: Update quest log after acquired quest item
Posted: Sat Oct 12, 2024 8:09 pm
by Tony Li
Hi,
After acquiring the item, call DialogueManager.SendUpdateTracker(). This will send an UpdateTracker() message to the relevant quest UIs (quest tracker HUD and quest log window).
Re: Update quest log after acquired quest item
Posted: Sat Oct 12, 2024 10:01 pm
by aragu0529
Sorry, could you please be more specific, where do I call this method from?
Re: Update quest log after acquired quest item
Posted: Sat Oct 12, 2024 10:26 pm
by Tony Li
You mentioned Lua, so I assume your quest description or a quest entry has some text like:
Code: Select all
[lua(GetItemCount("apple"))] / 3 Apples Picked
and you've registered your own inventory function GetItemCount(). If so, then when the player acquires or loses an item, call this in the same code that updates your inventory:
Code: Select all
PixelCrushers.DialogueSystem.DialogueManager.SendUpdateTracker();
Re: Update quest log after acquired quest item
Posted: Mon Oct 14, 2024 11:43 pm
by aragu0529
Thank you its working now!
Re: Update quest log after acquired quest item
Posted: Tue Oct 15, 2024 7:58 am
by Tony Li
Glad to help!
Re: Update quest log after acquired quest item
Posted: Wed Oct 16, 2024 10:05 pm
by aragu0529
Hello,
I have a new question. So there is a save system comes with the dialogue system can I use it as save and load system for game?
Does it save inventory and player and NPC stats etc? If so how do I make it save inventory or how to tell the system to save the data that needed to be saved?
Thank you
Re: Update quest log after acquired quest item
Posted: Wed Oct 16, 2024 10:14 pm
by Tony Li
Hi,
It's a general purpose save system. See here for more info:
Save System
It works by using "saver" components such as PositionSaver to save a GameObject's position, AnimatorSaver to save an animator state, ActiveSaver to save a GameObject's active/inactive state, etc.
You can also write your own savers:
How To: Write Custom Savers
Many of the integrations also come with saver components, such as components to save Inventory Engine inventories, UIS inventories, etc.
Re: Update quest log after acquired quest item
Posted: Fri Oct 18, 2024 1:40 am
by aragu0529
So I have a main menu and I created a load panel with slots, and I attached Save System Methods to the slot button. And on Click I drag the save system methods component in and select SaveSystemMehtods.LoadFromSlot. set the slot index to 0. Then I created a save panel in main game, then attached the SaveSystemMehtods.SaveSlot, set the index to 0. However when I start the game, made some changes then save the game, and went back to the main menu to click on that load slot button. Nothing is happening. Do you know where am I doing wrong?
Thank you.
Re: Update quest log after acquired quest item
Posted: Fri Oct 18, 2024 12:45 pm
by Tony Li
Hi,
That sounds correct so far. Make sure that in the Button's OnClick() UnityEvent you've assigned the SaveSystemMethods component that you've added to the button, not the SaveSystemMethods.cs script.
Are there any errors or warnings in the Console window?
BTW, there's also a free Menu Framework addon available on the Dialogue System Extras page.