Bug with Custom Random Item Dropper - All Attributes of item from same type get the same value

Saint

New member
Hello,

I just implemented this solution:

It works good but when I trigger an item drop, all items of the dropped type get their Attribute updated to the same value.
The IDs of the items are different.

Setup of my enemy
1656583074513.png

Enemys inventory:
1656583103409.png

The items Axe and Sword are unique and mutable by their category: 1656583285455.png

The Drop() function is called from a custom health script.
In start() : crd = gameObject.GetComponent<CustomRandomDropper>();
In kill(): crd.Drop();

Sword from scene before triggering the drop has ID: 4261020585, Rarity: Rare, BaseAttack: 10
Sword from scene after triggering drop: ID: 4261020585, Rarity: Common, BaseAttack: 1
Sword that got dropped: ID: 906641182, Rarity: Commin, BaseAttack: 1

Also the items get dropped in stacks, so if I set Min Amount of 5 and Max Amount of 10, there will only be 2 items dropped with the total amount of 5-10, so for example 3 swords in a Stack and 2 Axes in a stack. I expected 5 unique item drops with different values.
 
After a fair amount of testing I was unable to reproduce this issue in my project.

It has been awhile since the last update so it could be that this issue was fixed since then.

I made a new feature scene for Droppers and added a simpler version of the custom Dropper that works with the demo database in there for testing.
I refactored quite a bit of the Droppers source code to improve how items are dropped, allowing unique items to be dropped seperatly.

Unfortunatly that's too many changes, so I cannot share them with you here. You will need to wait for the next update. There are no plans for an update soon, but considering the issue I'll see if I can make an update sooner rather than later.

(Your custom dropper won't work properly after the update, so make sure to rewrite it, I'll update the documentation after the update)


EDIT: Wait!? Is it possible that you've set the Attack attribute as an ItemDefinition attribute instead of an Item Attribute.... that would explain why it is shared between all items. I should have thought of that before going down this rabbit whole...
 
Those changes sound awesome! Im in no hurry, got lots of other stuff to do so I can wait for the changes.
I used the demo database and duplicated it, I indeed have the BaseAttack Attribute under the Item Definition Attributes list.
I didn't understand what that means, sorry.

Gonna change all that to the Default Item Attributes now.
 
It is very important you understand the difference.
I'd recommend you read the getting started section for attributes again:
It explains the difference clearly

You can rewatch the basic concepts video too perhaps that helps:
 
Top