Unique items with different stats - how to implement?

Can someone, please tell me how variables are structured and handled in case of a different-stats entities of the (initially) same kind?
For exaple - In games like “Xcom”, “Disgaea” and “Darkest dungeon” there’s a such thing as a recruitable soldiers - we buy them as “items”, they stored in “inventory”, but they are independent (as far as i understand) entities with their own personal stats. (Strenght, Speed, Health etc.)
They are get their level-ups and ubgrades independently from each other.
Or - in some games we can upgrade/level up equipment. Or put attachments into slots.
Or even - when we have in inventory three same pistols with different quantity of ammo left in theirs magazines.
I’m not asking for detailed “do this and do that” instruction (although, i would be glad to).
All i want - to know the “main theory” behind those mechanics.

Posting a links to some other’s publications on some other sites will be fine too (even if it will be about other engines and programming languages).

Once again - i know, how inventory works, and how STANDART, multiple items of the same kind are stored there.
I don’t know, how UNIQUE items stored there.
So, please - explain me.

Thanks in advance!

—!!! Update !!!—
I’ve got a very satysfying answer for my question, but i’m not gonna mark this topic as “solved”, because i would be glad to see more information. If someone wants to say something different, or say something extra, or just give an advice - you’re welcome!
Feel free to share your knowledge. Your opinion on this topic is highly appreciated.

Variables will be your place holder for all values.
Double click on any object in your objects drop down list and click the variable tab to add variables. These will be your Object specific variables.
If you have a Hat object and it has a variable for defense.
On some condition - let’s say boss1 is defeated
Action(s) -Create object Hat -Change number variable defense RandomInRange(1,10)
This will give you a value of 1,2,3,4,5,6,7,8,9, or 10 on your Hat.
Do this twice you will have 2 separate instances of Hat, and most of the time (roughly 90%) they will have different defense values.

To implement the value, you just need to pick a specific hat and add that value to your character stats.
If you have an equip screen. You could do something like Hat is overlapping ‘HeadSlot’, then Change the variable defense: of MainCharacter: add Hat.Variable(defense)

1 Like

Thank you very much! That was helpful!
I think, i start to understand.

1 Like