I'm using Evi of Au's Item Stacking library because it was simpler and easier than any methods I thought of and I was in a hurry. So much for quick, though, eh? Anyway, the problem seems to be that no matter what I do the item within the banks contents does not increase, which seems to be the cause of the worse problem; I can't withdraw more than one item. It always registers as one item with no contents within it.
All the related code that you cannot find in the library is located below, but please do excuse how ugly it is. I really tore it up just getting it to work this much, and I haven't cleaned it up yet since the feature doesn't even work right. Plus this is not my strong suit since it somewhat involves lists.
Code:
var/obj/D = input("What would you like to deposit?","Deposit Item") in depositable
if(D.stackable == 1)
var/obj/citem
for(var/obj/i in usr.contents)
if(i.type == D.type)
citem = i
if(citem.contents.len > 0)
usr.DeleteItems(citem)
else
usr.contents -= D
D.suffix = "x1"
var/obj/citem2
for(var/obj/i2 in usr.bankeditems)
if(i2.name == D.name)
citem2 = i2
if(citem2 && citem2.name == D.name)
citem2.contents += D
citem2.suffix = "x[citem2.contents.len+1]"
world << "Citem contents = [citem2.contents.len+1]"
world << "Citem2 exists."
else
usr.bankeditems += D
D.suffix = "x1"
world << "Citem2 does not exist."
src.talkedto = 0
else
usr.contents -= D
usr.bankeditems += D
usr << "<b>Very well, you have deposited your [D.name]. Have a nice day.</b>"
src.talkedto = 0
withdraw_item()
set name = "Withdraw Item"
set category = null
set src in oview(1)
if(src.talkedto == 1)
return
src.talkedto = 1
if(usr.bankeditems.len > 0)
var/obj/W = input("What would you like to withdraw?","Withdraw Item") in usr.bankeditems
if(W.stackable == 1)
var/obj/citem
for(var/obj/i in usr.bankeditems)
if(i.type == W.type)
citem = i
if(citem && citem.contents.len > 0)
citem.contents -= W
usr.AddItems(W)
world << "Citem exists."
usr << "<b>Very well, you have withdrawn your [W.name]. Have a nice day.</b>"
else
usr.AddItems(W)
usr.bankeditems -= W
world << "Citem does not exist."
else
usr << "<b>Very well, you have withdrawn your [W.name]. Have a nice day.</b>"
usr.contents += W
usr.bankeditems -= W
src.talkedto = 0
else
usr << "<b>You don't have anything banked!</b>"
src.talkedto = 0
Then you can just search the contents of each individual item, then loop through those contents to access the amount of a particular object, and just remove them from the same object list as it's name. Hope this makes sense!