ID:155342
 
So i started coding things in for equipment slots,

But failed horrible, wasted 3 hours, had to just delete the whole thing....

Can someone give their two cents, or direct me 2 a library.









What i'm looking for is:



Equipment

Not the interface, but the idea of it.

Having items that are limited to each slot. And 1 item per slot.

So example


Helment
var/slot1//being the head slot
Sword
var/slot2//being the weilding slot

how would i go about making this done, with weapons only being able to go to their assigned slot? I know this would go somewhere in my equip verb....atleast i think..

Some examples would be very helpful!
The most basic way is to have variables for each slot number and the slot number variables for each object.

Also, to do your slot-inventory system, you should try using grids.

mob

var

slot_shirt = null

slot_pants = null

slot_shoes = null

obj

items

var /* the assigned slot. */ slot_number = 0

shirt

slot_number = 1

pants

slot_number = 2

shoes

slot_number = 3

verb

equip_item()

/* slot one. */ if( slot_number == 1 )

if( usr.slot_shirt )

usr << "This slot is in use!"

return 0

else /* if we are not using the slot, equip the item. */

usr.slot_shirt = 1
Lolz Runescape!

Anyway, you could just have Equipment Variables on the player

mob
var
Helmet
Cape
Armour
Legs


I believe you could also handle this with a datum.

When equipping an item, you would want to make sure that there is nothing currently equipped. In your equipment tab (or whatever you have) you may want to add a suffix "Equipped" to whatever you have equipped so that the player knows that they have something equipped.

Also, I came across an article that raised a good point about how annoying some games are, being nazis about 1 item equipped at a time, demanding that you unequip an item then equip the new one. You may just want to allow the player to automatically swap items if they have something currently equipped (as was suggested in that article I spoke of).
In response to Lugia319
<small>Lugia319 wrote:

You may just want to allow the player to automatically swap items if they have something currently equipped (as was suggested in that article I spoke of).</small>

He can still do the same, if referring to me with a few modifications and a proc to remove and re-equip items with one click.
In response to Neimo
No, actually I had left the window open while I was eating lunch :P I did not know you had left a reply until I posted.
In response to Lugia319
refer me to this article?