InventoryPro and Dialogue System Integration error

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

InventoryPro and Dialogue System Integration error

Post by ricjonsu098 »

Hello, I think I'm gonna ask this although I don't think that this is applicable in this forum

Code: Select all

Dialogue System: Lua code 'AddItem("0",1);
Variable["Alert"] = "You've got a Java Tutorial!"' threw exception 'Exception has been thrown by the target of an invocation.'
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry)
PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle(Object, EventArgs)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle()
PixelCrushers.DialogueSystem.ConversationView:OnConversationContinue()
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
UnityEngine.Component:SendMessage(String, SendMessageOptions) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\UnityEngineComponentBindings.gen.cs:232)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinue()
PixelCrushers.DialogueSystem.UnityUIDialogueUI:OnContinue() (at C:\Users\Khayyy\Documents\LATEST NA LATEST - with TPCT\FINAL DEF NA TALAGA\Assets\Dialogue System\Scripts\Supplemental\UI\Dialogue UI\UnityUIDialogueUI.cs:171)
PixelCrushers.DialogueSystem.UnityUIContinueButtonFastForward:OnFastForward() (at C:\Users\Khayyy\Documents\LATEST NA LATEST - with TPCT\FINAL DEF NA TALAGA\Assets\Dialogue System\Scripts\Supplemental\UI\Effects\UnityUIContinueButtonFastForward.cs:32)
UnityEngine.Events.InvokableCall:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:144)
UnityEngine.Events.InvokableCallList:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:621)
UnityEngine.Events.UnityEventBase:Invoke(Object[]) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:756)
UnityEngine.Events.UnityEvent:Invoke() (at C:\buildslave\unity\build\Runtime\Export\UnityEvent_0.cs:53)
UnityEngine.UI.Button:Press() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:35)
UnityEngine.UI.Button:OnPointerClick(PointerEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:269)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:529)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:428)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:416)
UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:190)
UnityEngine.EventSystems.EventSystem:Update() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\EventSystem.cs:277)
I have this error when adding item thru dialogue. I have a hunch that this is a dll problem. (Got too many assets on my project because my designer just keeps importing assets when she is designing the game)

But maybe not, if it's not a dll problem, do you guys have any idea? Thanks
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: InventoryPro and Dialogue System Integration error

Post by Tony Li »

Hi,

Make sure you've added an Inventory Manager Dialogue System component to your Inventory Pro _Managers GameObject. This makes the AddItem() Lua function available to the Dialogue System.

More info: http://devdog.io/unity-assets/inventory ... ng-started

If _Managers already has this component, then the item ID may need to be different. Take a look at Inventory Pro's demo scene for the Dialogue System for an example.
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

Re: InventoryPro and Dialogue System Integration error

Post by ricjonsu098 »

I forgot to mention that it works fine on editor but when the game is built, it shows the error.

EDIT: Found the error, apparently, putting separate dialogue manager into different scene causes the error. Fixed now
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: InventoryPro and Dialogue System Integration error

Post by Tony Li »

I'll ask Joris to fix this, since he wrote and maintains the Inventory Pro integration scripts. The Inventory Manager Dialogue System script currently registers itself when it starts, but it should also clean up after itself by unregistering when it's destroyed.
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

Re: InventoryPro and Dialogue System Integration error

Post by ricjonsu098 »

Hello I decided to reply in here instead of creating a new thread as the topic is still related to inventory pro

How can I save the state of inventory? Do you have any idea?

Because I have an NPC that will give the player an item when the player talks to it. When I saved the game (still using the menu extra), and load the saved game without exiting the game, the item is in the inventory. But when I tried to load the saved game given that I exited (stopped play mode or exiting the app in the built game) the game once, the item is not in the inventory anymore.

Any ideas? Or this falls into the developer of the Inventory Pro? thanks!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: InventoryPro and Dialogue System Integration error

Post by Tony Li »

Hi,

Add a DialogueSystemCollectionSaverLoader component to every collection that you want to save.

For example, in Inventory Pro's Dialogue System demo scene, you can find this component on Canvas > InventoryWindow2, which is the player's inventory collection.
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

Re: InventoryPro and Dialogue System Integration error

Post by ricjonsu098 »

Thank you so much you saved me :D I thought I was screwed
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: InventoryPro and Dialogue System Integration error

Post by Tony Li »

Happy to help! If you're every worried that you're screwed about something Dialogue System-related, let me know. A solution probably already exists that I can point you to, and if it doesn't I'll do my best to provide one.
Post Reply