ID:177638
 
Jake here with a little problem.
I am almost to completion with TextMudPuddle but I have a wall infront of meh.

I need to make a verb that can add and delete items into the inventory stat bar.

Also im stuck at how the host can make thier own vars on the stat menu.

Please Help me climb this wall.
Ok, adding to the inventory stat. Im assuming that your inventory list is called inventory, and that your items are obj's.

obj
item
icon = 'item.dmi'

mob
Stat()
stat(usr.inventory)
verb
additem()
var/obj/O = input("Pick up what?") as obj in view(1)
usr.inventory.Add(O)
removeitem()
var/obj/O = input("Drop up what?") as obj in usr.inventory
usr.inventory.Remove(O)
In response to Dog Man
That isnt quite what i was refering to. Have you ever played airson mud? In the Dm commands you have add var wich adds a stat to the stat panel.

Im needing that verb."note to self dont type so fast"
In response to Dog Man
That isnt quite what i was refering to. Have you ever played airson mud? In the Dm commands you have add var wich adds a stat to the stat panel.

Im needing that verb."note to self dont type so fast"
In response to Jacob
I believe (haven't checked) you can add something to mob.vars (which is a list) to add a var to the mob. The real problem is just accessing it again, which can only done manually, or with very complex code. To display the vars on a stat panel, you have to search through mob.vars, and add them to the stat panel. You'd get a lot of things like icon and pixel_x, so you'll have to filter those out, too. Or you can just add it to a stat panel using a proc.

[edit]

Example of using the vars list (from the reference)

mob/verb/dump()
var/V
for(V in vars)
usr << "[V] = [vars[V]]"

Look it up: http://www.byond.com/docs/ref/info.html#/datum/var/vars