Here's the bit where I'm displaying the line:
Code: Select all
label start:
$ racelist = ["human", "elf", "gnome"]
$ typelist = ["student", "coworker", "stranger"]
$ procaselist = ["m", "f", "t", "i", "n"]
$ buildlist = ["ripped", "emaciated"]
"This is a test."
$npc = NPCList(racelist, typelist, procaselist, buildlist, 1)
"Build Desc: [npc.builddesc]"
Code: Select all
init python:
enemyno = 0
class NPCList():
def __init__(self, racelist, typelist, procaselist, buildlist, level):
global enemyno
if enemyno < 5:
enemyno += 1
self.num = enemyno
elif enemyno == 6:
self.num = enemyno
else:
self.num = 0
self.race = renpy.random.choice(racelist) #Random race as determined by the area
if self.race == "human" or self.race == "elf":
self.racesize = 2
elif self.race == "gnome":
self.racesize == 1
else:
self.racesize == 0
self.type = renpy.random.choice(typelist) #Context description, like classmate or coworker or stranger
prorng = renpy.random.randint(1,100)
if nbchance >= prorng:
self.procase = "t"
elif wchance < nbchance and wchance > prorng:
self.procase = "f"
elif mchance < nbchance and mchance < wchance and mchance > prorng:
self.procase = "m"
else:
self.procase = renpy.random.choice(procaselist)
self.builddesc = []
genrng = renpy.random.randint(1,100)
if twchance >= genrng and self.procase == "f":
self.builddesc.append("curvy")
elif self.procase == "f":
self.builddesc.append("stocky")
elif tmchance >= genrng and self.procase == "m":
self.builddesc.append("bulky")
elif self.procase == "m":
self.builddesc.append("slender")
else:
self.builddesc.append(renpy.random.choice(buildlist))
self.level = level
Googling around, it seems like this has something to do with unicode vs ascii vs utf-8? I admit this is new to me so I'm not terribly educated on the topic.
https://stackoverflow.com/questions/977 ... -u-in-list