ID:287523
 
(See the best response by Forum_account.)
hi im kinda stuck here if anyone could help would be appreciated. what i want is to have a stat panel for items where lets say i have a sword wich adds 5 power would show as follows

image sword +5 power

this is what i got but does not work...


statpanel("inventory",usr.contents)
suffix = "[?]"

obj/weapon/

sword
desc = "plus 5 power"
icon = 'sword.dmi'
var/Aug=5


then i have verbs wich actually do the power up with Aug=5 and so on. im just needing help with the stat window display thanks in advance!
It be easy for people to help you with coding problems if you use <dm.> [your code here] <./dm> tags
thanks i was wondering how to do that! but still doesnt answer my main question since im not sure how to add the variable or description to stat this was just an example to show that i got the statpanel for items wich works but i dont know if i should use suffix or stat or whatever
Best response
If you already have the verbs to equip and unequip the item, you just need to add this when you equip the item:

suffix = desc

And do this when you remove the item:

suffix = ""

The desc is the string "plus 5 power". By setting the suffix to that when you equip the item the "plus 5 power" message will automatically be displayed in the stat panel. When you unequip the item you clear the suffix so it's not shown anymore.
thanks a bunch... now i get it i thought the suffix should be in the statpanel but actually it needs to be in the items verb itself! good to know