ID:156050
 
I've made a couple of failed attempts at this, but here's the gist of it:

1. The player selects a mob from a list to act as a template.
2. After the base is chosen, the player makes changes to stats.
3. After confirmation of the changes, the new unit (named uniquely by the player) is added to a list. While in a battle, the player can select and bring a unit from the list into the fight.

My problem comes in at 3. I haven't been able to find a method of creating a new mob, saving it to a list, and then bring up a menu ("switch(alert" maybe?) where it can then be put into play. Other than hard-coding a precise number of "unit slots" or something, I have no idea of how to go about doing this.

Thanks for any suggestions here.
Lists can contain atoms as well as other variables. So, adding a new mob to a list is really not a complex process.

mob
var
list/units = list() // need a list for the mobs.

proc
newUnit(name)
var/mob/m = new () // create a new mob and assign it to a var
m.name = name // do all your necessary var stuff
src.units += m // add it to the list


I wouldn't copy and paste that with expectations of great things, just illustrating how to go about making a new mob and adding it to a list. You might also want to check the DM reference on lists and atoms, might give you a better idea.