ID:167342
 
        Create_Custom_Object(I as icon)
for(icon_states(I))
input("There are multiple Icon States. Choose the normal.") in list("null" + icon_states(I))
var/obj/M = new/obj
M.icon = I
M.loc = src


My bad attempt. Someone tune it up.
tune it up how? what are you needing help with? if your code is broken, why not post the errors you are getting?
In response to digitalmouse
No errors, thats the problem. ish.



There should be a Input list coming up saying that, with the icon states listed, as well as null.

But nothing does.
RedlineM203 wrote:
>       Create_Custom_Object(I as icon)
> for(icon_states(I))
> input("There are multiple Icon States. Choose the normal.") in list("null" + icon_states(I))
> var/obj/M = new/obj
> M.icon = I
> M.loc = src
>


The problem is that you're looping through the icon states, and every time you loop through one, you're inputting the player to choose one, yet you don't store the value they input. You are also putting a list inside a list with "null" in it, which would make no sense in what you're trying to do.

mob/verb
Create_Custom_Object(I as icon)
var/i
var/list/icon_states = icon_states(I)
if(length(icon_states) > 1) // if there are more than one states
i = input(src, "There are multiple Icon States.") as null|anything in icon_states + "null"
if(!i) return
if(i == "null") i = ""
else if(!length(icon_states)) // if there are no states
src << "There are no icon_states in the icon you put in!"
else
i = icon_states[1] // take the first state
var/obj/O = new (src.loc)
O.icon = I
O.icon_state = i


This will allow the player to select an icon state from a list if the icon has more than one state. Otherwise, it'll just take the first state in the icon.

~~> Unknown Person
In response to Unknown Person
Cool, thanks.