ID:270033
 
can some one show me(correct example) how to make efficent code for stat panels like one panel for stats,inventory,skills, spells, commands, clan ect...
and to have contents in them like stats have mob stats in them inventory have mobs items, ect.
Read around every library.
In response to Mysame
i did
In response to Mysame
here is what your looking for.

mob/Stat()
..()
statpanel("[usr.name]'s Stats")//put the users name in the statpanel
stat("HP",usr.HP)//show them the HP stat based of their HP.
stat("MP,usr.MP)
stat("Attack",usr.Attack)
stat("Defense")
stat("Magic Attack",usr.Magic_Attack)
stat("Resistance",usr.Resistance)
stat("Gold",usr.Gold)


you can do it like this for all of the users stats. its very simple. for stuff like equipment, you have to make a separate statpanel and whatever you called the users stat corresponding to the type of equipment like this.

mob/Stat()
..()
statpanel("Equipment")
stat("Weapon",usr.W)//this is how mine i set up. when they equip the weapon, it becomes usr.W, or the users currently equipped armor, and shows up here.
stat("Armor",usr.A)


skills panel is done just like those 2. now for spells, you can do this.

mob/verb/Fireball()
set category = "Spells"//this will set the statpanel to Spells automatically.


just rememeber you have to put th set category under each spell.

as for inventory, you can do this. this one works fine, and its the one i use.

mob/Stat()
..()
statpanel("Inventory",usr.contents)//will tell them what the users has in their contents.
for(var/obj/O in src)stat(O)//shows the item


and there you go. that what you wanted to know right?

WARNING: ****DO NOT COPY AND PASTE EXAMPLES. STUDY THEM, UNDERSTAND THEM, AND LEARN FROM THEM. THANK YOU.*****
In response to Tenko Kajima
i was in the middle of writing it. read read my post above this one.
In response to Pyro_dragons
thanks man
In response to Tenko Kajima
no problem. i remember i when i was asking for there kinds of things. happy to return the favor.
I replyed in your duplicate post of this Im guessing so ill repost.

I will show you how to make two different panels, you repeat for more than one.

mob/Stat()
statpanel("Stats")
stat(src)
stat("Location:","[x],[y],[z]")
stat("Health:","[(hp/maxhp)*100]%")
stat("Stamina:","[(stamina/maxstamina)*100]%")
stat("Strength:",num2text(str,100))
stat("Defense:",num2text(str,100))

statpanel("Inventory",usr.contents)


And the commands bit would be defined in the verb it self:

mob/verb/W_Say(msg as text)
set category = "Chat"
world << "[src] wsays: [msg]"

In response to Xziaon
your a bit late its already been taken care of by me.