ID:145079
 
Problem description:
Well, I don't have any code for this problem, but I do know exactly what it is I need. My inventory system uses the Move() function to place things in the inventory. Which works great for articles of clothing and other things. I am having trouble figuring out what I should do about making it to where if you have more then one of something it adds to the number of that certain object and does not add the object again to the inventory. I know how to add to the number of objects, but I am having a little trouble exempting the objects I don't want to add again.
Here is a basic setup of how I would move things into the sources inventory[].

if(src.Move(usr))
usr<<"You picked up [src.name]"
if(src.name=="bomb")
usr.bombamount+=1
src.suffix="x[usr.bombamount]"
Ok, just adding onto your code, here's what you could do.
Replace BOMB_TYPE with the type path for bombs.
if(src.name=="bomb")
usr.bombamount+=1
var/obj/O= locate(BOMB_TYPE) in usr.contents //Find any bombs in your pack.
if(!O) //If it didn't find any bombs
O=new BOMB_TYPE (usr) //Create a new one.
O.suffix="x[usr.bombamount]" //Change that object's suffix.
del(src) //Now get rid of this
if(src.Move(usr))
usr<<"You picked up [src.name]"

By doing the if() first, calling del(src) will delete the object. That will stop the procedure, so it won't move it to usr's contents.

I would suggest giving the objects the "amount" variable, but it's not necessary. Giving the objects the amount variable allows you to have multiple stacking items. However to check if that item stacks, you'd have to do: if(src.isStackable) [instead of if(src.name=="bomb")] and create a variable for objects called isStackable so you know what items stack.

~Jack
In response to JackGuy
Thanks alot man, I appreciate it. This helps a great deal!