ID:154557
 
Most of the RPG style games out there have inventory systems, so, I was wondering if there's a common way of making these that just illudes me or something. Any suggetions for how to go about setting up my own?
On 5/25/01 3:43 pm Foomer wrote:
Most of the RPG style games out there have inventory systems, so, I was wondering if there's a common way of making these that just illudes me or something. Any suggetions for how to go about setting up my own?

BYOND originally started out as a project for making RPGs/MUDs, so it's got built-in functionality for inventories. Simply put, an obj X is carried by a mob Y if X.loc is equal to Y. NOT Y.loc--that's if X is sitting in the same square as Y--just Y. And again, BYOND was set up to display inventories pretty easily; the single line "stat(Y.contents)" will display everything carried by Y in the current stat panel.
In response to Leftley
On 5/25/01 4:49 pm Leftley wrote:
On 5/25/01 3:43 pm Foomer wrote:
Most of the RPG style games out there have inventory systems, so, I was wondering if there's a common way of making these that just illudes me or something. Any suggetions for how to go about setting up my own?

BYOND originally started out as a project for making RPGs/MUDs, so it's got built-in functionality for inventories. Simply put, an obj X is carried by a mob Y if X.loc is equal to Y. NOT Y.loc--that's if X is sitting in the same square as Y--just Y. And again, BYOND was set up to display inventories pretty easily; the single line "stat(Y.contents)" will display everything carried by Y in the current stat panel.

Um, could you put that in some readable form/code or at least tell me where I can find the information for that myself?
In response to Foomer
Um, could you put that in some readable form/code or at least tell me where I can find the information for that myself?

In other words:

if(X.loc == Y)
XIsInYsInventory()

That help? =)


mob/Stat()
statpanel("Inventory",src.contents) //display usr's inventory in Inventory panel
In response to Foomer
the single line "stat(Y.contents)" will display everything carried by Y in the current stat panel.

Um, could you put that in some readable form/code or at least tell me where I can find the information for that myself?

The Reference entries for "stat" and "contents" might be a good start. :)