ID:890922
 
Keywords: grid, skills
(See the best response by Albro1.)
Code:
mob/proc/UpdateInventory()
var/items = 0
var/skills = 0
var/col = 1
for(var/obj/O in src)
if(O.skill == 1)
winset(src, "SkillGrid", "current-cell=[++skills]")
src << output(O, "SkillGrid")
if(skills >= 4)
skills = 0
continue
if(equipment && O.slot && equipment[O.slot]==O)
continue
winset(src, "inventory", "current-cell=[++items]")
src << output(O, "inventory")
winset(src, "inventory", "cells=[items]")


Problem description:

I'm kind of new to grids, so here it goes.
For the skills part of the grid, I want it to have only four "skills" across, and then move down, and repeat the process. Right now, it just adds a whole bunch across the very top of the grid.
It's has a flexible list of entries.

Recap: Fill in four skill objects, then move down a row, and do four more and repeat.

If you want a specific pattern in the grid, it needs to not be a flexible list grid. Otherwise, items in the grid are organized by index instead of cell position.
Best response
The kind of math you are looking for is this:
var/column = 1
var/row = 1
src << output("item", "SkillGrid:[column],[row]")
column += 1
row = round(column/4) // You need to manually round this UP, though. By default it rounds down


But of course, you should be able to go into the grid's settings in the interface and set it to 4 columns.