(Not Solved) Mathmatical tools on child variables

Hi Developers :slight_smile:,
i wanted to make an inventory using structure variables, the parent shall be called Inventory
and per each item i will have Variable(Inventory.Item1) as quantity created when the player collide with item1 and so on for item2 and item3.
if i want to get the arrangement of them from max to minimum to display on inventories (0 would be blank).
i want a way instead of writing max(Variable(inventory.item1),Variable(Inventory.item2)).
i was thinking of max(Variable(inventory)) as the parent but it didnt work.

if some one can help me would be apperciated.

Thanks

I don’t know if it’s the best way to do it, but I think you could do it with a repeat loop.

set (id1) = 0; set (id2) = 1
Repeat X times, where X is the total number of inventory item slots
{{
if item(id1) < item(id2) set item(id2) inventory_slot(id1)
add 1 (id2)
}
set (id2) = 0
add 1 (id1)
}
Not sure if that’s completely clear, it’s really late here and I should be in bed lol. Hopefully it helps :slight_smile: zzz

Thanks fitkoh much apperciated.

actually i dont write in java yet :(, however you gave me a good idea of using item{number}, although i will have to link each item number with item name.

it still sounds hard :frowning:
Ahmed

Why you don’t use inventory system?

its lagged in huge numbers , like buying 50000 meds :slight_smile:
Ahmed