ID:149729
 
How would I create mobs with a var? Example:
var/new_mob = input("Which mob?") in list ("Mob1","Mob2")
new/mob/new_mob


Any help is appreciated.

-Rcet
Rcet wrote:
How would I create mobs with a var? Example:
var/new_mob = input("Which mob?") in list ("Mob1","Mob2")
new/mob/new_mob

I think I see what you're trying to do here. You want to create a /mob/Mob1 or /mob/Mob2 based on the results of input. Fortunately, this is doable.
var/mobtype = input("Which mob?") in list ("Mob1","Mob2")
mobtype="/mob/[mobtype]"
new/mob/new_mob = new mobtype()

DM recognizes strings for the new() syntax as well as type paths.

Lummox JR
In response to Lummox JR
You could also do it this way:

mob/verb/Create_mob()
var/types = typesof(/mob)//all mobs under /mob
var/newtype = input("Which mob do you want to make?")in types
new newtype(usr.loc)