ID:176600
 
How would I make my inventory paneel divided into different categories like weapons, armor and items?
Tokabol wrote:
How would I make my inventory paneel divided into different categories like weapons, armor and items?

mob/Stat()
statpanel("Status")
stat("")
stat("")
stat("")
statpanel("Inventory")
stat("")
stat("")
stat("")
statpanel("Armour")
stat("")
stat("")
stat("")
statpanel("Weaponry")
stat("")
stat("")
stat("")


To make a new statistical panel all you need to do is use the statpanel("") as shown in the above example.

This creates a new panel for you to use and therefore, you can order certain statistics for players into certain categories of panels.

--Lee
In response to Mellifluous
I don't want different panels. I want it all in the same panel but just in categories like this.

________
|Inventory|

Items
---------------
Potion
Torch
ect.

Weapons
----------------
Sword
Spear
Gun

Armor
----------------
Chain Mail
Helm
Gauntlets

With the icons and all of course
In response to Tokabol
mob/Stat()
statpanel("Status")
stat("Inventory")
stat("[src.contents]")
stat("--------------")
stat("Weapon")
stat("[src.wielded_weapon]")
stat("--------------")
stat("Armour")
stat("[src.equiped_armour]")


It would be done like the above then, with different variables for each part though.

The inventory will show each and every item under the inventory text.

The weapon will show the wielded weapon.

The armour would only show the equiped armour also.

You could change that so it would show more than the equiped armour, say if you wanted to show the armour as Head, Body, Arms, Hands, Legs, Feet, etc... You would make more of the 'stat("")' parts and insert the relevant variables. You can also do that for the weaponry too if you so desired.

--Lee
In response to Mellifluous
I think he's talking about organising items in the inventory based on category, not putting equipped items in the same tab as the inventory.

This is the way I'd do it:

Organise your items into types based on their category; e.g. obj/item/weapon for weapons, obj/item/armour for armour, etc. Then try something like this:

<code>Stat() statpanel("Inventory") stat("----","Weapons") //Section header for weapons for (var/obj/item/weapon/O in contents) stat(O) //Display all weapons stat("----","Armour") //Section header for armour for (var/obj/item/armour/O in contents) stat(O) //Display all armour //and so on...</code>

Now that I think of it, this is actually quite a nifty way of displaying inventories. Thanks Tokabol! :-)
In response to Crispy
Thanks, that's exactly what I needed.