ID:141349
 
Alright so this whole interface thing is quite new to me, bu most of it is now making sense from going over most references, although I'd like to have my Abilities/Skills go into a grid I created when they learn this new skill. I already have the UpdateAbilities() but I'm not quite sure how to add these new learned skills into the abilities-pane, if someone could help me out with this, it would be much appreciated.

Code

mob/proc/UpdateAbilities()
var/abilities = 0
for(var/obj/O in src)
winset(src, "abilites-pane.abilities", "current-cell=[++abilities]")
src << output(O, "abilities-pane.abilities")
winset(src, "abilities-pane.abilities", "cells=[abilities]") // cut off any remaining cells
You only need to post it on one forum not both.
In response to Lundex
True, though I figured this really isn't a code problem.
It looks okay... but you are forgetting the column... you're only telling DM the row but not the column... and cells at the bottom is incomplete as well.


And there's a nifty output thing now which doesn't require to to set the current-cell to output something to a specific grid
proc()
winset("Grid ID", "cells=0x0") // Erases everything in the Grid, per say
for(X in Y)
src << output(X, "[Grid ID]:[column],[row]") // or was it row,column? meh.


Edit: Unless islist is checked off... forgot about that :o and forgot how to output that as well >_<
In response to GhostAnime
DM likes to do width by height and not height by width, so going by that logic, it would be row,column. I could be wrong though :\
In response to Spunky_Girl
Just checked the Skin Reference, said the style was "[id]:[column],[row]".

Though I admit that sometimes I mix row and column up
In response to GhostAnime
Ah, okay. Good to know. Tables mix me up sometimes too ^-^
Okay thanks for fixing the code that I created, it makes more sense now. But I'm still stumped on bringing stats to the grid pane I created.. and not to mention bringing skills that use icons to the ability pane I made for them..
In response to Zekkeyen
Um, for stats, you directly output the stat to the appropriate grid ID & column/row:
X << output("J00 R 53><`/", "Info:1,1")


For icon abilities, these abilities MUST be an object and must NOT be temp objects, meaning they are not created + deleted soon after:
X << output(Skill_Object, "Skillz:2,0")
In response to GhostAnime
GhostAnime wrote:
Um, for stats, you directly output the stat to the appropriate grid ID & column/row:
X << output("J00 R 53><`/", "Info:1,1")

For icon abilities, these abilities MUST be an object and must NOT be temp objects, meaning they are not created + deleted soon after:
X << output(Skill_Object, "Skillz:2,0")


Ah thanks a bunch bro, been wondering that for ages now. Thanks again for all your help as well.
In response to GhostAnime
And you have to remember that garbage collection will delete your object if you aren't careful.
In response to GhostAnime
GhostAnime wrote:
Um, for stats, you directly output the stat to the appropriate grid ID & column/row:
X << output("J00 R 53><`/", "Info:1,1")

For icon abilities, these abilities MUST be an object and must NOT be temp objects, meaning they are not created + deleted soon after:
X << output(Skill_Object, "Skillz:2,0")


Alright so I got the stats correctly working on the Grid panel now. (Thank god) But now I'm having an issue.. I tried using the code above but I'm having errors with getting the icon onto the gold grid, this is the code I've tried:

The object with a click()

obj
Drop_Gold
name = "Drop Gold"
icon = 'Icons.dmi'
icon_state = "Gold"
Click()
var/dropgold = input("How much you want to drop?","Drop Gold",) as num
if(dropgold<=0)
return
if(dropgold>usr:gold)
usr << output("<b>You dont have that much gold to drop.", "info-output")
return
else
var/O = new /obj/goldbag(usr.loc)
O:gold = dropgold
usr.gold -= dropgold
usr << output("<b>You drop [dropgold] gold", "info-output")
return


I'd like it to connect to a small gold grid I created with the icon showing up and being able to use the click() with the icon. I tried the following:

usr << output(Drop_Gold, "gold:1,1")


And the errors comes up saying that Drop_Gold is an undefined variable.. I hope this is enough information.
In response to Zekkeyen
Um... you don't have a new instance of the object... the object must exist!
X << output("You see yourself:", "Grid:1,1")
X << output(X, "Grid:2,1")