ID:169729
 
obj/inventory
weapons
BrassKnuckle
icon='BrassKnuckle.dmi'
name = "Brass Knuckles"
mob
Stat()
statpanel("Inventory",src.contents)
stat(new /obj/inventory/weapons/BrassKnuckle)


I tried this, It's not showing anything in the statpanels. Suggestions? Fixes? Something I did wrong?

~>Jiskuha
Use a list with the obj in it.
In response to XxDragonFlarexX
How would I show the contents of the list in the statpanel?

~>Jiskuha
In response to Jiskuha
Just as if you were showing a regular var, but like this stat(usr.mylist).
In response to XxDragonFlarexX
That would just show text wouldn't it?

~>Jiskuha
In response to Jiskuha
Jiskuha wrote:
That would just show text wouldn't it?

~>Jiskuha

No.
when you go stat(contents), you're showing the contents list, and it shows the icons too, doesn't it?
That works perfectly fine in my test case, though the brassknuckle shows up in the "Stats" panel and not the inventory panel. It's also very innefficient to create new objects in Stat, since you will be creating and deleting objs every 3/5ths of a second or so for every player in the game.

There is no need to display it as part of a list. Displaying an atom will automatically show it's icon.

Do you override Stat() in another place?
In response to Shadowdarke
Yep, Found it and fixed it. Now on to a new problem.

obj/inventory
weapons
Hand
icon='Hand.dmi'
name = "Punch"
Click(mob/M)
usr.Attack(M)

mob/verb/Attack(mob/M in oview(1))
world()<<"Attacked!</small>"


How can I set it so that it attacks a mob a player stands in front of and not just click it and get runtimes?

~>Jiskuha
In response to Jiskuha
You aren't telling it what mob to attack. You would want something more like the following.
obj/inventory
weapons
Hand
Click()
var/mob/M = locate() in get_step(usr,usr.dir)
if(!M)return
usr.Attack(M)

And, since you want it to be in front of the mob, you will probably want to change the parameter for the verb itself as well.
mob/verb/Attack(mob/M in get_step(src,dir))