Saving Items

Announcements, support questions, and discussion for the Dialogue System.
Muff
Posts: 20
Joined: Sat Mar 04, 2023 11:49 am

Saving Items

Post by Muff »

Hi im using invector and DS_InvectorMenuFramework, and i added define symbol which is the USE_INVECTOR_INVENTORY and i untick the Don't Destroy On Load to the Inventory_ShooterMelee and follow all of the instructions base to the Invector Third Person Controller Support.

And i have some issues with it, why the item vanished when i click continue. btw that item came from the npc.
Thankyouuu!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving Items

Post by Tony Li »

Hi,

Things to check:
  • Player GameObject (vShooterMelee_Inventory) has a Dialogue System Invector Bridge, Invector Stats Saver, and Invector Inventory Saver.
  • Both Saver components have unique Key values (e.g., "playerStats" and "playerInventory").
  • Make sure there are no errors or warnings in the Console window.
  • On GameObject with Save System component, tick Debug checkboxes on Save System and PlayerPrefs Saved Game Data Storer components. When saving game, check Console output. Make sure it contains the key value you assigned to the Invector Inventory Saver.
Muff
Posts: 20
Joined: Sat Mar 04, 2023 11:49 am

Re: Saving Items

Post by Muff »

Hi, i figured it out but it only works when i automatically stop the game to the editor and play it again the item still there.

but i want in my game that if user click quit to main menu and continue the game the item must be in the inventory.
and i added a SaveHelper.QuickSave to the QuitToMenuConfirm but doesn't work.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving Items

Post by Tony Li »

You shouldn't need to do anything different. Here's an example:

DS_MenuFrameworkExample_Invector_2021-11-27.unitypackage

I recommend importing it into a new, empty project in which you've imported the Dialogue System, Menu Framework, and Invector, and set USE_INVECTOR_INVENTORY. Add all 4 scenes to scenes to the project's build settings, and play scene 0.
Muff
Posts: 20
Joined: Sat Mar 04, 2023 11:49 am

Re: Saving Items

Post by Muff »

Hi yes i already tried that and the item only saved, if i save it on slot button :--(

I want on my game is when i click to quitmenuconfirm the item must save on inventory even i continue the game.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving Items

Post by Tony Li »

It sounds like you want the Quit To Menu button to save the game. If that's so, you can configure its OnClick() event to call the SaveHelper component method to save the game, or SaveSystemMethods.SaveToSlot.
Muff
Posts: 20
Joined: Sat Mar 04, 2023 11:49 am

Re: Saving Items

Post by Muff »

I tried but it doesn't work. Even the savehelper or SaveSystemMethods.Saveslot
Only SaveGamePanel can save an item :--(



https://drive.google.com/file/d/1Cmy0rO ... sp=sharing
https://drive.google.com/file/d/1FPu-V5 ... sp=sharing
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving Items

Post by Tony Li »

Try moving SaveHelper.QuickSave to above SaveHelper.ReturnToTitleMenu in the OnClick() event list. It must run before you call SaveHelper.ReturnToTitleMenu, since SaveHelper.ReturnToTitleMenu will reset the data.

The Unity editor will not let you drag SaveHelper.QuickSave up, so you will have to delete the SaveHelper.ReturnToTitleMenu and SaveHelper.QuickSave elements from OnClick() and re-add them.
Muff
Posts: 20
Joined: Sat Mar 04, 2023 11:49 am

Re: Saving Items

Post by Muff »

Hi, i already tried but doesn't work :---(

https://drive.google.com/file/d/102xBWA ... sp=sharing
Muff
Posts: 20
Joined: Sat Mar 04, 2023 11:49 am

Re: Saving Items

Post by Muff »

Hi Tony, i tried everything seems the SaveGamePanel are only can save an item. :(

Here's the list that i tried:
*I modified the Savehelper.cs where i set the "public bool resetGameOnReturnToTitle = false;"
* I replace QuittoMenuConfirm onClick and tried all Savehelper that has a "Save" word.
* I replace Continue onClick, i tried All Savehelper that has a "Load" word.

* I Added SaveGamePanel component to QuitToMenuPanel and i attach the QuittoMenuConfirm button as a slot to the SaveGamePanel component and added a onclick to the QuitToMenuConfirm button which is the SaveGamePanel.SelectSlot (0)
* I modified SaveGamePanel.cs, Where SelectSlot had a ConfirmSave() and i try to attach a Savesystem.Loadscene that came from to ReturnToTitleMenu() Savehelper.cs
Post Reply