I am making a procedural generator for NPCs and am having trouble with getting them to have children.
My code for generating founders (those with arbitrary birth dates rather than driven by a pregnancy algorithm) works fine
#Make Founders
for x in range (NumberOfFounders):
y = str(x)
z = 'Person' + y
ListOfPeople.extend([z])
ListOfPeople[x] = Person(random.choice(ListOfNames), random.choice(ListOfNames), random.choice(ListOfNames), random.randint(1,10957), 'Null', 'Null', random.randint(0,1))
But when I tried to use similar code to make offspring I get "IndexError: list assignment index out of range" from
q = len(ListOfPeople) + 1
r = str(q)
s = 'Person' + r
ListOfPeople.extend([s])
ListOfPeople[q] = Person(random.choice(ListOfNames1), 'NameMother', 'NameFather', CurrentDate, 'Father', 'Mother', 1)
I will post more code if it is needed.
Thanks.