InControl Intergration Help

CruttMutt

Member
Hello!

I have a lovely little inventory system going on and in general, it all works very well with controller support.

I have a couple of questions that I will inevitably need to tend to though to smoothen the integration.

1) Is there a way to disable to mouse cursor pop up when opening menus? Or have I missed something in a component? Hopefully, this one is pretty easy. In the docs I got the hint it was saying by doing it on my player input that should work? I have "Disable Cursor" selected and it works fine for my UCC on game launch and everything else but if I open the inventory or a shop the cursor always comes up. Otherwise, the controls work okay. Except... (question 2....)

2) When I open a shop not using "Auto Interact", which unfortunately really doesn't work for my game it will open the menu but already have the first item on the list, up to the quantity selection selected. If I hit back/cancel it reverts to working fine quick enough but obviously looks and feels quite rough around the edges. Strangely enough, I also get a weird error involving what looks like is an InControl issue which only comes up if I A) use the controller to instigate the shop and B) Don't use Auto Interact". So I am hoping by resolving the first part will tie that one up because it seems to be working fine using a keyboard or auto interact. Or maybe it's the other way around and this is the issue altogether... specifically it says (sorry it's long and I feel awful posting it but I can't find what instance or object it's referring to!):

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.Exchange.CurrencyCollection.PotentialQuotientFor (Opsive.UltimateInventorySystem.Exchange.CurrencyCollection other) (at Assets/Opsive/UltimateInventorySystem/Scripts/Exchange/CurrencyCollection.cs:1313)
Opsive.UltimateInventorySystem.Exchange.CurrencyOwner.PotentialQuotientFor (Opsive.UltimateInventorySystem.Exchange.CurrencyCollection amount) (at Assets/Opsive/UltimateInventorySystem/Scripts/Exchange/CurrencyOwner.cs:108)
Opsive.UltimateInventorySystem.UI.Menus.Shop.ShopMenu.OnItemSelected (Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotEventData slotEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Menus/Shop/ShopMenu.cs:310)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase+<>c__DisplayClass63_0.<Initialize>b__1 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:205)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton.OnSelect (UnityEngine.EventSystems.BaseEventData eventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:255)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot.OnSelect (UnityEngine.EventSystems.BaseEventData eventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlot.cs:103)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISelectHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2019.4.21f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:106)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity/Hub/Editor/2019.4.21f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:SetSelectedGameObject(GameObject)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnPointerEnter(PointerEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:160)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot:OnPointerEnter(PointerEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlot.cs:166)
UnityEngine.EventSystems.PointerInputModule:processMove(PointerEventData)
InControl.InControlInputModule:processMove(PointerEventData) (at Assets/InControl/Source/GUI/InControlInputModule.cs:285)
InControl.InControlInputModule:processMouseEvent(Int32) (at Assets/InControl/Source/GUI/InControlInputModule.cs:678)
InControl.InControlInputModule:processMouseEvent() (at Assets/InControl/Source/GUI/InControlInputModule.cs:667)
InControl.InControlInputModule:process() (at Assets/InControl/Source/GUI/InControlInputModule.cs:185)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.4.21f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)

Hope you can help!

Cheers for the great asset. After this, I have a really lovely system running.

PS: Ah I have no idea how to not make it do emojies there!! Sorry.....
 
1) For the cursor issue, make sure you are using the latest versions of UCC/UIS and the integration version (we made an update yesterday).
Then you can set that the cursor hides/shows with the Unity Input on the character and the Display Panel Manager Handler on the Canvas

2) The error seems to indicate that you are missing a price value on the item. Maybe you are not referring to the correct attribute name for buy and sell price? Or it's not the right type?

Before the error do you get a warning saying something like this?
"Was unable to find the {buySell} price for item:

As for the panel opening and selecting the item to buy automatically seems off. Perhaps the input to open the panel gets hit twice? Perhaps the button to open the panel and the one to select an item is the same and the panel and button both get clicked in the same frame?

If the issue is the second, I'll have to dig in the code to see if there's any way to prevent that.
 
Thank you! I will try these out and let you know how I go. I will start with updating. Thanks for the heads up on that!

What I can tell you now is that at this point, what I sent you in the error is the only error or warning I have in the game at all. I've been very good at making everything by the book so it's odd, and it only happens when I use the controller, funnily enough, otherwise, it's fine. Works well regardless of the error too. I will see if updating helps, or if somehow these things are related.

The panel opening buttons and the "action" button to open the shop menu are in fact the same.

Thanks a lot!
 
Whoa.. Okay well this whole update has made me go from no errors to I can't even figure out what is going on... Are there some decent instructions anywhere to go over what I am supposed to change? I can play but everything is gone.... I can't even see my character anymore.
 
If you are only using the Inventory system, the update shouldn't have changed much, only small bug fixes.

All the changes are mentioned here:

Make sure to double check the package version within our own Editors, sometimes the package manager says you have a new version when that's not the case (read more about that in the second paragraph of the release notes)

Or are you also using one of our character controllers with the character/inventory integration? If that's the case, there has been a lot of changes. Everything is detailed here, make sure to go through it in detail since it works differently from before (you'll need every package with the latest version):

Just to make sure, you didn't build your project from inside the Opsive folder right? Anything inside our folders will be overriden whenever there is an update. That's the case for all Unity Assets/Packages.

Also, I hope you made a backup of your project. You should always backup your work before upgrading a package.

I hope you'll be able to get things working again soon. And I am sorry if this update has caused any issues
 
Yes, I actually have everything opsive integrated so looks like I'm in for a bit of a nightmare... I have a few things working but some big issues. I did back up of course thanks. Currently, I have it running but the character/camera won't stop moving when the inventory opens and the equippable weapons no longer work so I need to figure it out. Trying to follow the guide but currently no luck. I am just hoping I don't have to build all my items again. Luckily for me I took the time to build everything from scratch so my inventory menus and all that is fine. I don't use any demo files. I'm sure all the updates are great so worth figuring out but I'll be stuck here for a bit.

I suppose I will get back when things are working if I figure it all out. If you have any tips on converting old item weapon prefabs to the new system or why the menu does not stop the character/camera control feel free to let me know! haha.
 
For the Menu not stopping the character input check the end of the integration page, the section about UI. It mentions how to disable input while panels are opened.

All the tips should be part of the documentation I linked above in the "Upgrading v1.X to V2.0".

For the Equippable Items, you'll need to create a new Item Set Rule Object that defines how the items should be equipped. Example Blade+Shield, or Gun, etc... Refer to the demo scene if want an example.
Also make sure the Item prefabs don't have the "Unique Item Set" toggled on and the Item Pickups don't have item sets, use the new Item Set Rule system instead is way more flexible and scalable.

If you find anything else that I forgot to mention in the documentation or that is not clear, let me know and I'll add/change it.
 
Thanks so much for the post responses! I will try and sort all of these tonight and hopefully be able to report back on the success of my previous post requests ?

Cheers!
 
Top