ID:1628977
 
(See the best response by GhostAnime.)
Code:
usr << output(usr.contents,"window1,grid1")


Problem description:

This doesn't seem to work, I want to make a inventory out of a grid but this isn't functioning.

You need to use the format of: "grid1:X,Y" for the second parameter of output().
I tried that but I got a error.

winset: Element window1.grid1:1,1 not found.
winset: Element window1.grid1:1,1 not found.

here is my code.

mob/proc/inventory()
winset(src, "window1.grid1:1,1", "cells = 0x0")
In response to Roxito
Keyword Ter13 said: output()

If you look at what you are doing here, you are telling winset to look for the first cell of a grid and set all cells as 0.

Jusrremove the :1,1 in the winset to affect the grid element.
mob/proc/inventory()
winset(src, "window1.grid1", "cells = 0x0")
src << output("Inventory", "grid1:1-10,1")

Still doesn't affect it.
1-10 is not a valid coordinate for the x coordinate.
mob/proc/inventory()
winset(src, "window1.grid1", "cells = 0x0")
src << output("Inventory", "grid1:1,1,1")


I changed the code and text shows up that say inventory. But that was the only thing when i pick up the item it doesn't show up.
"grid1:1,1,1"

What are you doing? Are you even looking at your keyboard, or are you typing with your feet?
What am i doing wrong?
Does this: "grid1:1,1,1"

look like this:

"grid1:X,Y"?

What are you even trying to do by adding a third 1 in there?
Lol, i'm sorry. Also, where do i put my contents for it can show it in the grid?
Best response
Mind you, last time I programmed in BYOND was in the early 4.0 release so my information may be outdated.

You will have to output() each object of your contents every time you pick up or drop/use an item.

Picking up is not an issue sine you can always output to the next increment of the contents.

When you drop/use an item, at least in the old version (unsure if it occurs in the latest one), you will have to "erase" the old inventory grid (by setting grid,ells to 0x0) and output everything once more.

The reason is that if you do not do this, the item dropped/used will remain in the grid.

Here's the demo I made back in the old day: http://www.byond.com/developer/GhostAnime/inv4

It is best that you acquaint yourself with the latest information of the grid (and other) elements. To do this, see the skin parameter (can also be accessed via the Help menu in DM). Do not forget to read the Further Details section.
I <3 you Anime.(No homo)