I want to make my own Item Stacking system, i wanted to know if it be bad to store the items into variables to have them stack. therefore i can choose what items i want to stack in the map and what not to.
ok in editor you can make charged classification for stacking item if u want stack them
or if u want different max stack to different charged item type then you can use variable or hashtable
variation1:
- if u use variable then the index must be the item level so then every stackable item on your map must have different item level, so cant be 2 stackable item with same item level then u can store only max charged amount to variable like this (Max_Charge is integer variable array)
Max_Charge[item level] = max stack what u want for that item what got same item level than your array index
so example if hp potion is level 1200 and u want max 99 stack then Max_Charge[1200] = 99
- if u dont need item level to other thing then u can use that for detect the max charge, so if item is charged then u just check item level so if u want for hp potion max 12 then potion item level could be 12 and when u pick potion u just check if in invetory u got potion what got less than 12 charge and add to it, else add normally
- use hashtable (at map init u declare the max stack to each item type)
key1: item type key2: 0 saved value:max stack