ID:653862
 
(See the best response by DarkCampainger.)
Code:
proc/Human_Village_Generator()
for(var/obj/Emblems/Human/Village_1/V in world)
if(V.Population < V.Population_Max)
var/list/L = list()
for(var/turf/T in locate(/area/Villages/Humans/Village_1/))
if(!T.Occupied)
L += T
if(L.len)
var/turf/T = pick(L)
T.Occupied = 1
V.Population ++
spawn(1)
Human_Village_Generator()
var/mob/Computer/Human/H = new /mob/Computer/Human(locate(T.x,T.y,T.z))
H.Village = 1


Problem description:

It seems the the proc always stops once it creates the new mob, so therefore the Village for the new mob isn't set. I've also tried multiple other scenarios using while, but the same thing happens everytime, the proc immediately stops once the mob has been created. Can anyone assist me with some help?
proc/Human_Village_Generator()
for(var/obj/Emblems/Human/Village_1/V in world)
if(V.Population < V.Population_Max)
var/list/L = list()
for(var/turf/T in locate(/area/Villages/Humans/Village_1/))
if(!T.Occupied)
L += T
if(L.len)
var/turf/T = pick(L)
T.Occupied = 1
V.Population ++
var/mob/Computer/Human/H = new /mob/Computer/Human(locate(T.x,T.y,T.z))
H.Village = 1
spawn(1)
Human_Village_Generator()


Untested but give it a go..
I tried that way already, but I tried again just for testing purposes. It cuts off at the new creation of the mob, and doesn't continue to create any others, AND it's village isn't even set to one.
Best response
Do you create any infinite loops or sleep() in /mob/Computer/Human/New()? (such as an AI loop?)

If so, make sure you spawn off that loop, or it will "block" new() from returning.

Also, it looks like that first for() loop should just be a locate(), unless you actually intend to have multiple Village_1 object emblems in the world:
var/obj/Emblems/Human/Village_1/V = locate() in world
Ahh thank you, that was my problem! I had the AI being called when a new computer was created without the spawn. And also thanks for the tip for the Emblem, really appreciated!