Hey-di-ho, I am back, with my fumbling attempts to update the name pools so that they stop breaking my immersion (no more elves named Melanie, plz and thx). (I had a brief but hilarious error where it turned absolutely everyone Japanese with Orcish given names. I feel a bit like a monkey trying to mash random keys until the bananas come out.)
After much fumbling around and getting frustrated by scope that I don't know enough to do correctly, I decided to just shove things into the Names.gd file with just a couple alterations to Constructor.gd and Assets.gd, but after some troubleshooting I have gotten to where the log file is just blank (sigh). Likely I got a bit too complicated too fast.
In Constructor's GetCaste function, I added a little bit under the Rich and Noble sections:
if person.race == "Human": ## Switch surname to a fancy one person.surname = globals.racefile.namefile.getMyName(person,"noble")
(I also have it erase a slave's surname, since this appears to come after one is set, and slaves having surnames always struck me as a little weird, since stealing heritage from slaves is one of those things that did happen, historically.)
In Names, I messed with the existing lists, and ported a number of names into my own lists, which I wound up sticking under a single variable, thusly:
var MyNames = {
kidnames = {
humanfemale = ["Addie", ... ],
humanmale = ["Abel", ... ],
humanenby = ["Alex", ... ]
},
nobility = {
humanmale = ["Abigail", ... ]
},
...
}
It also contains sets of Slave, Furry, and Ethnic names (the latter mostly for Tanuki, though if I get it working I'd like to be able to have a certain percentage of slaves have ethnic names where they actually match (as opposed to random Asian or Spanish surnames paired with random English given names, etc.).
Anyway, this is the function I eventually pared down to:
func getMyName(person,namepool = "kid",heritage = ""):
var text = person.race.to_lower() + person.sex.replace("futanari","enby")
match namepool:
"noble":
if MyNames.nobility.has(text):
return globals.randomfromarray(MyNames.nobility[text])
else:
return ""
"kid":
if MyNames.kidnames.has(text):
return globals.randomfromarray(MyNames.kidnames[text])
else:
return ""
"ethnic":
text = heritage + person.sex.replace("futanari","enby")
if MyNames.ethnicnames.has(text):
return globals.randomfromarray(MyNames.ethnicnames[text])
else:
return ""
_:
return ""
And then in Assets, I changed the getname() function to this:
func getname(person):
var text = person.race.to_lower()
var newname = ""
var classrating = 0
if person.race.has("Elf"):
text = "elf"
elif person.race.has("Tanuki"):
text = "asian"
elif person.race.has("Beastkin"):
text = person.race.replace("Beastkin ", "")
text = text.to_lower()
## Should amount to Wolf, Fox, Cat, or Bunny
elif person.race.has("Halfkin"):
text = "human" ## Might change later
text += person.sex.replace("futanari","enby")
if person.race in ["Human", "Elf", "Seraph"] && person.origins in ["rich", "noble"]:
classrating = 1
## Note: "bandit" is for later, if we get around to getting it set up
elif person.origins in ["slave", "bandit"]: ## Dropped poor
classrating = -1
## So it would be: Nobles (who also give their kids fancy names)
## then kids, then slavenames, then regular, yes?
if classrating > 0: ## In case we want to differentiate Rich from Noble
newname = globals.racefile.namefile.getMyName(person,"noble")
elif person.age == "child":
newname = globals.racefile.namefile.getMyName(person,"kid")
elif classrating < 0:
newname = globals.racefile.namefile.getMyName(person,"slave")
elif person.race.has("Tanuki"):
newname = globals.racefile.namefile.getMyName(person,"ethnic","asian")
elif person.race.has("Beastkin"):
newname = globals.racefile.namefile.getMyName(person,"furry")
## If the above doesn't work out...
if newname == "": ## Still haven't set name
if !globals.racefile.names.has(text):
text = "human" + person.sex.replace("enby","female")
person.name = getrandomfromarray(globals.names[text])
I'm clearly doing something wrong, but as I have reached the stage of zero mechanical feedback, I am left floundering. Halp?