ID:2046780   Mar 3 2016, 5:17 am (Edited by moderator on Mar 3 2016, 2:25 pm) (See the best response by Nadrew.) code mob proc ObjList() var/objs = 0 for(var/obj/P as null|anything in typesof(/obj)) winset(src, "Objects.objlist", "current-cell=[++objs]") src << output("
[P]", "Objects.objlist") src << output("[objs] Found", "Objects.objsfound") winset(src, "Objects.objlist", "cells=[objs]") Topic(href,href_list[]) if(href_list["cmd"]) switch(href_list["cmd"]) if("action") if(src == /obj/SingleFence) var/T = input("How Many Do u Want To Create?") as null|num if(T == 1) var/obj/F = new src(usr.loc) view() << " With A Few Waves Of The Hands [usr] Create's a [F:name] " return else var/obj/F = new src(usr.loc) F.amount = T view() << " With A Few Waves Of The Hands [usr] Create's [T] [F:name]'s " return else var/obj/F = new src(usr.loc) view() << " With A Few Waves Of The Hands [usr] Create's a [F:name] " return  im trying to make a window to show all Objects coded in game in a skin window and when you click an object it creates it, all Objects show in windows but when I click an object to create it I get the error: runtime error: Cannot execute null.Topic, any help would be great thanks().
 Mar 3 2016, 4:44 pm Best response You're setting the ref to P, but P is just a typepath, not an object. What you want is something like: [P]  Then inside of client/Topic(), you'd do something along the lines of: client/Topic(href,href_list[]) if(href && href_list["create_object"]) var/new_type = href_list["create_object"] new new_type(mob.loc) 
 Mar 4 2016, 2:33 am (Edited on Mar 4 2016, 4:36 am) In response to Nadrew I got this to work thanks 1 other thing is when I click to make a fence I want it to ask me how many to create but I cant seem to get it to work var/obj/amount = 1client Topic(href,href_list[]) if(href && href_list["create_object"]) if(href_list["create_object"] == "/obj/SingleFence") var/T = input("How Many Do u Want To Create?") as null|num if(T == 1) var/obj/new_type = href_list["create_object"] new new_type(mob.loc) view() << " With A Few Waves Of The Hands [usr] Create's a [new_type:name] " return else var/obj/new_type = href_list["create_object"] new new_type(mob.loc) new_type.amount = T <<<<<<With A Few Waves Of The Hands [usr] Create's [T] [new_type:name]'s " return  at the part where it says new_type.amount = T I get the error: runtime error: Cannot modify /obj/SingleFence.amount
 Mar 4 2016, 10:08 am new_type is still only a type path (or more accurately, just a string), not an obj. What you need to do is have a var hold the object you just created, which you aren't doing.
 Mar 4 2016, 11:24 am In response to Lummox JR how would I go about doing that? if u don't mind me askin
 Mar 4 2016, 11:35 am All you need to do is assign the result of new() to a var.
 Mar 4 2016, 12:18 pm In response to Lummox JR sorry but i dont know how i would do that
 Mar 4 2016, 12:33 pm var/obj_type/obj_instance = new obj_type(parameters)// or (because you can use a space instead):var obj_type/obj_instance = new obj_type(parameters)  Your corrected code would read:  var/obj/new_type = href_list["create_object"] var/obj/my_new_obj = new new_type(mob.loc) my_new_obj.amount = T  I'd skip storing the object type in a variable though, it doesn't look like you need it at this time. (Edit: Or on second thought, I do tend to favor verbosity; it's up to you but it's not necessary.)
 Mar 4 2016, 12:35 pm In your code, you can either have a second variable containing the object you created, or simplify the usage of new_type. var/obj/new_type = new href_list["create_object"](mob.loc)new_type.amount = T  But for future reference, what Lummox means is storing the result of new() in a variable (like I did above) so you can utilize it further in the code, this isn't needed if you don't need to interact much with the object after creation. var/obj/something/my_obj = new() // Creates a new /obj/something and assigns it to the my_obj variable. 
 Mar 4 2016, 12:36 pm Thank you very much