Cheo
Active member
Hello, I was watching the first tutorial video for UIS named "Basic Concepts" this morning and tried duplicating the demo inventory database as shown in the video, but when pressing play in a duplicate of the demo scene using the duplicate of the inventory database I stumbled upon an error related to a "Wand" object :
4 more errors related to Iron Sword and Knight Armor can be thrown when selecting "Duplicate all referenced prefabs" when duplicating the database :
Here is a video showing all this, I also took the time to double check in a fresh project and confirm it happened in it as well :
As I say in the video, it's a bit annoying because we can't reproduce what is shown at the end of the tutorial video, even though the duplication process is quite fast and simple and should allow different databases to work seamlessly across different scenes. Hope this was useful and that the issue can be fixed. Thanks in advance.
Code:
[Error] The object "Wand" with ID 1356961972 is not part of the active database. Please run the 'Replace Database Objects' script by right-clicking on the folder with the affected prefabs, scriptable objects, or scenes.
Opsive.UltimateInventorySystem.Core.ObjectCategoryBase`2<Opsive.UltimateInventorySystem.Core.ItemCategory, Opsive.UltimateInventorySystem.Core.ItemDefinition>.InherentlyContains() at /Opsive/UltimateInventorySystem/Scripts/Core/ObjectCategoryBase.cs:499
497: {
498: if (IsInitialized == false) {
--> 499: Debug.LogError($"The object \"{this}\" with ID {m_ID} is not part of the active database. " +
500: $"Please run the 'Replace Database Objects' script by right-clicking on the folder with the affected prefabs, scriptable objects, or scenes.");
501: return false;
ItemCategory.InherentlyContains() at /Opsive/UltimateInventorySystem/Scripts/Core/ItemCategory.cs:1045
1043: public bool InherentlyContains(ItemDefinitionBase itemDefinition, bool includeThis = true)
1044: {
-->1045: return base.InherentlyContains(itemDefinition as ItemDefinition, includeThis);
1046: }
ItemCategory.InherentlyContains() at /Opsive/UltimateInventorySystem/Scripts/Core/ItemCategory.cs:1004
1002: public bool InherentlyContains(Item item, bool includeThis = true)
1003: {
-->1004: return InherentlyContains(item?.ItemDefinition, includeThis);
1005: }
ItemBinding.SetItem() at /Opsive/UltimateInventorySystem/Scripts/Core/ItemBinding.cs:197
195: }
--> 197: if (m_ItemCategory.InherentlyContains(item) == false) {
198: Debug.LogWarning($"The item specified ({item}) does not match item category that was set on the binding ({m_ItemCategory}).");
199: m_Item = null;
ItemBinding.SetItemObject() at /Opsive/UltimateInventorySystem/Scripts/Core/ItemBinding.cs:106
105: EventHandler.RegisterEvent(m_ItemObject, EventNames.c_ItemObject_OnItemChanged, SetItem);
--> 106: SetItem(m_ItemObject.Item);
107: }
ItemBinding.Start() at /Opsive/UltimateInventorySystem/Scripts/Core/ItemBinding.cs:73
71: var itemObject = GetComponent<ItemObject>();
72: if (itemObject != null) {
--> 73: SetItemObject(itemObject);
74: }
75: if (m_ItemObject != null) { return; }
4 more errors related to Iron Sword and Knight Armor can be thrown when selecting "Duplicate all referenced prefabs" when duplicating the database :
Code:
[Error] The Prefab attribute value is null, please assign a default value or in the attribute, make sure the item Knight Armor (2502941901) has a non-null value for attribute: PickupPrefab.
ItemVisualizerBase.SetVisualInternal() at /Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemVisualizerBase.cs:145
144: if (prefab == null) {
--> 145: Debug.LogError($"The Prefab attribute value is null, please assign a default value or " +
146: $"in the attribute, make sure the item {item} has a non-null value " +
147: $"for attribute: {m_PrefabAttributeName}.");
ItemVisualizerBase.UpdateVisual() at /Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemVisualizerBase.cs:89
87: }
--> 89: SetVisualInternal(itemInfo);
90: }
ItemObjectVisualizer.UpdateVisual() at /Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemObjectVisualizer.cs:55
53: return;
54: }
--> 55: UpdateVisual(m_ItemObject.ItemInfo);
56: }
ItemVisualizerBase.OnEnable() at /Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemVisualizerBase.cs:74
72: protected virtual void OnEnable()
73: {
--> 74: UpdateVisual();
75: }
ItemObjectVisualizer.OnEnable() at /Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemObjectVisualizer.cs:46
44: }
--> 46: base.OnEnable();
47: }
Here is a video showing all this, I also took the time to double check in a fresh project and confirm it happened in it as well :
As I say in the video, it's a bit annoying because we can't reproduce what is shown at the end of the tutorial video, even though the duplication process is quite fast and simple and should allow different databases to work seamlessly across different scenes. Hope this was useful and that the issue can be fixed. Thanks in advance.