stack overflow in "ItemActionSetAttribute"

moondo

New member
StackOverflowException: The requested operation caused a stack overflow.
System.String.op_Inequality (System.String a, System.String b) (at <9aad1b3a47484d63ba2b3985692d80e9>:0)
Opsive.UltimateInventorySystem.Core.AttributeSystem.AttributeCollection.TryGetAttribute (System.String attributeName, Opsive.UltimateInventorySystem.Core.AttributeSystem.AttributeBase& attribute) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/AttributeSystem/AttributeCollection.cs:390)
Opsive.UltimateInventorySystem.Core.AttributeSystem.AttributeCollection.GetAttribute[T] (System.String attributeName) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/AttributeSystem/AttributeCollection.cs:408)
Opsive.UltimateInventorySystem.Core.ItemDefinition.GetAttribute[T] (System.String attributeName, System.Boolean includeCategoryAttributes) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/ItemDefinition.cs:863)
Opsive.UltimateInventorySystem.Core.Item.GetAttribute[T] (System.String attributeName, System.Boolean includeItemDefinitionAttributes, System.Boolean includeCategoryAttributes) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/Item.cs:645)
Opsive.UltimateInventorySystem.ItemActions.UseItemActionSetAttribute.IsItemCooldownInCooldown (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/UseItemActionSetAttribute.cs:78)
Opsive.UltimateInventorySystem.ItemActions.UseItemActionSetAttribute.CanInvokeInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/UseItemActionSetAttribute.cs:57)
Opsive.UltimateInventorySystem.ItemActions.ItemAction.CanInvoke (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:59)
Opsive.UltimateInventorySystem.ItemActions.ItemAction.InvokeAction (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:95)
Opsive.UltimateInventorySystem.ItemActions.UseItemActionSetAttribute.InvokeActionInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/UseItemActionSetAttribute.cs:101)
Opsive.UltimateInventorySystem.ItemActions.ItemAction.InvokeAction (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:97)


Hi!

StackOverflow when UseAction is active in the inventory.

캡처.PNG



I don't know how to use this action

I need an example :(
 
You are getting a stack overflow because you are calling an action that is calling itself, and it does so in a loop until the stack overflow error.

The Use ItemAction allows you to call an item Action on your item set as an Attribute.

In your screenshot I can see that you've set the Use_0_ItemActionSet as the attribute. Instead you should be setting the ItemAction you want for that Consumable Item. So perhaps, Consume, Heal, etc... not Use again.

The Use Action is the one you'll set in the UI. This way all your items will have a single "Use" action but the effect will be different for each item if you want to, since you can set the action in the ItemDefinition attribute.
 
Top