This is probably an extreemly easy question to answer but i just started today so...
how do u make inventories?
Copyright © 2024 BYOND Software.
All rights reserved.
ID:177004
Nov 20 2002, 11:40 pm
|
|
This is probably an extreemly easy question to answer but i just started today so...
how do u make inventories? |
In response to Xooxer
|
|
Thx m8 thats exactly what i needed
|
mob/Stat()
statpanel("Inventory", usr.contents)
You'll need two commands to add to, and remove things from the inventory. A standard set of Get and Drop verbs should do the trick:
mob/verb/get(var/obj/O as obj in oview(1))
O.Move(usr.contents)
This tells the game to look for any objects within 1 tile of the usr (oview(1)) and to give the usr the option of placing one of these objects in their inventory by selecting it from a list. The selected object's Move() proc is called, and told to move the object to the usr's contents list, which is displayed using a statpanel.
mob/verb/drop(var/obj/O as obj in usr.conents)
O.Move(usr.loc)
This tells the game to look for any objects within the usr's contents list(var/obj/O in usr.contents), and allow them to select one object from this list to move (O.Move())to the tile they are occupying(usr.loc).
I suggest looking up the Stat() proc for clients, as well as the Move() proc and contents list in the Reference. It may help to read some of the Tutorials, as I'm sure more than one of them covers this topic.
Hope that was helpful!
~X