ID:266726
 
Ok, I'm a little confused on how to make numbers on the side of an item you have more then one of instead of it showing two of the same things.
Spuzzum has a good grouping demo.
In response to Sariat
Thanks it worked-sort of. There is a small problem though. I wanted to give the user 5 arrows instead it gave him 20. Do you know why.
In response to Strange Kidd
Because you used the number 20 instead of 5. Try changing it to that. That, or you gave them 5 arrows 4 times. Make sure your numbers are correct.
In response to Garthor
Ok, that problem was fixed now I have one more. I have a var called arrows. But when I pick up an arrow it dosn't add to the var. Or subtract when I drop it.
In response to Strange Kidd
obj/arrow/verb
Get()
set src in oview(1)
usr.Arrows += 5
del(src)
Drop()
usr.Arrows -= 5
new obj/arrow(usr.loc)

Ok, so that wouldn't work, but you get the idea, I hope.
In response to Garthor
No there is a problem with that because what if the user pics up more then 5...
In response to Strange Kidd
The problem is that the number of arrows is stored as a var, and I'm applying the drop verb to the object arrows, which never goes into your contents, unless if you keep an arrow in your inventory.
In response to Strange Kidd
It would just keep on adding 5! There is no problem with it. Now, here is a complete system for picking up and dropping any number of arrows:
arrow
parent_type = /obj
var
count = 0
proc
calibrate()
if(count <= 0) del src
else if(count == 1) name = "an arrow"
else name = "some arrows"
drop()
set name = "Drop arrow"
set src in usr
var/arrow/A = new /arrow (src.loc)
var/dropcount = input("How many to drop?") as num
if(src.count < dropcount)
src << "You do not have that many arrows."
return
A.count = dropcount
src.count -= dropcount
A.calibrate()
src << "You drop [A.name]."
if(src.count == 0)
src.verbs -= /arrow/proc/drop
New()
calibrate()
..()
verb/pickUp()
set name = "Get arrow"
set src in oview(2)
usr.count += src.count
usr << "You pick up [src.name]"
usr.verbs += /arrow/proc/drop
del src
obj/arrow_obj
icon = 'weapon.dmi'
icon_state = "arrow"
name = "Arrows"
mob
var
count = 0
obj/arrow_obj
New()
..()
arrow_obj = new /obj/arrow_obj
Stat()
if(count)
statpanel("Arrows")
stat(arrow_obj,count)<dm>