ID:146856
 
Hi. Is there a way to do this?

mob/Stat()
statpanel("Inventory")
stat(inventory) //this is the player's inventory list, when I right-click an item in here, it doesn't show extra
statpanel("Skills")
stat(skills) //this is the player's skills

stat(contents) //Shows both the skills and inventory in same statpanel, when I right-click an item in here, it shows the drop() verb
//Whenever I add items to the inventory, I don't add it to contents, the reason I don't use contents because it contains both the skills and inventory.

obj/shirt
verb
pick_up()
var/mob/M = usr
set src in oview(0)
M.inventory += src
M << "You picked up the [src]"
drop()
set src in usr //This sets it when the user has it, I see it is "set src in List" by format 1. Is there a way to make it like:
//set src in usr.inventory <- must be in the inventory to use it
src.loc = M.loc
usr << "You dropped the [src]"


Mainly this is because I don't want to use the default contents list because I don't want to mix my skills and items into the mob contents list.
You know, you can go looking for specific item types:

mob
Stat()
statpanel("Skills:")
for(var/obj/skill/skill in src.contents)
stat(skill)
statpanel("Inventory:")
for(var/obj/item/item in src.contents)
stat(item)


OR, you could have done it the other way, and just used the skills list.

obj
skill
verb
use()
//use code here, doesn't require a setting.
mob
Stat()
statpanel("skills",src.skills)
statpanel("inventory",src.contents)


Get it?
In response to Ter13
I was about to use the first one a long time ago, but I figured that the for loop in the Stat() would cause too much of a hassle and as for the 2nd one you showed, the verbs on the skills would show up on right-click in the statpanel (hence it will be called by stat(skills)
In response to Ter13
Again, please use more than one space to represent an indent. Use two at least. Otherwise it's harder to see what goes where.

Lummox JR
In response to Lummox JR
That's how I indent, I'll try to remember in teh future, but I see that perfectly fine. I don't see how people can mix up what goes where with a single space. But then again, others' preferences, not you own... I know.
All "set" statements must appear at the top of a proc/verb, in your snippet you have "var/mob/M = usr" above your set statement.
In response to Nadrew
It still won't work. It doesn't shows the Drop() verb on the right-click of the item in the inventory assuming its from stat(inventory)

EDIT: There is no right-click popup when I call stat(inventory) but there is one when I call stat(contents), but I don't want to use contents cause skills is going to be mixed with the inventory and I don't want to use the for loop cause it will cause too much trouble if a lot of people are online.
In response to Ter13
Ter13 wrote:
That's how I indent, I'll try to remember in teh future, but I see that perfectly fine. I don't see how people can mix up what goes where with a single space. But then again, others' preferences, not you own... I know.

It may be valid in DM, but it's hardly perfectly fine for general posting. It's easy to mix up indentation with a single space simply because it's that much harder to line up by eye.

Besides, it's just ridiculous; it defeats the purpose of an indent in the first place if the indent is only a single character in width. A single-space indent isn't an indent; it's a slip of the finger.

Lummox JR
In response to Lummox JR
I don't use spaces in DM to indent. I have my tabs set at one width. When I write examples, I use spaces.