ID:158219
 
I know that it would first go
mob/verb/create_character()
usr.icon = input("Select an icon for your character.",
"Your Icon",
usr.icon) in list()

what go in the list besides the icons?
what would i put to make it add on to 'male human.dmi' icon when selected?
-I want to make a list where you select an item to add to your mob.

-I know that it would first go

mob/verb/create_character()
usr.icon = input("Select an icon for your character.",
"Your Icon",
usr.icon) in list()


-what goes in the list besides the icons you get to choose?

-what would i put to make it add on to 'male human.dmi' icon when selected?
Here is one way to do it:

mob/verb/create_character()
var
list/icons = list(
"Man" = "iconsfolder/man.dmi",
"Woman" = "iconsfolder/woman.dmi",
"Dog" = "iconsfolder/dog.dmi"
)

// [visible part] = [invisible part], [visible part] is what you see in the input-
// list, [invisible part] is not seen in the list, it's the icon path used to set
// the icon in the end.

icon_path = input("Select an icon for your character.", "Your Icon") in icons // choose an icon

if(fexists(icons[icon_path])) // does the icon exist?
usr.icon = file(icons[icon_path]) // file-ize the icon path and assign the icon to the mob
In response to Nielz (#2)
You do not require to specify the full path for the icons in the list. Simply include the name of the icon in single quotes( 'icon.dmi' ), and the compiler will include the icon automatically in your rsc file for later use. With file(), you will have to specify the icon files along with the game in a separate directory, since they will not be included in the .rsc.

mob/verb/create_character()
var
list/icons = list(
"Man" = 'man.dmi',
"Woman" = 'woman.dmi',
"Dog" = 'dog.dmi'
)

icon_path = input("Select an icon for your character.", "Your Icon") in icons

usr.icon = icons[icon_path]
In response to Metamorphman (#3)
Well, there's your refined answer Kokomo0020
In response to Nielz (#2)
As Metamorphman said (but not too clearly), the main flaw in your code is that it will only work when the icon files are locally present in the same folder of the DMB under the same path as you've defined - as currently file() only grabs files in the local filesystem (meaning that if you distribute your game with the RSC and DMB only, it will fail to work).
In response to Kaioken (#5)
I knew what Metamorphman meant, but thanks for the effort on clarifying it anyhow.