Easy Main Menu Inventory Integration

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 20668
Joined: Thu Jul 18, 2013 1:27 pm

Re: Easy Main Menu Inventory Integration

Post by Tony Li »

Hi,

Here's an example:

DS_EMM_Invector_Example_2019-09-13.unitypackage

Please read the _README.txt file and follow the instructions to set it up. The instruction steps are required. Otherwise the scenes will not run properly.

Then play MainMenu. Select START > NEW GAME > PLAY LEVEL to play the Invector test scene. This will load InvectorExample1.

In InvectorExample1, there is a scene portal to the left.

Image

Pick up some equipment first so you can confirm that the equipment carries to the next level. Then use the portal to SCENE 2. This will load InvectorExample2, which is an empty level with red lighting.

The _README.txt file explains how to set up your own scenes. If you have any questions, just let me know.
William618
Posts: 7
Joined: Thu Sep 12, 2019 3:11 am

Re: Easy Main Menu Inventory Integration

Post by William618 »

Hello,

Thank you so much! It works perfectly! With your example I could as well modify the EndScreen.cs script to make it work proprely with the Dialoag System Save System. I am happy because now I can go forward :D I will focus these days on the Dialog System and EMM. Anyway thanks again!
User avatar
Tony Li
Posts: 20668
Joined: Thu Jul 18, 2013 1:27 pm

Re: Easy Main Menu Inventory Integration

Post by Tony Li »

Glad to help! :-)
eldvbear
Posts: 9
Joined: Mon Aug 10, 2020 4:52 am
Location: Poughkeepsie, NY

Re: Easy Main Menu Inventory Integration

Post by eldvbear »

Have there been any updated regarding this system and the current version of the Invector inventory system? I have downloaded the example scenes in a clean template and followed the directions, but the inventory is not saving when crossing scenes. They recently did a big redesign for the inventory system and I am wondering if there may be compatibility issues with the new one.
User avatar
Tony Li
Posts: 20668
Joined: Thu Jul 18, 2013 1:27 pm

Re: Easy Main Menu Inventory Integration

Post by Tony Li »

Hi,

What version of Invector are you using?

General things to check:

- Scripting define symbol USE_INVECTOR_INVENTORY is defined.
- The player GameObject in both scenes has an InvectorInventorySaver with the same Key value (e.g., PlayerInventory).
- Any errors or warnings in the Console window?
- The EMM-specific changes have been made.
eldvbear
Posts: 9
Joined: Mon Aug 10, 2020 4:52 am
Location: Poughkeepsie, NY

Re: Easy Main Menu Inventory Integration

Post by eldvbear »

Hi there,

Thank you so much for your swift response.

I went back to the README instructions to make sure that I did follow all the directions necessary.

- I am using Invector TPC 2.5.3
- I did verify that USE_INVECTOR_INVENTORY is in my scripting define symbols.
- Both of the players have an Invector Inventory Saver attached with matching key values.
- I added the line to the loading screen script just below the #if PIXELCRUSHERS_SAVESYSTEM
if (PlayerPrefs.GetInt("usingPortal") == 1)...

I am getting an error when the example figure moves from Invector Example 1 to Invector Example 2 is:

NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.InvectorSupport.InvectorInventorySaver.ApplyData (System.String s) (at Assets/Pixel Crushers/Common/Third Party Support/Invector Support/Scripts/InvectorInventorySaver.cs:111)
PixelCrushers.SaveSystem.ApplySavedGameData (PixelCrushers.SavedGameData savedGameData) (at Assets/Plugins/Pixel Crushers/Common/Scripts/Save System/SaveSystem.cs:593)
UnityEngine.Debug:LogException(Exception)
PixelCrushers.SaveSystem:ApplySavedGameData(SavedGameData) (at Assets/Plugins/Pixel Crushers/Common/Scripts/Save System/SaveSystem.cs:598)
<ApplySaveData>d__3:MoveNext() (at Assets/Dialogue System Examples/EMM Invector Example/EMMScenePortal.cs:34)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

I am sure its probably some manner of operator error, but I'm not sure what I'm missing.

I would be immensely grateful for any guidance you can provide.

Thank you,

Ernesto
User avatar
Tony Li
Posts: 20668
Joined: Thu Jul 18, 2013 1:27 pm

Re: Easy Main Menu Inventory Integration

Post by Tony Li »

Hi Ernesto,

This is a common issue with Invector. Try setting the Save System component's Frames To Wait Before Apply Data to 2. Also make sure you the Invector Inventory Saver's Restore State On Start checkbox is UNticked. Invector needs a frame to initialize its inventory component.
eldvbear
Posts: 9
Joined: Mon Aug 10, 2020 4:52 am
Location: Poughkeepsie, NY

Re: Easy Main Menu Inventory Integration

Post by eldvbear »

Tony,

It worked!

Thank you so much for your help.

I have to say, that the customer support for Pixel Crushers is outstanding.
By far some of the best that I have encountered with using Unity assets.

I will certainly be purchasing more products from your company as need arises!

Thank you again,

Ernesto
User avatar
Tony Li
Posts: 20668
Joined: Thu Jul 18, 2013 1:27 pm

Re: Easy Main Menu Inventory Integration

Post by Tony Li »

Hi Ernesto,

Thanks! Glad to help.
Post Reply