ID:140330
 
Code:
mob/proc/RefreshGrids()
var/i = 1
for(var/obj/KIDOU/S in src.skills)
src << output(S, "Main.Skills_Grid:[i],1")
i++


Problem description:
Nothing shows up in the grid, I've tested it by adding a /obj/KIDOU/Sho object to src.skills at Login...but nothing.
Please help! Thanks in advance!

~Hi1
Please, give me the complete code, inclusive the code of the object added...
In response to Twinsen99
My Login() Code:
mob/Login()
..()
src.skills+=/obj/KIDOU/Sho
src.RefreshGrids()
if(client.IsByondMember())
ismember=1
numberofplayers++
players += src
winset(src, "Main", "is-maximized=true")
if(src in banned)
src << "<font color=red><b>You're banned...</b></font>"
del(src)
if(src.key in admins)
src.verbs += typesof(/ADMIN/verb/)
winset(src, "admin_menu", "is-disabled=false")
src.loc=locate(5,3,1)


/obj/KIDOU/Sho Code:
obj/KIDOU
Sho
icon='misc.dmi'
icon_state="test"
Click(mob/M in get_step(usr, usr.dir))
view(usr) << output("[usr.name]:> Sho!", "Say_Output")
view(usr) << output("<font color=maroon>[usr.name] pushes [M.name] back one tile!</font>", "Say_Output")
if(M.dir == NORTH) M.y-=1
if(M.dir == SOUTH) M.y+=1
if(M.dir == EAST) M.x-=1
if(M.dir == WEST) M.x+=1


Need anything else??
In response to Hi1
Try usin this:
mob/proc/RefreshGrids()
var/i = 1
for(var/obj/KIDOU/S in src.skills)
winset(src, "Main.Skills_Grid", "current-cell=[i]")
src << output(S, "Main.Skills_Grid")
i++


Ifthis do not works i will give to you a code that i have, parecido com este, to you modify... =D
In response to Hi1
You're not adding an actual object instance to the list. You're only adding a type path to it.
In response to Kaioken
So it's not adding an object? Just the path to the object...?
In response to Kaioken
Then...how can I add the object?
In response to Hi1
Add an actual object reference instead of a type path.
mob/verb/test()
var/A = src
var/B = /obj
A << B

In the above example, A contains a reference to an object instance and B contains a type path.

If you want to create a new object instance, you use the new() instruction.
In response to Kaioken
@Thread_Starter.

Just to expand on that. You'll discover there are several ways in which to reference an object. Also be aware that the new() instruction calls that objects New() proc. So whatever you want to happen when that object is created just put it in that objects New() proc.

object
objects properties

New()
what you want that object to do on creation.

Other_Stuff()
...


You need to look up new() in the reference or you'll be lost.

In response to Hi1
skills += new/obj/KIDOU/


And make sure that created the variable skills this way:
var/list/obj/skills = new/list

With this, you can ADD obj'cts in the list...
In response to Hulio-G
I know about New()... <.<

I just forgot about using it to "create" an object. But Kaio helped me out on getting it working correctly. :)
In response to Hi1
Anytime ;o
Make sure you are calling this proc every time something changes in the grid, or at least looping it to call itself. The prior is most likely more resource efficient.
In response to Ultima Anime
Ultima Anime wrote:
Make sure you are calling this proc every time something changes in the grid, or at least looping it to call itself. The prior is most likely more resource efficient.

Not "at least". First, looping it is a terrible idea. As you said, it ONLY needs to be called when the grid needs to change. Also, having it "call itself" isn't looping, it's infinite recursion and that's BAD.