Vehem
Modmod Monkey
- Joined
- Nov 22, 2005
- Messages
- 3,219
Prototype random name generator.
An excellent implementation - nice one

Prototype random name generator.
Aww, you could tie stats to each of the parts of the name too so that the critter has unique abilities and strengths! (Diablo Weapons anyone?)...
lWords1=["Great", "Mighty", "Strong"]
lPromo1=['PROMOTION_COMBAT5', 'PROMOTION_HEROIC_STRENGTH', 'PROMOTION_CITY_RAIDER']
lWords2=["heart", "blood", "blade", "hand"]
lPromo2=['PROMOTION_MARKSMAN', 'PROMOTION_CANNIBAL', PROMOTION_ENCHANTED_BLADE', 'PROMOTION_HIDDEN']
I mean do it the other way around.
Code:lWords1=["Great", "Mighty", "Strong"] lPromo1=['PROMOTION_COMBAT5', 'PROMOTION_HEROIC_STRENGTH', 'PROMOTION_CITY_RAIDER'] lWords2=["heart", "blood", "blade", "hand"] lPromo2=['PROMOTION_MARKSMAN', 'PROMOTION_CANNIBAL', PROMOTION_ENCHANTED_BLADE', 'PROMOTION_HIDDEN']
Then store the Random Numbers as Variables for re-use (can just keep using the same variable over), and along with the random name, you get random promotions, which fit the name!
Aww, you could tie stats to each of the parts of the name too so that the critter has unique abilities and strengths! (Diablo Weapons anyone?)...
lSchema=["PME","PMESPME","PESPE","PE","PMME","PMDME","PMAME","KPMESUM"]
sSchema = lSchema[CyGame().getSorenRandNum(len(lSchema), "Name Gen")-1]
sFull = ""
sKeep = ""
iUpper = 0
iKeep = 0
for iCount in range (0,len(sSchema)):
iDone = 0
sAction = sSchema[iCount]
if sAction == "P":
sAdd = lPre[CyGame().getSorenRandNum(len(lPre), "Name Gen")-1]
iDone = 1
if sAction == "M":
sAdd = lMid[CyGame().getSorenRandNum(len(lMid), "Name Gen")-1]
iDone = 1
if sAction == "E":
sAdd = lEnd[CyGame().getSorenRandNum(len(lEnd), "Name Gen")-1]
iDone = 1
if sAction == "S":
sAdd = " "
iDone = 1
if sAction == "D":
sAdd = "-"
iDone = 1
if sAction == "A":
sAdd = "'"
iDone = 1
if sAction == "K":
iKeep = 1
if sAction == "C":
iUpper = 1
if sAction == "U":
sAdd = sKeep
iDone = 1
# capitalizes phrase. Stops doing this after a new phrase is generated.
if iUpper == 1:
sAdd.Capitalize()
iUpper = iUpper - iDone
# stores the next phrase generated.
if iKeep == 1:
sKeep = sAdd
iKeep = iKeep - iDone
# only adds the phrase if a new bit was actally created.
if iDone == 1:
sFull = sFull + sAdd
Diablo Champion monsters perhaps...?
Single-unit art (ala Hero-promotion) + handful of random promotions + potential low-level items + a suitable name = random barbarian characters?
After all - even Orthus gets lonely sometimes...
Gofbad the Blade - Orc Warrior, Combat 1, Combat 2, Enchanted Blade - Combat 1 + 2 generated randomly (upto Combat 3), Enchanted Blade from "the Blade" epithet
Snicker Sandborn - Goblin Warrior, Combat 1, Cover 1, Nomad - Again Combat 1 and Cover 1 are granted randomly, Nomad is granted by the epithet
Korgan Dorstamp - Ogre, Combat 1, Combat 2, Shock 1 - All promotions generated randomly, no special epithet
etc...
Damnit, this happened with the main mod for a little while and I can't remember precisely why or in which version! I do remember that it came down to being a typo... I think it was when JADE_TORC was spelled JADE_TROC in the Hero adventure event...
If it triggers specifically when you upgrade to the Adventurer, look closely at the promotions you are granting to ensure that they all exist. Hopefully it is that easy.