1. Create an object.
2. Name the object according to number of like-type objects Eg. Robot 1.
Here's the junk I'm working with:
world
mob=/mob/player
mob
player
icon = 'robot.dmi'
/* verb
Construct(robopads)
world << "A robotic landing pad has been born!"
new /obj/robo_pad(src.loc)
robopads ++
src.name = robopads */
turf
icon = 'turf.dmi'
obj
robo_pad
icon = 'robo_pad.dmi'
var/package
proc
born(var/am)
world << "initiating robo-pad setup.."
sleep(30)
world << "constructing robo-pad.."
src.icon_state = "a"
sleep(30)
world << "construction complete.."
am ++
src.name = "robo-pad" + "[am]"
-Delta0Zero2
While you could also do this with a global variable, I tend to shy away from this due to the encapsulation that the factory provides over the variable and the create method.