ID:147819
 
I know I already posted this about 2 weeks ago, but nobody really answered, and I was complained to about forgetting to put a topic.

I'm using the S_Admin's creation verb for the build function of my chat game and I was wondering how to fix it so that it says the objects name ("grass" for example) on the html thingy instead of the name ("/obj/turf/grass" for example 2).

See this for referance if you ahen't seen the S_Admin file (this is jsut a section, but it's what contains the part that needs changed)

create()
set desc = "() Create an object of any type"
set category = "GM"
var/html = ""
var/L[] = typesof(/obj)
var/Q[] = typesof(/turf)
L += Q
//BYOND BUG

//strip out illegal options
if(L.Find(/atom)) L -= /atom
if(L.Find(/atom/movable)) L -= /atom/movable
for(var/X in L)
//WORKAROUND FOR ABOVE BUG
switch("[X]")
if("/atom", "/atom/movable", "/mob/GM_verbs", "/mob/master_GM_verbs",
"/mob/admin_GM_verbs") continue //ignore options of these types
//END OF WORKAROUND
html += "[X]
"

usr << browse(html)

The part that needs changed lies after "//END OF WORKAROUND", I believe. I've tried "X.name", but it doesn't work.
CoWdUdE7 wrote:
for(var/X in L)

Declare that as an atom, and then use X.name.

var/L[] = typesof(/obj)
var/Q[] = typesof(/turf)

I think thoes should also be declared as:

var/list
obj/L = typesof(/obj)
turf/Q = typesof(/turf)