ID:1813649
 
(See the best response by Kaiochao.)
Code:
mob
proc
new_char()
var/Classes = list (
"Warrior" = list(
White = 'BasesMaleWhite.dmi',
Tan = 'BasesMaleTan.dmi',
Black = 'BasesMaleBlack.dmi',
),
"Rogue" = list(
White = 'BasesMaleWhite.dmi',
Tan = 'BasesMaleTan.dmi',
Black = 'BasesMaleBlack.dmi',
),
"Mage" = list(
White = 'BasesMaleWhite.dmi',
Tan = 'BasesMaleTan.dmi',
Black = 'BasesMaleBlack.dmi',
)
)
while(!src.class)
src.gender = lowertext(input("Please select your gender") in list ("Male","Female"))
class = input(src, "Choose a class.", "Choose your class") as null|anything in Classes
if(!class) return
if(istype(class, /list))
skin = input(src, "Choose a skin tone.", "Select a skin tone") as null|anything in Classes[class]
if("No" == alert("Are you sure you want to be a [src.gender] [src.skin] [src.class]?", "Confirmation", "No", "Yes"))
src.class = null
src.update_appearance()
src << "Welcome to THE VOID!"
src.loc=locate(1,1,1)
proc/update_appearance()
if(skin)
icon = skin


Problem description:
The issue is the line reading "if(istype(class, /list))
skin = input(src, "Choose a skin tone.", "Select a skin tone") as null|anything in Classes[class]"

Nothing ever shows up asking me about skin changing. I get the box asking about classes and the confirmation box, but not the skin box.
istype is returning 0, that's why. It won't execute the input line for the skin unless it returns 1.

You don't even need these lines
if(!class) return
if(istype(class, /list))

Remove the "as null|anything" part for both inputs. It will function as intended.
Best response
Classes is a list of strings, where each string is associated to a another list of strings, where each of those strings is associated to an icon file.

If the player chooses a class from Classes, you have a string. To get the list of colors associated with that class, you use Classes[class]. For example, Classes["Rogue"] is a list:
list(
White = 'BasesMaleWhite.dmi',
Tan = 'BasesMaleTan.dmi',
Black = 'BasesMaleBlack.dmi',
)


After choosing a skin color from Classes[class], you have another string. It can be used to get an icon with Classes[class][skin]. For example, Classes["Rogue"]["Tan"] is 'BasesMaleTan.dmi'.