ID:2305046
 
(See the best response by Ter13.)
Code:
mob
var/HP = 100
Login()
var/species_type = input("Options:(Terran, Icelandic, Molten, or Cat", "Species") as text
var/char_name = input("Please name your character.", "Name") as text
name = "<b>([species_type])</b> [char_name]"
icon = 'skins.dmi'
if(species_type == "Terran")
icon_state = "terran_spider"
if(species_type == "Icelandic")
icon_state = "ice_spider"
if(species_type == "Molten")
icon_state = "lava_spider"
if(species_type == "Cat")
icon_state = "cat"
..()


Problem description: I'm trying to turn the character who spawns into a the species they choose. The problem I'm having is that each species is in a different directory, and I need to find something to put in these if statements to change the actual mob into this specific species. Is there any way to do this? (Game Git)

While the method is not very elegant, I believe the input() format you're looking for is this:

var/species_type = input(src, "What species would you like to be?", "Species Selection") in list("Terran", "Icelandic", "Molten", "Cat")


This gives the player a predetermined list to choose from instead of letting them type it (since you don't have any way of handling any entries typed other than those four).

Your question seemed like you were asking about something a bit deeper though - are you trying to change the mob type to something else?
That's exactly what I'm trying to do-

I'll give you an example of how I want to do it to help:
Let's say Terran Spiders have 'Earthquake'
and Molten Spiders have 'Eruption'
I only want each player to have that specific ability to their mob type.
Well, you could do it like this:

mob
terran
verb/earthquake()
icelandic
molten
verb/eruption()

Login()
..()
// do all your current login stuff here
if(species_type == "Terran")
src.client.mob = new /mob/terran


Just keep in mind that you'll want to overwrite the Login() proc of /mob/terran and the rest if you do it this way, because changing the client's mob will call Logout() on their current mob and Login() on their new one.
Best response
I think he's asking about child types.

Here's a quick tip for you: Divide your login process:

world
mob = /mob/char_creation

var
list/species = list("Terran"=/mob/terran,"Icelandic"=/mob/icelandic,"Molten"=/mob/molten,"Cat"=/mob/cat)

mob/char_creation/Login()
var/char_name = input("Please name your character.", "Name") as text
var/species = input("herpyderp","derpyherp") as anything in global.species
var/mob/creating = new global.species[species]
creating.name = "<b>([species])</b> [char_name]"

//do the rest of the character creation process here:

//when you are done with character creation:
creating.key = key

//DO NOT SUPERCALL (..()), you want to replace the default /mob/Login() proc completely.

mob
terran
icon = 'terran.dmi'
icelandic
icon = 'icelandic.dmi'
molten
icon = 'molten.dmi'
cat
icon = 'cat.dmi'


No if-else chain necessary. You can endlessly expand the global list for each type of species you want.

Also, you should take a look at switch()

        if(species_type == "Terran")
icon_state = "terran_spider"
if(species_type == "Icelandic")
icon_state = "ice_spider"
if(species_type == "Molten")
icon_state = "lava_spider"
if(species_type == "Cat")
icon_state = "cat"


switch(species_type)
if("Terran")
icon_state = "terran_spider"
if("Icelandic")
icon_state = "ice_spider"
if("Molten")
icon_state = "lava_spider"
if("Cat")
icon_state = "cat"


switch statements are quite a bit more efficient than a big block of ifs and if-else statements, and they are much cleaner looking for readers of your code.